public class SimpleDistributionAgent extends Object implements DistributionAgent
DistributionAgent
Constructor and Description |
---|
SimpleDistributionAgent(String name,
boolean queueProcessingEnabled,
Set<String> processingQueues,
String subServiceName,
DistributionPackageImporter distributionPackageImporter,
DistributionPackageExporter distributionPackageExporter,
DistributionRequestAuthorizationStrategy distributionRequestAuthorizationStrategy,
DistributionQueueProvider queueProvider,
DistributionQueueDispatchingStrategy scheduleQueueStrategy,
DistributionQueueDispatchingStrategy errorQueueStrategy,
DistributionEventFactory distributionEventFactory,
org.apache.sling.api.resource.ResourceResolverFactory resourceResolverFactory,
org.apache.sling.jcr.api.SlingRepository slingRepository,
DefaultDistributionLog log,
org.apache.sling.distribution.DistributionRequestType[] allowedRequests,
String[] allowedRoots,
int retryAttempts) |
Modifier and Type | Method and Description |
---|---|
void |
disable() |
void |
disableTrigger(DistributionTrigger trigger) |
void |
enable() |
void |
enableTrigger(DistributionTrigger trigger) |
@NotNull org.apache.sling.distribution.DistributionResponse |
execute(@NotNull org.apache.sling.api.resource.ResourceResolver resourceResolver,
@NotNull org.apache.sling.distribution.DistributionRequest distributionRequest)
Perform a
DistributionRequest to distribute content from a source
instance to a target instance. |
@NotNull DistributionLog |
getLog()
Get the agent log
|
DistributionQueue |
getQueue(@NotNull String queueName)
Get the agent queue with the given name
|
@NotNull Set<String> |
getQueueNames()
Retrieves the names of the queues for this agent.
|
@NotNull DistributionAgentState |
getState()
returns the state of the agent
|
public SimpleDistributionAgent(String name, boolean queueProcessingEnabled, Set<String> processingQueues, String subServiceName, DistributionPackageImporter distributionPackageImporter, DistributionPackageExporter distributionPackageExporter, DistributionRequestAuthorizationStrategy distributionRequestAuthorizationStrategy, DistributionQueueProvider queueProvider, DistributionQueueDispatchingStrategy scheduleQueueStrategy, DistributionQueueDispatchingStrategy errorQueueStrategy, DistributionEventFactory distributionEventFactory, org.apache.sling.api.resource.ResourceResolverFactory resourceResolverFactory, org.apache.sling.jcr.api.SlingRepository slingRepository, DefaultDistributionLog log, org.apache.sling.distribution.DistributionRequestType[] allowedRequests, String[] allowedRoots, int retryAttempts)
@NotNull public @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
DistributionAgent
DistributionRequest
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.
A DistributionResponse
holding the DistributionRequestState
of the provided request will be returned.
Synchronous DistributionAgent
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.execute
in interface DistributionAgent
resourceResolver
- the resource resolver used for authorizing the request,distributionRequest
- the distribution requestDistributionResponse
DistributionException
- if any error happens during the execution of the request or if the authentication fails@NotNull public @NotNull Set<String> getQueueNames()
DistributionAgent
getQueueNames
in interface DistributionAgent
public DistributionQueue getQueue(@NotNull @NotNull String queueName)
DistributionAgent
getQueue
in interface DistributionAgent
queueName
- a queue nameDistributionQueue
with the given name bound to this agent, if it exists,
null
otherwise@NotNull public @NotNull DistributionLog getLog()
DistributionAgent
getLog
in interface DistributionAgent
@NotNull public @NotNull DistributionAgentState getState()
DistributionAgent
getState
in interface DistributionAgent
public void enable()
public void enableTrigger(DistributionTrigger trigger)
public void disableTrigger(DistributionTrigger trigger)
public void disable()
Copyright © 2007–2018 The Apache Software Foundation. All rights reserved.