com.day.cq.replication
Interface Agent


public interface Agent

This represents a replication agent as defined by an AgentConfig.


Method Summary
 ReplicationContent buildContent(Session session, ReplicationAction action)
          Builds the content for the respective action using the configured content builder.
 void checkValid()
          Checks if the agent is valid and throws an exception if not.
 AgentConfig getConfiguration()
          Get the configuration.
 String getId()
          Returns the id of the agent.
 ReplicationLog getLog()
          Returns the replication log of this agent
 ReplicationQueue getQueue()
          Returns the replication queue.
 boolean isCacheInvalidator()
          Indicates that this agents is used as cache invalidator.
 boolean isEnabled()
          checks if agent is active
 boolean isValid()
          checks if agent is valid
 ReplicationContent[] poll(ReplicationAction action)
          Poll modified content from the agent.
 void replicate(ReplicationAction action, ReplicationContent content, ReplicationOptions options)
          Replicates the given content.
 

Method Detail

getId

String getId()
Returns the id of the agent. the id is unique among the agents

Returns:
the id of the agent

isEnabled

boolean isEnabled()
checks if agent is active

Returns:
true if the agent is active

isValid

boolean isValid()
checks if agent is valid

Returns:
true if the agent is correctly configured

checkValid

void checkValid()
                throws IllegalArgumentException
Checks if the agent is valid and throws an exception if not. the message of the exception can be used as hint to the user.

Throws:
IllegalArgumentException - if the agent is not valid.

getConfiguration

AgentConfig getConfiguration()
Get the configuration.

Returns:
configuation

getLog

ReplicationLog getLog()
Returns the replication log of this agent

Returns:
the replication log.

replicate

void replicate(ReplicationAction action,
               ReplicationContent content,
               ReplicationOptions options)
               throws ReplicationException
Replicates the given content. if the content cannot be delivered, it is queued.

Parameters:
action - the replication action
content - The content for the replication or null if no content.
options - the replication options
Throws:
ReplicationException - if an error during replication occurred

poll

ReplicationContent[] poll(ReplicationAction action)
                          throws ReplicationException
Poll modified content from the agent.

Throws:
ReplicationException

buildContent

ReplicationContent buildContent(Session session,
                                ReplicationAction action)
                                throws ReplicationException
Builds the content for the respective action using the configured content builder.

Parameters:
session - jcr session
action - action
Returns:
the content or null
Throws:
ReplicationException - if an error occurs

getQueue

ReplicationQueue getQueue()
Returns the replication queue.

Returns:
the replication queue or null of the agents is not active or valid.

isCacheInvalidator

boolean isCacheInvalidator()
Indicates that this agents is used as cache invalidator. For example as dispatcher flush agent.

Returns:
true if this agent is used as a cache invalidator.


Copyright © 2009 Day Management AG. All Rights Reserved.