Class SynchronizationContext
- java.lang.Object
-
- org.ametys.plugins.repository.data.holder.values.SynchronizationContext
-
- Direct Known Subclasses:
ContentSynchronizationContext
public class SynchronizationContext extends Object
Object that gives some context for values synchronization
-
-
Field Summary
Fields Modifier and Type Field Description private ExternalizableDataProvider.ExternalizableDataStatus
_externalizableDataStatus
private boolean
_useDefaultFromModel
-
Constructor Summary
Constructors Modifier Constructor Description protected
SynchronizationContext()
Creates a new instance of aSynchronizationContext
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ExternalizableDataProvider.ExternalizableDataStatus
getStatusToSynchronize()
Determines which values (locals or externals) have to be synchronizedstatic SynchronizationContext
newInstance()
Creates a new instance of aSynchronizationContext
boolean
useDefaultFromModel()
Checks if synchronization has to use the default value from the modelSynchronizationContext
withDefaultFromModel(boolean useDefaultFromModel)
Set totrue
to use the default value from the model (default tofalse
)SynchronizationContext
withStatus(ExternalizableDataProvider.ExternalizableDataStatus externalizableDataStatus)
Sets the status to determine which values (locals or externals) have to be synchronized (default to local)
-
-
-
Field Detail
-
_useDefaultFromModel
private boolean _useDefaultFromModel
-
_externalizableDataStatus
private ExternalizableDataProvider.ExternalizableDataStatus _externalizableDataStatus
-
-
Constructor Detail
-
SynchronizationContext
protected SynchronizationContext()
Creates a new instance of aSynchronizationContext
-
-
Method Detail
-
newInstance
public static SynchronizationContext newInstance()
Creates a new instance of aSynchronizationContext
- Returns:
- the created instance
-
useDefaultFromModel
public boolean useDefaultFromModel()
Checks if synchronization has to use the default value from the model- Returns:
true
to use the default value from the model,false
otherwise
-
withDefaultFromModel
public SynchronizationContext withDefaultFromModel(boolean useDefaultFromModel)
Set totrue
to use the default value from the model (default tofalse
)- Parameters:
useDefaultFromModel
-true
to use the default value from the model,false
otherwise- Returns:
- the current
SynchronizationContext
-
getStatusToSynchronize
public ExternalizableDataProvider.ExternalizableDataStatus getStatusToSynchronize()
Determines which values (locals or externals) have to be synchronized- Returns:
- the status of the value to synchronize
-
withStatus
public 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
-
-