Interface Agent


@ProviderType public interface Agent
This represents a replication agent as defined by an AgentConfig.
  • Method Details

    • 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()
      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:
      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 action
      content - 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 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

      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 session
      action - action
      Returns:
      the content or null
      Throws:
      ReplicationException - if an error occurs
    • buildContent

      ReplicationContent buildContent(Session session, ReplicationAction action, Map<String,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 session
      action - action
      parameters - additional parameters to be supplied to the underlying ContentBuilder
      Returns:
      the content or null
      Throws:
      ReplicationException - if an error occurs
    • getContent

      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(Calendar time)
      Defines the timeline to be used for the next reverse replication poll.
      Parameters:
      time - the time
    • getLastPollTimeline

      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, Map<String,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 session
      action - composite action
      parameters - additional parameters to be supplied to the underlying ContentBuilder
      Returns:
      the bulk content if #supportsBulkContentBuilding == true or null
      Throws:
      ReplicationException - if an error occurs