Interface SyncInstance
SyncInstance represents an instance of a synchronizer, configured with user-specified parameters
to act on some structure under some user account. It may be either installed on that structure or
represent a one-time synchronization action. It can represent an
instance of a synchronizer that is not currently available, e.g., when the module which defines it is not loaded;
then and only then getSynchronizer() returns null.
The synchronizer receives SyncInstance parameter whenever it is asked
to do an instance-specific task such as syncing.
- Author:
- Igor Sereda
-
Method Summary
Modifier and TypeMethodDescriptionlonggetId()Returns the ID of this synchronizer instance.Synchronizer parameters.longReturns the ID of the structure this sync instance is acting on.Returns the synchronizer for this sync instance.Returns module key of the synchronizer for this sync instance.Returns user key of the user account that is used to run synchronizer jobs with this sync instance.<T> AtomicReference<T>transientData(String key) Provides the synchronizer with a temporary / cache storage.
-
Method Details
-
getId
long getId()Returns the ID of this synchronizer instance. It is 0 iff this sync instance represents a one-time resync. -
getSynchronizer
Returns the synchronizer for this sync instance.nullmeans that the synchronizer is currently unavailable (the module that defines it is not loaded). -
getSynchronizerModuleKey
Returns module key of the synchronizer for this sync instance. Always non-null, even if the synchronizer is currently unavailable. -
getStructureId
long getStructureId()Returns the ID of the structure this sync instance is acting on. -
getParameters
Synchronizer parameters. The type of the object is controlled by the synchronizer'sStructureSynchronizer.buildParametersFromForm(java.util.Map<java.lang.String, ?>, com.atlassian.jira.web.action.JiraWebActionSupport)andStructureSynchronizer.restoreParameters(java.lang.String)methods.- Returns:
- the parameters of the synchronization
-
getUserKey
Returns user key of the user account that is used to run synchronizer jobs with this sync instance. -
transientData
Provides the synchronizer with a temporary / cache storage.
The
keyparameter is an arbitrary string that the synchronizer can use to have storage for several types of the information. The values are stored for this sync instance only.Note: in JIRA Data Center, the cache is local to the current node; changes to the cached data on one node are not visible by other nodes.
Also note that the cache lifetime is shorter than the lifetime of this
SyncInstance: it may be cleared, for example, when someone modifies the parameters of this instance. Cache may also be cleared in other circumstances, like when there are many synchronizer instances in the system.- Type Parameters:
T- type of data stored- Parameters:
key- data key- Returns:
- the container for the stored data
-