Class ConfluenceMigrationScriptService

  • All Implemented Interfaces:
    org.xwiki.script.service.ScriptService

    @Component
    @Named("confluenceMigration")
    @Singleton
    public class ConfluenceMigrationScriptService
    extends Object
    implements org.xwiki.script.service.ScriptService
    Expose various FilterStream related APIs to scripts.
    Since:
    1.0
    Version:
    $Id$
    • Field Detail

      • PREFILLED_INPUT_PARAMETERS

        public static final Map<String,​String> PREFILLED_INPUT_PARAMETERS
        Default input filter stream migration parameter values.
        Since:
        1.19.0
      • PREFILLED_OUTPUT_PARAMETERS

        public static final Map<String,​String> PREFILLED_OUTPUT_PARAMETERS
        Default output filter stream migration parameter values.
        Since:
        1.19.0
    • Constructor Detail

      • ConfluenceMigrationScriptService

        public ConfluenceMigrationScriptService()
    • Method Detail

      • migrate

        public org.xwiki.job.Job migrate​(org.xwiki.model.reference.DocumentReference documentReference,
                                         InputStream confluencePackage,
                                         Map<String,​Object> inputProperties,
                                         Map<String,​Object> outputProperties)
        Parameters:
        documentReference - the reference of the document that performs the migration.
        confluencePackage - the input stream for the package that will be used for the migration.
        inputProperties - the properties for the confluence input filter stream.
        outputProperties - the properties for the instance output filter stream.
        Returns:
        the job.
      • getLastJob

        public org.xwiki.job.Job getLastJob​(org.xwiki.model.reference.DocumentReference documentReference)
        Parameters:
        documentReference - the document reference associated with the desired job.
        Returns:
        the last job that was executed or the currently executing job.
      • checkMemory

        public String checkMemory()
        Check if the maximum memory and the initial memory are at least half of the machine memory.
        Returns:
        the status of the memory check
      • checkCache

        public String checkCache()
        Check the value of the xwiki.store.cache.capacity property from xwiki.cfg.
        Returns:
        the status of the cache check
      • checkWikiNotifications

        public String checkWikiNotifications()
        Check the notifications.enabled and notifications.emails.enabled values from xwiki.properties.
        Returns:
        the status of the notifications check
      • checkCurrentUserNotification

        public String checkCurrentUserNotification()
        Check the notification preferences in the current user's profile.
        Returns:
        the status of the current user's notification preferences check
      • checkListener

        public String checkListener​(String listenerClassName,
                                    boolean isMandatory)
        Check if a given listener is enabled or not.
        Parameters:
        listenerClassName - the class name of the listener
        isMandatory - the flag to know the need (mandatory or optional)
        Returns:
        the status of the listener state check
      • getMemory

        public String getMemory()
        Get the machine memory.
        Returns:
        the formatted machine memory size
      • getXms

        public String getXms()
        Get the initial memory allocation pool.
        Returns:
        the formatted initial memory size
      • getXmx

        public String getXmx()
        Get the maximum memory allocation pool.
        Returns:
        formatted maximum memory size
      • getCache

        public int getCache()
        Get the xwiki.store.cache.capacity value from xwiki.cfg.
        Returns:
        the formatted cache size
      • checkCurrentUserNotificationCleanup

        public String checkCurrentUserNotificationCleanup()
        Check if the current user's notifications are cleaned.
        Returns:
        the status of the clean check
      • getMutablePrefilledConfiguration

        public Map<String,​Map<String,​String>> getMutablePrefilledConfiguration()
        Returns:
        a mutable copy of the prefilled parameters.
        Since:
        1.21.0