Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn more

View all

Sign in to view all badges

SOLVED

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

kinjald72392939
Level 1
Level 1

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

1 Accepted Solution
PuzanovsP
Correct answer by
Community Advisor
Community Advisor

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

View solution in original post

1 Reply
PuzanovsP
Correct answer by
Community Advisor
Community Advisor

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

View solution in original post