Package com.day.cq.replication
Class ReplicationAction
- java.lang.Object
-
- com.day.cq.replication.ReplicationAction
-
- All Implemented Interfaces:
java.io.Serializable
public class ReplicationAction extends java.lang.Object implements java.io.SerializableDefines the control information of a replication- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringEVENT_TOPICEvent topic for replication status events.static java.lang.StringPN_ACTION_TYPEReplication action type property name.static java.lang.StringPN_PATHReplication path property name.static java.lang.StringPROPERTY_MODIFICATION_DATEThe OSGi event property containing the modification datestatic java.lang.StringPROPERTY_PATHThe OSGi event property containing the pathstatic java.lang.StringPROPERTY_PATHSThe OSGi event property containing the pathsstatic java.lang.StringPROPERTY_REVISIONThe OSGi event property containing the replicated revision (optional)static java.lang.StringPROPERTY_TYPEThe OSGi event property containing replication actionstatic java.lang.StringPROPERTY_USER_IDThe OSGi event property containing the user id
-
Constructor Summary
Constructors Constructor Description ReplicationAction(ReplicationActionType type, java.lang.String path)Create a new instance of this class.ReplicationAction(ReplicationActionType type, java.lang.String[] paths, long time, java.lang.String userId, java.lang.String revision)ReplicationAction(ReplicationActionType type, java.lang.String path, long time, java.lang.String userId, java.lang.String revision)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Map<java.lang.String,java.lang.Object>createEventProperties(boolean distribute)Create the OSGi event properties.static ReplicationActionfromEvent(Event evt)Convert an OSGi event to a replication event.AgentConfiggetConfig()Return the agent config.ReplicationLoggetLog()Return the replication log.java.lang.StringgetPath()Returns the pathjava.lang.String[]getPaths()Returns the replication paths.java.lang.StringgetRevision()Returns the revisionlonggetTime()Returns the replication timeReplicationActionTypegetType()Returns the action typejava.lang.StringgetUserId()Returns the user id.voidsetConfig(AgentConfig config)Set the agent config.voidsetLog(ReplicationLog log)Set the replication log.EventtoEvent()Create an OSGi event out of the replication event.EventtoEvent(boolean distribute)Create an OSGi event out of the replication event.java.lang.StringtoString()
-
-
-
Field Detail
-
EVENT_TOPIC
public static final java.lang.String EVENT_TOPIC
Event topic for replication status events.- See Also:
- Constant Field Values
-
PROPERTY_MODIFICATION_DATE
public static final java.lang.String PROPERTY_MODIFICATION_DATE
The OSGi event property containing the modification date- See Also:
- Constant Field Values
-
PROPERTY_USER_ID
public static final java.lang.String PROPERTY_USER_ID
The OSGi event property containing the user id- See Also:
- Constant Field Values
-
PROPERTY_PATH
public static final java.lang.String PROPERTY_PATH
The OSGi event property containing the path- See Also:
- Constant Field Values
-
PROPERTY_PATHS
public static final java.lang.String PROPERTY_PATHS
The OSGi event property containing the paths- Since:
- 5.5
- See Also:
- Constant Field Values
-
PROPERTY_TYPE
public static final java.lang.String PROPERTY_TYPE
The OSGi event property containing replication action- See Also:
- Constant Field Values
-
PROPERTY_REVISION
public static final java.lang.String PROPERTY_REVISION
The OSGi event property containing the replicated revision (optional)- See Also:
- Constant Field Values
-
PN_PATH
public static final java.lang.String PN_PATH
Replication path property name.- See Also:
- Constant Field Values
-
PN_ACTION_TYPE
public static final java.lang.String PN_ACTION_TYPE
Replication action type property name.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ReplicationAction
public ReplicationAction(ReplicationActionType type, java.lang.String path, long time, java.lang.String userId, java.lang.String revision)
-
ReplicationAction
public ReplicationAction(ReplicationActionType type, java.lang.String[] paths, long time, java.lang.String userId, java.lang.String revision)
-
ReplicationAction
public ReplicationAction(ReplicationActionType type, java.lang.String path)
Create a new instance of this class. Used for actions that do not carry content (e.g. DELETE).- Parameters:
type- action typepath- path
-
-
Method Detail
-
getType
public ReplicationActionType getType()
Returns the action type- Returns:
- replication action type
-
getPath
public java.lang.String getPath()
Returns the path- Returns:
- path
-
getPaths
public java.lang.String[] 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
public java.lang.String getRevision()
Returns the revision- Returns:
- the revision
-
getTime
public long getTime()
Returns the replication time- Returns:
- the replication time
-
getUserId
public java.lang.String getUserId()
Returns the user id.- Returns:
- the user id.
-
getConfig
public AgentConfig getConfig()
Return the agent config.- Returns:
- agent config
-
setConfig
public void setConfig(AgentConfig config)
Set the agent config.- Parameters:
config- agent config
-
getLog
public ReplicationLog getLog()
Return the replication log.- Returns:
- replication log
-
setLog
public void setLog(ReplicationLog log)
Set the replication log.- Parameters:
log- the log
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
fromEvent
public static ReplicationAction fromEvent(Event evt)
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
public java.util.Map<java.lang.String,java.lang.Object> createEventProperties(boolean distribute)
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
public Event toEvent()
Create an OSGi event out of the replication event.- Returns:
- A new OSGi event.
-
toEvent
public Event toEvent(boolean distribute)
Create an OSGi event out of the replication event.- Parameters:
distribute- iftruea distributed event is created- Returns:
- A new OSGi event.
-
-