public class SimpleDistributionAgent extends Object implements DistributionAgent
DistributionAgent
Modifier and Type | Class and Description |
---|---|
class |
SimpleDistributionAgent.AgentBasedRequestHandler |
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) |
org.apache.sling.distribution.DistributionResponse |
execute(org.apache.sling.api.resource.ResourceResolver resourceResolver,
org.apache.sling.distribution.DistributionRequest distributionRequest)
Perform a
DistributionRequest to distribute content from a source
instance to a target instance. |
DistributionLog |
getLog()
Get the agent log
|
DistributionQueue |
getQueue(String queueName)
Get the agent queue with the given name
|
Set<String> |
getQueueNames()
Retrieves the names of the queues for this agent.
|
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)
@Nonnull public org.apache.sling.distribution.DistributionResponse execute(@Nonnull org.apache.sling.api.resource.ResourceResolver resourceResolver, @Nonnull 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@Nonnull public Set<String> getQueueNames()
DistributionAgent
getQueueNames
in interface DistributionAgent
public DistributionQueue getQueue(@Nonnull String queueName)
DistributionAgent
getQueue
in interface DistributionAgent
queueName
- a queue nameDistributionQueue
with the given name bound to this agent, if it exists,
null
otherwise@Nonnull public DistributionLog getLog()
DistributionAgent
getLog
in interface DistributionAgent
@Nonnull public 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–2016 The Apache Software Foundation. All rights reserved.