Package com.xwiki.confluencepro.script
Class ConfluenceMigrationScriptService
- java.lang.Object
-
- com.xwiki.confluencepro.script.ConfluenceMigrationScriptService
-
- All Implemented Interfaces:
org.xwiki.script.service.ScriptService
@Component @Named("confluenceMigration") @Singleton public class ConfluenceMigrationScriptService extends Object implements org.xwiki.script.service.ScriptServiceExpose various FilterStream related APIs to scripts.- Since:
- 1.0
- Version:
- $Id$
-
-
Field Summary
Fields Modifier and Type Field Description static Map<String,String>PREFILLED_INPUT_PARAMETERSDefault input filter stream migration parameter values.static Map<String,String>PREFILLED_OUTPUT_PARAMETERSDefault output filter stream migration parameter values.static StringROLEHINTThe rolehint of the class.
-
Constructor Summary
Constructors Constructor Description ConfluenceMigrationScriptService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringcheckCache()Check the value of the xwiki.store.cache.capacity property from xwiki.cfg.StringcheckCurrentUserNotification()Check the notification preferences in the current user's profile.StringcheckCurrentUserNotificationCleanup()Check if the current user's notifications are cleaned.StringcheckListener(String listenerClassName, boolean isMandatory)Check if a given listener is enabled or not.StringcheckMemory()Check if the maximum memory and the initial memory are at least half of the machine memory.StringcheckWikiNotifications()Check the notifications.enabled and notifications.emails.enabled values from xwiki.properties.intgetCache()Get the xwiki.store.cache.capacity value from xwiki.cfg.org.xwiki.job.JobgetLastJob(org.xwiki.model.reference.DocumentReference documentReference)StringgetMemory()Get the machine memory.Map<String,Map<String,String>>getMutablePrefilledConfiguration()StringgetXms()Get the initial memory allocation pool.StringgetXmx()Get the maximum memory allocation pool.org.xwiki.job.Jobmigrate(org.xwiki.model.reference.DocumentReference documentReference, InputStream confluencePackage, Map<String,Object> inputProperties, Map<String,Object> outputProperties)
-
-
-
Field Detail
-
ROLEHINT
public static final String ROLEHINT
The rolehint of the class.- See Also:
- Constant Field Values
-
PREFILLED_INPUT_PARAMETERS
public static final Map<String,String> PREFILLED_INPUT_PARAMETERS
Default input filter stream migration parameter values.- Since:
- 1.19.0
-
-
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 listenerisMandatory- 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
-
-