Class JiraHomeReplicatorService
java.lang.Object
com.atlassian.jira.service.AbstractService
com.atlassian.jira.cluster.disasterrecovery.JiraHomeReplicatorService
- All Implemented Interfaces:
ObjectConfigurable
,Startable
,JiraService
,Runnable
Secondary Jira Home that tracks changes to attachment, index, avatar and plugin files.
- Since:
- v6.4
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclass
class
static class
-
Field Summary
Fields inherited from class com.atlassian.jira.service.AbstractService
log, name, SERVICE_EVENT
Fields inherited from interface com.atlassian.jira.service.JiraService
NAME_COMPARATOR
-
Constructor Summary
ConstructorsConstructorDescriptionJiraHomeReplicatorService
(JiraHome jiraHome, SecondaryJiraHome secondaryHome, ApplicationProperties applicationProperties, AttachmentConfigStore attachmentConfigStore, PluginPath pluginPath, com.atlassian.beehive.ClusterLockService clusterLockService, com.atlassian.scheduler.SchedulerService schedulerService, JiraProperties jiraProperties, AvatarFileStoreProvider avatarFileStoreProvider, AttachmentFileStoreProvider attachmentFileStoreProvider) -
Method Summary
Modifier and TypeMethodDescriptionRetrieves an object configuration object with properties that can be setReturns the types of files that this service will replicate.boolean
isEnabled
(JiraHomeChangeEvent.FileType fileType) Indicates whether the given file type is enabled for replication.boolean
Indicates whether the replicator service is doing a full replication, namely scanning the enabled directories for differences between Jira home and the secondary store.void
For every file changed event, we perform an async task to add/move/delete the file.void
Request a full replication of files in the home directories that are configured for replication.void
run()
This method must be implemented in a subclass, and performs the functionality that the service performs.void
shutDown
(ComponentManagerShutdownEvent shutdownEvent) void
start()
This method will be called after the plugin system is fully initialised and all components added to the dependency injection framework.Methods inherited from class com.atlassian.jira.service.AbstractService
destroy, getDefaultProperty, getDescription, getKey, getLongProperty, getName, getObjectConfiguration, getProperties, getProperty, getTextProperty, hasProperty, init, isInternal, isUnique, setName
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.atlassian.jira.service.JiraService
init
-
Constructor Details
-
JiraHomeReplicatorService
public JiraHomeReplicatorService(JiraHome jiraHome, SecondaryJiraHome secondaryHome, ApplicationProperties applicationProperties, AttachmentConfigStore attachmentConfigStore, PluginPath pluginPath, com.atlassian.beehive.ClusterLockService clusterLockService, com.atlassian.scheduler.SchedulerService schedulerService, JiraProperties jiraProperties, AvatarFileStoreProvider avatarFileStoreProvider, AttachmentFileStoreProvider attachmentFileStoreProvider)
-
-
Method Details
-
start
Description copied from interface:Startable
This method will be called after the plugin system is fully initialised and all components added to the dependency injection framework. -
onFileChangeEvent
For every file changed event, we perform an async task to add/move/delete the file.- Parameters:
event
- the event
-
shutDown
-
isEnabled
Indicates whether the given file type is enabled for replication.- Parameters:
fileType
- the file type- Returns:
- see description
-
isReplicating
public boolean isReplicating()Indicates whether the replicator service is doing a full replication, namely scanning the enabled directories for differences between Jira home and the secondary store.- Returns:
- true if a replication is currently in progress
-
replicateJiraHome
public void replicateJiraHome() throws com.atlassian.scheduler.SchedulerServiceExceptionRequest a full replication of files in the home directories that are configured for replication.- Throws:
com.atlassian.scheduler.SchedulerServiceException
-
run
public void run()Description copied from class:AbstractService
This method must be implemented in a subclass, and performs the functionality that the service performs. This method is called after the duration specified through the administration web interface.- Specified by:
run
in interfaceJiraService
- Specified by:
run
in interfaceRunnable
- Specified by:
run
in classAbstractService
- See Also:
-
getObjectConfiguration
Description copied from interface:ObjectConfigurable
Retrieves an object configuration object with properties that can be set- Specified by:
getObjectConfiguration
in interfaceObjectConfigurable
- Returns:
- ObjectConfiguration object
- Throws:
ObjectConfigurationException
-
getReplicableFileTypes
Returns the types of files that this service will replicate.- Returns:
- see description
-