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 ReplicationContent
buildBulkContent(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.ReplicationContent
buildContent(Session session, ReplicationAction action)
Builds the content for the respective action using the configured content builder.ReplicationContent
buildContent(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.void
checkValid()
Checks if the agent is valid and throws an exception if not.AgentConfig
getConfiguration()
Get the configuration.ReplicationContent
getContent(ReplicationContentFacade facade)
Creates and acquires an existing content given it's facadejava.lang.String
getId()
Returns the id of the agent.java.util.Calendar
getLastPollTimeline()
Returns the timeline used for the last reverse replication.ReplicationLog
getLog()
Returns the replication log of this agentReplicationQueue
getQueue()
Returns the replication queue.boolean
isCacheInvalidator()
Indicates that this agent is used as cache invalidator.boolean
isEnabled()
checks if agent is activeboolean
isInMaintenanceMode()
Checks if the agent is in maintenance modeboolean
isValid()
checks if agent is validReverseReplication[]
poll(ReplicationAction action)
Poll modified content from the agent that will be reverse replicated.void
replicate(CompositeReplicationAction action, ReplicationContent content, ReplicationOptions options)
Replicates the given (bulk) content.void
replicate(ReplicationAction action, ReplicationContent content, ReplicationOptions options)
Replicates the given content.void
setNextPollTimeline(java.util.Calendar time)
Defines the timeline to be used for the next reverse replication poll.boolean
supportsBulkContentBuilding()
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:
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()
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
null
if 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:
true
if 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:
true
if this agent is in maintenance mode
-
supportsBulkContentBuilding
boolean supportsBulkContentBuilding()
Checks if the agent can build content for multiple paths/resources.- Returns:
true
if this agent is capable of building bulk content (for multiple paths),false
otherwise.
-
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 == true
ornull
- Throws:
ReplicationException
- if an error occurs
-
-