Is there anyways we can use java code to replicate a package that is created using java code? | Community
Skip to main content
kinjald72392939
New Participant
January 24, 2017
Solved

Is there anyways we can use java code to replicate a package that is created using java code?

  • January 24, 2017
  • 1 reply
  • 749 views

I've created a package using java code as follows.

 

Session session = slingRepository.loginAdministrative(null);

JcrPackageManager packageManager =  (JcrPackageManager)PackagingService.getPackageManager(session);

JcrPackage pack = packageManager.create(PACKAGE_GROUPNAME, packageName, PACKAGE_VERSION);

Now I need to replicate this package on all the publishers inside java code. However, I am unable to find any API that can do this. Can anyone please help me with the same?

 

Thanks,

Kinjal

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Peter_Puzanovs

Hi Kinjal,

Use https://docs.adobe.com/docs/en/aem/6-0/develop/ref/javadoc/com/day/cq/replication/AgentManager.html to retrieve your agents and https://docs.adobe.com/docs/en/aem/6-0/develop/ref/javadoc/com/day/cq/replication/Agent.html API to replicate you data across.

P.S. Day was smart, not to club everything into one API, so to use replication you setup agents and use Agent API, to create packages you use PackageManger API's

Regards,

Peter

1 reply

Peter_Puzanovs
Peter_PuzanovsAccepted solution
New Participant
January 24, 2017

Hi Kinjal,

Use https://docs.adobe.com/docs/en/aem/6-0/develop/ref/javadoc/com/day/cq/replication/AgentManager.html to retrieve your agents and https://docs.adobe.com/docs/en/aem/6-0/develop/ref/javadoc/com/day/cq/replication/Agent.html API to replicate you data across.

P.S. Day was smart, not to club everything into one API, so to use replication you setup agents and use Agent API, to create packages you use PackageManger API's

Regards,

Peter