@PublicApi
public 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.
Modifier and Type | Method and Description |
---|---|
long |
getId()
Returns the ID of this synchronizer instance.
|
Object |
getParameters()
Synchronizer parameters.
|
long |
getStructureId()
Returns the ID of the structure this sync instance is acting on.
|
StructureSynchronizer |
getSynchronizer()
Returns the synchronizer for this sync instance.
|
String |
getSynchronizerModuleKey()
Returns module key of the synchronizer for this sync instance.
|
String |
getUserKey()
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.
|
long getId()
@Nullable StructureSynchronizer getSynchronizer()
null
means that the synchronizer is currently
unavailable (the module that defines it is not loaded).@NotNull String getSynchronizerModuleKey()
null
, even if the synchronizer
is currently unavailable.long getStructureId()
@Nullable Object getParameters()
StructureSynchronizer.buildParametersFromForm(java.util.Map<java.lang.String, ?>, com.atlassian.jira.web.action.JiraWebActionSupport)
and StructureSynchronizer.restoreParameters(java.lang.String)
methods.@NotNull String getUserKey()
@NotNull <T> AtomicReference<T> transientData(String key)
Provides the synchronizer with a temporary / cache storage.
The key
parameter 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.
T
- type of data storedkey
- data keyCopyright © 2023 ALM Works. All Rights Reserved.