Package com.day.cq.replication
Class ReplicationAction
java.lang.Object
com.day.cq.replication.ReplicationAction
- All Implemented Interfaces:
Serializable
Defines the control information of a replication
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringEvent topic for replication status events.static final StringReplication action type property name.static final StringReplication path property name.static final StringThe OSGi event property containing the modification datestatic final StringThe OSGi event property containing the pathstatic final StringThe OSGi event property containing the pathsstatic final StringThe OSGi event property containing the replicated revision (optional)static final StringThe OSGi event property containing replication actionstatic final StringThe OSGi event property containing the user id -
Constructor Summary
ConstructorsConstructorDescriptionReplicationAction(ReplicationActionType type, String path) Create a new instance of this class.ReplicationAction(ReplicationActionType type, String[] paths, long time, String userId, String revision) ReplicationAction(ReplicationActionType type, String path, long time, String userId, String revision) -
Method Summary
Modifier and TypeMethodDescriptioncreateEventProperties(boolean distribute) Create the OSGi event properties.static ReplicationActionConvert an OSGi event to a replication event.Return the agent config.getLog()Return the replication log.getPath()Returns the pathString[]getPaths()Returns the replication paths.Returns the revisionlonggetTime()Returns the replication timegetType()Returns the action typeReturns the user id.voidsetConfig(AgentConfig config) Set the agent config.voidsetLog(ReplicationLog log) Set the replication log.toEvent()Create an OSGi event out of the replication event.toEvent(boolean distribute) Create an OSGi event out of the replication event.toString()
-
Field Details
-
EVENT_TOPIC
Event topic for replication status events.- See Also:
-
PROPERTY_MODIFICATION_DATE
The OSGi event property containing the modification date- See Also:
-
PROPERTY_USER_ID
The OSGi event property containing the user id- See Also:
-
PROPERTY_PATH
The OSGi event property containing the path- See Also:
-
PROPERTY_PATHS
The OSGi event property containing the paths- Since:
- 5.5
- See Also:
-
PROPERTY_TYPE
The OSGi event property containing replication action- See Also:
-
PROPERTY_REVISION
The OSGi event property containing the replicated revision (optional)- See Also:
-
PN_PATH
Replication path property name.- See Also:
-
PN_ACTION_TYPE
Replication action type property name.- See Also:
-
-
Constructor Details
-
ReplicationAction
public ReplicationAction(ReplicationActionType type, String path, long time, String userId, String revision) -
ReplicationAction
public ReplicationAction(ReplicationActionType type, String[] paths, long time, String userId, String revision) -
ReplicationAction
Create a new instance of this class. Used for actions that do not carry content (e.g. DELETE).- Parameters:
type- action typepath- path
-
-
Method Details
-
getType
Returns the action type- Returns:
- replication action type
-
getPath
Returns the path- Returns:
- path
-
getPaths
Returns the replication paths. Currently the array may only contain more than 1 elements for a delete replication. in that case, the paths are the ones of the deleted aggregates (content nodes).- Returns:
- the paths
- Since:
- 5.5
-
getRevision
Returns the revision- Returns:
- the revision
-
getTime
public long getTime()Returns the replication time- Returns:
- the replication time
-
getUserId
Returns the user id.- Returns:
- the user id.
-
getConfig
Return the agent config.- Returns:
- agent config
-
setConfig
Set the agent config.- Parameters:
config- agent config
-
getLog
Return the replication log.- Returns:
- replication log
-
setLog
Set the replication log.- Parameters:
log- the log
-
toString
-
fromEvent
Convert an OSGi event to a replication event.- Parameters:
evt- The OSGi event- Returns:
- The replication event if the OSGi event contained a replication event. Otherwise null is returned.
-
createEventProperties
Create the OSGi event properties.- Parameters:
distribute- Whether this event should be distributed across the cluster.- Returns:
- OSGi event properties
- Since:
- 5.18.0
-
toEvent
Create an OSGi event out of the replication event.- Returns:
- A new OSGi event.
-
toEvent
Create an OSGi event out of the replication event.- Parameters:
distribute- iftruea distributed event is created- Returns:
- A new OSGi event.
-