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) |
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
DistributionAgentDistributionRequest 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 DistributionAgents 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 DistributionAgentresourceResolver - the resource resolver used for authorizing the request,distributionRequest - the distribution requestDistributionResponseDistributionException - if any error happens during the execution of the request or if the authentication fails@Nonnull public Set<String> getQueueNames()
DistributionAgentgetQueueNames in interface DistributionAgentpublic DistributionQueue getQueue(@Nonnull String queueName)
DistributionAgentgetQueue in interface DistributionAgentqueueName - a queue nameDistributionQueue with the given name bound to this agent, if it exists,
null otherwise@Nonnull public DistributionLog getLog()
DistributionAgentgetLog in interface DistributionAgent@Nonnull public DistributionAgentState getState()
DistributionAgentgetState in interface DistributionAgentpublic void enable()
public void enableTrigger(DistributionTrigger trigger)
public void disableTrigger(DistributionTrigger trigger)
public void disable()
Copyright © 2007–2017 The Apache Software Foundation. All rights reserved.