[ 
https://issues.apache.org/jira/browse/SLING-3385?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13896977#comment-13896977
 ] 

Marius Petria commented on SLING-3385:
--------------------------------------

Hi Tobias,

There is no detailed spec as I wanted to fix first the general approach. 
Basically requests use headers and a stream payload for packages. If we are to 
drop headers then we could use multipart messages with jsons containing the 
metadata (action, paths, agent) and octetstreams containing the package bytes.

However, when I was analyzing this option it made more sense to rely again on 
standard servlets rather than implementing custom servlets to handle the 
payload.

We could use purely JCR nodes that store requests and packages.

For replication actions (commands) one would store the content of a command and 
a task (or event handler) would pick it up, pass it to the agent and then move 
it to outbox.
{noformat}
/system/replication/commands/inbox
/system/replication/commands/outbox
{noformat}

For importing/exporting packages those could be uploaded/downloaded from their 
corresponding boxes.
{noformat}
/system/replication/packages/inbox
/system/replication/packages/outbox
{noformat}

The only questions for this approach are:
- Is there a way in sling to get the the first element in the outbox using 
orderby and pagination. 
- We might still need to expose status information about agents (like inner 
queues status). Should we do this by using a resourceprovider in order to avoid 
empty agent nodes?



>  Expose replication agents actions  and information via HTTP.
> -------------------------------------------------------------
>
>                 Key: SLING-3385
>                 URL: https://issues.apache.org/jira/browse/SLING-3385
>             Project: Sling
>          Issue Type: Bug
>          Components: Extensions
>            Reporter: Marius Petria
>              Labels: replication
>
> We need a safe way to expose replication agents actions via HTTP.
> Replication agents are OSGI services that can do the following actions:
> - replicate a content tree (build a content package and add it to a queue)
> - add a content package into a queue
> - remove a content package from its queue
> A replication agent also exposes information about packages in its queues.
> We have to expose all this actions and information over HTTP in order to be 
> available to authorized users.
> Actions:
> - Replicate (schedules a replication action)
> POST /system/replication/agents
> X-replication-action: ADD/DELETE
> X-replication-path: /content/mycontent
> X-replication-agent: {agentName}
> - Import/Export (adds or removes a package from a queue)
> POST /system/replication/packages
> X-replication-action: PACKAGE_OFFER/PACKAGE_POLL
> X-replication-queue: {queueName}
> X-replication-agent: {agentName}
> -Information about agents, queues, packages
> GET /system/replication/agents?agent={agentName}
> GET /system/replication/queues?agent={agentName}
> GET /system/replication/packages?queue={queueName}&agent={agentName}



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)

Reply via email to