Class AbstractExtensionRequest

java.lang.Object
org.xwiki.job.AbstractRequest
org.xwiki.extension.job.AbstractExtensionRequest
All Implemented Interfaces:
Serializable, ExtensionRequest, org.xwiki.job.Request
Direct Known Subclasses:
InstallRequest, UninstallRequest

public abstract class AbstractExtensionRequest extends org.xwiki.job.AbstractRequest implements ExtensionRequest
Base class for extension manipulation related Request implementations.
Since:
4.0M1
Version:
$Id: 3933fc8de0a3da647184f28f281a2063225ba7a3 $
See Also:
  • Field Details

  • Constructor Details

    • AbstractExtensionRequest

      public AbstractExtensionRequest()
      Default constructor.
    • AbstractExtensionRequest

      public AbstractExtensionRequest(org.xwiki.job.Request request)
      Parameters:
      request - the request to copy
  • Method Details

    • getExtensions

      public Collection<ExtensionId> getExtensions()
      Specified by:
      getExtensions in interface ExtensionRequest
      Returns:
      the ids of the extensions on which to apply the task.
    • getExcludedExtensions

      public Collection<ExtensionId> getExcludedExtensions()
      Returns:
      extensions to not take into account
    • getCoreExtensions

      @Unstable public Collection<ExtensionId> getCoreExtensions()
      Returns:
      the extension to identify as core extensions
      Since:
      15.0RC1
    • getNamespaces

      public Collection<String> getNamespaces()
      Specified by:
      getNamespaces in interface ExtensionRequest
      Returns:
      the namespaces on which to apply the task.
    • hasNamespaces

      public boolean hasNamespaces()
      Specified by:
      hasNamespaces in interface ExtensionRequest
      Returns:
      indicate if the request is applied on specific namespace or all of them
    • addExtension

      public void addExtension(ExtensionId extensionId)
      Parameters:
      extensionId - the extension identifier
    • addExtension

      public void addExtension(Extension extension)
      Parameters:
      extension - the extension to validate and for which to resolve dependencies
      Since:
      15.2RC1
    • addExcludedExtension

      public void addExcludedExtension(ExtensionId extensionId)
      Parameters:
      extensionId - the extension identifier
    • addCoreExtension

      @Unstable public void addCoreExtension(ExtensionId extensionId)
      Parameters:
      extensionId - the extension identifier
      Since:
      15.0RC1
    • addNamespace

      public void addNamespace(String namespace)
      Parameters:
      namespace - the namespace
    • isRootModificationsAllowed

      public boolean isRootModificationsAllowed()
      Specified by:
      isRootModificationsAllowed in interface ExtensionRequest
      Returns:
      indicate if it's allowed to do modifications on root namespace during the job execution (not taken into account if the target of the request is root namespace)
    • setRootModificationsAllowed

      public void setRootModificationsAllowed(boolean allowed)
      Parameters:
      allowed - indicate if it's allowed to do modifications on root namespace during the job execution (not taken into account if the target of the request is root namespace)
    • setRewriter

      public void setRewriter(ExtensionRewriter rewriter)
      Allow modifying manipulated Extensions on the fly (change allowed namespaces, dependencies, etc.).
      Parameters:
      rewriter - the filter
      Since:
      8.4.2, 9.0RC1
    • getRewriter

      public ExtensionRewriter getRewriter()
      Description copied from interface: ExtensionRequest
      Allow modifying manipulated Extensions on the fly (change allowed namespaces, dependencies, etc.).
      Specified by:
      getRewriter in interface ExtensionRequest
      Returns:
      the filter
    • setCoreExtensionRepository

      public void setCoreExtensionRepository(CoreExtensionRepository repository)
      Parameters:
      repository - the repository to use to find core extensions
      Since:
      15.0RC1
    • getCoreExtensionRepository

      public CoreExtensionRepository getCoreExtensionRepository()
      Specified by:
      getCoreExtensionRepository in interface ExtensionRequest
      Returns:
      the repository to use to find core extensions
    • isUninstallAllowed

      public boolean isUninstallAllowed()
      Specified by:
      isUninstallAllowed in interface ExtensionRequest
      Returns:
      true if it's allowed remove extension in conflict with the new extension(s)
    • setUninstallAllowed

      public void setUninstallAllowed(boolean allowed)
      Parameters:
      allowed - true if it's allowed remove extension in conflict with the new extension(s)
      Since:
      9.1RC1
    • isInstalledIgnored

      public boolean isInstalledIgnored()
      Specified by:
      isInstalledIgnored in interface ExtensionRequest
      Returns:
      true true if already installed extensions should not be taken into account while resolving the install plan
    • setInstalledIgnored

      public void setInstalledIgnored(boolean ignored)
      Parameters:
      ignored - true if already installed extensions should not be taken into account while resolving the install plan
      Since:
      15.0CR1