com.day.cq.replication
Class ReplicationAction

java.lang.Object
  extended by com.day.cq.replication.ReplicationAction
All Implemented Interfaces:
Serializable

public class ReplicationAction
extends Object
implements Serializable

The ReplicationAction class is fired during a replication. A replication event is fired when - the replication is started (queued) - the replication is finished (the replication action) - the replication failed - the replication is retried (requeued)

See Also:
Serialized Form

Nested Class Summary
static class ReplicationAction.Status
           
 
Field Summary
static String EVENT_TOPIC
          Event topic for replication status events.
static String JOB_TOPIC
          Event topic for replication job events.
static String PROPERTY_CHILD_PATHS
          The OSGi event property containing the child paths (optional)
static String PROPERTY_MESSAGE
          The OSGi event property containing the message (optional)
static String PROPERTY_MODIFICATION_DATE
          The OSGi event property containing the modification date
static String PROPERTY_PATH
          The OSGi event property containing the path
static String PROPERTY_REPLICATE_TREE
          The OSGi event property containing the replicate tree flag (optional)
static String PROPERTY_REVISION
          The OSGi event property containing the replicated revision (optional)
static String PROPERTY_STATUS
          The OSGi event property containing the status
static String PROPERTY_SYNDICATION_AGENT
          The OSGi event property containing the syndication agent (optional)
static String PROPERTY_TYPE
          The OSGi event property containing replication action
static String PROPERTY_USER_ID
          The OSGi event property containing the user id
 
Constructor Summary
ReplicationAction(ReplicationAction action, ReplicationAction.Status status, String message)
          Constructs a new ReplicationAction.
ReplicationAction(ReplicationAction action, ReplicationAction.Status status, String syndicationAgentName, List<String> paths)
          Constructs a new ReplicationAction.
ReplicationAction(ReplicationAction action, ReplicationActionType type, ReplicationAction.Status status, String message)
          Constructs a new ReplicationAction.
ReplicationAction(ReplicationActionType type, ReplicationAction.Status status, String path, String userId, Date modificationDate, boolean replicateTree, String syndicationAgent, String message, String revision)
          Constructs a new ReplicationAction
ReplicationAction(ReplicationActionType type, ReplicationAction.Status status, String path, String userId, ReplicationOptions options)
          Constructs a new ReplicationAction
 
Method Summary
 org.apache.sling.event.EventPropertiesMap createProperties()
          Create the properties.
static ReplicationAction fromEvent(org.osgi.service.event.Event evt)
          Convert an OSGi event to a replication event.
 List<String> getChildPaths()
          Return the list of child paths if this is a tree replication.
 String getMessage()
          Return the optional message.
 Date getModificationDate()
          Returns the modification date.
 String getPath()
          Returns the path
 String getRevision()
          Returns the revision
 ReplicationAction.Status getStatus()
          Returns the status
 String getSyndicationAgentName()
          Return the name of the replication agent.
 ReplicationActionType getType()
          Returns the action type
 String getUserId()
          Returns the user id.
 boolean isReplicateTree()
          Is this a tree replication?
 org.osgi.service.event.Event toEvent()
          Create an OSGi event out of the replication event.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EVENT_TOPIC

public static final String EVENT_TOPIC
Event topic for replication status events.

See Also:
Constant Field Values

JOB_TOPIC

public static final String JOB_TOPIC
Event topic for replication job events.

See Also:
Constant Field Values

PROPERTY_CHILD_PATHS

public static final String PROPERTY_CHILD_PATHS
The OSGi event property containing the child paths (optional)

See Also:
Constant Field Values

PROPERTY_MODIFICATION_DATE

public static final String PROPERTY_MODIFICATION_DATE
The OSGi event property containing the modification date

See Also:
Constant Field Values

PROPERTY_USER_ID

public static final String PROPERTY_USER_ID
The OSGi event property containing the user id

See Also:
Constant Field Values

PROPERTY_PATH

public static final String PROPERTY_PATH
The OSGi event property containing the path

See Also:
Constant Field Values

PROPERTY_TYPE

public static final String PROPERTY_TYPE
The OSGi event property containing replication action

See Also:
Constant Field Values

PROPERTY_SYNDICATION_AGENT

public static final String PROPERTY_SYNDICATION_AGENT
The OSGi event property containing the syndication agent (optional)

See Also:
Constant Field Values

PROPERTY_MESSAGE

public static final String PROPERTY_MESSAGE
The OSGi event property containing the message (optional)

See Also:
Constant Field Values

PROPERTY_REPLICATE_TREE

public static final String PROPERTY_REPLICATE_TREE
The OSGi event property containing the replicate tree flag (optional)

See Also:
Constant Field Values

PROPERTY_REVISION

public static final String PROPERTY_REVISION
The OSGi event property containing the replicated revision (optional)

See Also:
Constant Field Values

PROPERTY_STATUS

public static final String PROPERTY_STATUS
The OSGi event property containing the status

See Also:
Constant Field Values
Constructor Detail

ReplicationAction

public ReplicationAction(ReplicationActionType type,
                         ReplicationAction.Status status,
                         String path,
                         String userId,
                         ReplicationOptions options)
Constructs a new ReplicationAction

Parameters:
type - The replication type.
path - The path of the page to replicate.
userId - The user who started the replication.
options - The options for the replication
status - the action status

ReplicationAction

public ReplicationAction(ReplicationActionType type,
                         ReplicationAction.Status status,
                         String path,
                         String userId,
                         Date modificationDate,
                         boolean replicateTree,
                         String syndicationAgent,
                         String message,
                         String revision)
Constructs a new ReplicationAction

Parameters:
type - The replication type.
status - the action status
path - The path of the page to replicate.
userId - The user who started the replication.
modificationDate - The date when the replication occured.
replicateTree - Is this a tree replication.

ReplicationAction

public ReplicationAction(ReplicationAction action,
                         ReplicationAction.Status status,
                         String message)
Constructs a new ReplicationAction. This constructs a new event out of a replication action and adds a new message.

Parameters:
action - The replication action.
status - The status
message - The syndication message (log).

ReplicationAction

public ReplicationAction(ReplicationAction action,
                         ReplicationActionType type,
                         ReplicationAction.Status status,
                         String message)
Constructs a new ReplicationAction. This constructs a new event out of a replication action. The action type and the message can be changed.

Parameters:
action - The replication action.
type - The replication action type.
status - The status
message - The syndication message (log).

ReplicationAction

public ReplicationAction(ReplicationAction action,
                         ReplicationAction.Status status,
                         String syndicationAgentName,
                         List<String> paths)
Constructs a new ReplicationAction. This constructs a new event out of a replication action. The syndication agent and the paths can be changed.

Parameters:
action - The replication action.
status - The status
syndicationAgentName - The syndication agent.
paths - The paths for the replication.
Method Detail

getType

public ReplicationActionType getType()
Returns the action type


getPath

public String getPath()
Returns the path


getStatus

public ReplicationAction.Status getStatus()
Returns the status

Returns:
the status

getRevision

public String getRevision()
Returns the revision


getModificationDate

public Date getModificationDate()
Returns the modification date.


getUserId

public String getUserId()
Returns the user id.


isReplicateTree

public boolean isReplicateTree()
Is this a tree replication?


getSyndicationAgentName

public String getSyndicationAgentName()
Return the name of the replication agent.


getChildPaths

public List<String> getChildPaths()
Return the list of child paths if this is a tree replication. If this is not a tree replication null is returned.


getMessage

public String getMessage()
Return the optional message.


fromEvent

public static ReplicationAction fromEvent(org.osgi.service.event.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.

createProperties

public org.apache.sling.event.EventPropertiesMap createProperties()
Create the properties.


toEvent

public org.osgi.service.event.Event toEvent()
Create an OSGi event out of the replication event.

Returns:
A new OSGi event.


Copyright © 2008 Day Management AG. All Rights Reserved.