Class SynchronizationContext
java.lang.Object
org.ametys.plugins.repository.data.holder.values.SynchronizationContext
- Direct Known Subclasses:
- ContentSynchronizationContext
Object that gives some context for values synchronization
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionbooleanDetermines if the status has to be forced if there is no status yet This case can happen if a data is newly externalizableRetrieves the contextMapthat is used to determine if a data is externalizableDetermines which values (locals or externals) have to be synchronizedstatic SynchronizationContextCreates a new instance of aSynchronizationContextbooleanChecks if synchronization has to use the default value from the modelwithDefaultFromModel(boolean useDefaultFromModel) Set totrueto use the default value from the model (default tofalse)withExternalizableDataContextEntry(String entryKey, Object entryValue) Add an entry in the contextMapthat is used to determine if a data is externalizablewithStatus(ExternalizableDataProvider.ExternalizableDataStatus externalizableDataStatus) Sets the status to determine which values (locals or externals) have to be synchronized (default to local)withStatusForcedIfNotPresent(boolean forceStatusIfNotPresent) Set tofalseif the status has not to be forced (default totrue)
- 
Constructor Details- 
SynchronizationContextprotected SynchronizationContext()Creates a new instance of aSynchronizationContext
 
- 
- 
Method Details- 
newInstanceCreates a new instance of aSynchronizationContext- Returns:
- the created instance
 
- 
useDefaultFromModelChecks if synchronization has to use the default value from the model- Returns:
- trueto use the default value from the model,- falseotherwise
 
- 
withDefaultFromModelSet totrueto use the default value from the model (default tofalse)- Parameters:
- useDefaultFromModel-- trueto use the default value from the model,- falseotherwise
- Returns:
- the current SynchronizationContext
 
- 
getStatusToSynchronizeDetermines which values (locals or externals) have to be synchronized- Returns:
- the status of the value to synchronize
 
- 
withStatuspublic SynchronizationContext withStatus(ExternalizableDataProvider.ExternalizableDataStatus externalizableDataStatus) Sets the status to determine which values (locals or externals) have to be synchronized (default to local)- Parameters:
- externalizableDataStatus- the status to determine which values have to be synchronized
- Returns:
- the current SynchronizationContext
 
- 
getExternalizableDataContextRetrieves the contextMapthat is used to determine if a data is externalizable- Returns:
- the context Map
 
- 
withExternalizableDataContextEntrypublic SynchronizationContext withExternalizableDataContextEntry(String entryKey, Object entryValue) Add an entry in the contextMapthat is used to determine if a data is externalizable- Parameters:
- entryKey- the key of the entry
- entryValue- the value of the entry
- Returns:
- the current SynchronizationContext
 
- 
forceStatusIfNotPresentDetermines if the status has to be forced if there is no status yet This case can happen if a data is newly externalizable- Returns:
- trueif the status has to be forced,- falseotherwise
 
- 
withStatusForcedIfNotPresentSet tofalseif the status has not to be forced (default totrue)- Parameters:
- forceStatusIfNotPresent-- trueto force the status if it is not yet present,- falseotherwise
- Returns:
- the current SynchronizationContext
 
 
-