Interface DistributionAgent
-
@ConsumerType public interface DistributionAgent
A distribution agent is responsible for handlingDistributionRequest
s. This means executing actions of e.g.: a specificDistributionRequestType
s on specific path(s) which will resume pulling resources from a certain Sling instance and / or pushing resources to other instances.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description @NotNull DistributionResponse
execute(@NotNull ResourceResolver resourceResolver, @NotNull DistributionRequest distributionRequest)
Perform aDistributionRequest
to distribute content from a source instance to a target instance.@NotNull DistributionLog
getLog()
Get the agent log@Nullable DistributionQueue
getQueue(@NotNull java.lang.String name)
Get the agent queue with the given name@NotNull java.lang.Iterable<java.lang.String>
getQueueNames()
Retrieves the names of the queues for this agent.@NotNull DistributionAgentState
getState()
returns the state of the agent
-
-
-
Method Detail
-
getQueueNames
@NotNull @NotNull java.lang.Iterable<java.lang.String> getQueueNames()
Retrieves the names of the queues for this agent.- Returns:
- the list of queue names
-
getQueue
@Nullable @Nullable DistributionQueue getQueue(@NotNull @NotNull java.lang.String name)
Get the agent queue with the given name- Parameters:
name
- a queue name- Returns:
- a
DistributionQueue
with the given name bound to this agent, if it exists,null
otherwise
-
getLog
@NotNull @NotNull DistributionLog getLog()
Get the agent log- Returns:
- the log for this agent
-
getState
@NotNull @NotNull DistributionAgentState getState()
returns the state of the agent- Returns:
- the agent state
-
execute
@NotNull @NotNull DistributionResponse execute(@NotNull @NotNull ResourceResolver resourceResolver, @NotNull @NotNull DistributionRequest distributionRequest) throws DistributionException
Perform aDistributionRequest
to 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. ADistributionResponse
holding theDistributionRequestState
of the provided request will be returned. SynchronousDistributionAgent
s 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:
distributionRequest
- the distribution requestresourceResolver
- the resource resolver used for authorizing the request,- Returns:
- a
DistributionResponse
- Throws:
DistributionException
- if any error happens during the execution of the request or if the authentication fails
-
-