Interface DistributionAgent
@ConsumerType
public interface DistributionAgent
A distribution agent is responsible for handling
DistributionRequests.
This means executing actions of e.g.: a specific DistributionRequestTypes on
specific path(s) which will resume pulling resources from a certain Sling instance and / or pushing resources to
other instances.-
Method Summary
Modifier and TypeMethodDescription@NotNull org.apache.sling.distribution.DistributionResponseexecute(@NotNull org.apache.sling.api.resource.ResourceResolver resourceResolver, @NotNull org.apache.sling.distribution.DistributionRequest distributionRequest) Perform aDistributionRequestto distribute content from a source instance to a target instance.@NotNull DistributionLoggetLog()Get the agent log@Nullable DistributionQueueGet the agent queue with the given nameRetrieves the names of the queues for this agent.@NotNull DistributionAgentStategetState()returns the state of the agent
-
Method Details
-
getQueueNames
Retrieves the names of the queues for this agent.- Returns:
- the list of queue names
-
getQueue
Get the agent queue with the given name- Parameters:
name- a queue name- Returns:
- a
DistributionQueuewith the given name bound to this agent, if it exists,nullotherwise
-
getLog
Get the agent log- Returns:
- the log for this agent
-
getState
returns the state of the agent- Returns:
- the agent state
-
execute
@NotNull @NotNull org.apache.sling.distribution.DistributionResponse execute(@NotNull @NotNull org.apache.sling.api.resource.ResourceResolver resourceResolver, @NotNull @NotNull org.apache.sling.distribution.DistributionRequest distributionRequest) throws DistributionException Perform aDistributionRequestto distribute content from a source instance to a target instance. The content to be sent will be assembled according to the information contained in the request. ADistributionResponseholding theDistributionRequestStateof the provided request will be returned. SynchronousDistributionAgents will usually block until the execution has finished while asynchronous agents will usually return the response as soon as the content to be distributed has been assembled and scheduled for distribution.- Parameters:
resourceResolver- the resource resolver used for authorizing the request,distributionRequest- the distribution request- Returns:
- a
DistributionResponse - Throws:
DistributionException- if any error happens during the execution of the request or if the authentication fails
-