Expand my Community achievements bar.

SOLVED

Replication through stand alone Java code

Avatar

Community Advisor

Hello,

I am creating the content nodes through the stand alone Java application using JCR API. Now, I want to replicate those. I know we can use the Replication API for this but I want to know how to use this API in the stand alone java application. Please help.

Thanks

1 Accepted Solution

Avatar

Correct answer by
Level 10

Usually replication of a content in AEM would be done from AEM. Any specific reason for invoking from external application ?

Couple of options if needed !

1. As @scott mentioned expose rest service from AEM and call that from the Java application

2. Use Curl command to replicate and call from Java class

View solution in original post

2 Replies

Avatar

Level 10

Replication API cannot be invoked from a standalone Java app.  Look at the Javadocs: 

https://docs.adobe.com/content/docs/en/cq/5-6-1/javadoc/com/day/cq/replication/package-summary.html

These Java APIs need to be used within AEM within an OSGi. 

One way you can work around this is to write an AEM Sling Servlet that uses these APIs. Then from your Java client - invoke the Sling Servlet via an HTTP GET request. 

Avatar

Correct answer by
Level 10

Usually replication of a content in AEM would be done from AEM. Any specific reason for invoking from external application ?

Couple of options if needed !

1. As @scott mentioned expose rest service from AEM and call that from the Java application

2. Use Curl command to replicate and call from Java class