Package com.day.cq.replication
Interface Agent
-
@ProviderType public interface Agent
This represents a replication agent as defined by anAgentConfig.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ReplicationContentbuildBulkContent(Session session, CompositeReplicationAction action, java.util.Map<java.lang.String,java.lang.Object> parameters)Builds bulk content for the respective composite action using the configured content builder.ReplicationContentbuildContent(Session session, ReplicationAction action)Builds the content for the respective action using the configured content builder.ReplicationContentbuildContent(Session session, ReplicationAction action, java.util.Map<java.lang.String,java.lang.Object> parameters)Builds the content for the respective action using the configured content builder.voidcheckValid()Checks if the agent is valid and throws an exception if not.AgentConfiggetConfiguration()Get the configuration.ReplicationContentgetContent(ReplicationContentFacade facade)Creates and acquires an existing content given it's facadejava.lang.StringgetId()Returns the id of the agent.java.util.CalendargetLastPollTimeline()Returns the timeline used for the last reverse replication.ReplicationLoggetLog()Returns the replication log of this agentReplicationQueuegetQueue()Returns the replication queue.booleanisCacheInvalidator()Indicates that this agent is used as cache invalidator.booleanisEnabled()checks if agent is activebooleanisInMaintenanceMode()Checks if the agent is in maintenance modebooleanisValid()checks if agent is validReverseReplication[]poll(ReplicationAction action)Poll modified content from the agent that will be reverse replicated.voidreplicate(CompositeReplicationAction action, ReplicationContent content, ReplicationOptions options)Replicates the given (bulk) content.voidreplicate(ReplicationAction action, ReplicationContent content, ReplicationOptions options)Replicates the given content.voidsetNextPollTimeline(java.util.Calendar time)Defines the timeline to be used for the next reverse replication poll.booleansupportsBulkContentBuilding()Checks if the agent can build content for multiple paths/resources.
-
-
-
Method Detail
-
getId
java.lang.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:
trueif the agent is active
-
isValid
boolean isValid()
checks if agent is valid- Returns:
trueif the agent is correctly configured
-
checkValid
void checkValid()
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:
java.lang.IllegalArgumentException- if the agent is not valid.
-
getConfiguration
AgentConfig getConfiguration()
Get the configuration.- Returns:
- configuration
-
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 actioncontent- The content for the replication or null if no content.options- the replication options- Throws:
ReplicationException- if an error during replication occurred
-
replicate
void replicate(CompositeReplicationAction action, ReplicationContent content, ReplicationOptions options) throws ReplicationException
Replicates the given (bulk) content. if the content cannot be delivered, it is queued.- Parameters:
action- the composite replication actioncontent- The content for the replication or null if no content.options- the replication options- Throws:
ReplicationException- if an error during replication occurred
-
poll
ReverseReplication[] poll(ReplicationAction action) throws ReplicationException
Poll modified content from the agent that will be reverse replicated.- Parameters:
action- the replication action- Returns:
- the polled content or
null - Throws:
ReplicationException- if an error occurs
-
buildContent
ReplicationContent buildContent(Session session, ReplicationAction action) throws ReplicationException
Builds the content for the respective action using the configured content builder. The returned content is acquired by this agent.- Parameters:
session- jcr sessionaction- action- Returns:
- the content or
null - Throws:
ReplicationException- if an error occurs
-
buildContent
ReplicationContent buildContent(Session session, ReplicationAction action, java.util.Map<java.lang.String,java.lang.Object> parameters) throws ReplicationException
Builds the content for the respective action using the configured content builder. The returned content is acquired by this agent.- Parameters:
session- jcr sessionaction- actionparameters- additional parameters to be supplied to the underlyingContentBuilder- Returns:
- the content or
null - Throws:
ReplicationException- if an error occurs
-
getContent
ReplicationContent getContent(ReplicationContentFacade facade) throws ReplicationException
Creates and acquires an existing content given it's facade- Parameters:
facade- the content facade- Returns:
- the content or
null - Throws:
ReplicationException- if an error occurs
-
getQueue
ReplicationQueue getQueue()
Returns the replication queue.- Returns:
- the replication queue or
nullif the agents is not active or valid.
-
isCacheInvalidator
boolean isCacheInvalidator()
Indicates that this agent is used as cache invalidator. For example as dispatcher flush agent.- Returns:
trueif this agent is used as a cache invalidator.
-
setNextPollTimeline
void setNextPollTimeline(java.util.Calendar time)
Defines the timeline to be used for the next reverse replication poll.- Parameters:
time- the time
-
getLastPollTimeline
java.util.Calendar getLastPollTimeline()
Returns the timeline used for the last reverse replication.- Returns:
- the timeline or
null
-
isInMaintenanceMode
boolean isInMaintenanceMode()
Checks if the agent is in maintenance mode- Returns:
trueif this agent is in maintenance mode
-
supportsBulkContentBuilding
boolean supportsBulkContentBuilding()
Checks if the agent can build content for multiple paths/resources.- Returns:
trueif this agent is capable of building bulk content (for multiple paths),falseotherwise.
-
buildBulkContent
ReplicationContent buildBulkContent(Session session, CompositeReplicationAction action, java.util.Map<java.lang.String,java.lang.Object> parameters) throws ReplicationException
Builds bulk content for the respective composite action using the configured content builder. The returned content is acquired by this agent.- Parameters:
session- jcr sessionaction- composite actionparameters- additional parameters to be supplied to the underlyingContentBuilder- Returns:
- the bulk content if
#supportsBulkContentBuilding == trueornull - Throws:
ReplicationException- if an error occurs
-
-