Replication through stand alone Java code | Community
Skip to main content
Singaiah_Chintalapudi
Level 7
March 1, 2016
Solved

Replication through stand alone Java code

  • March 1, 2016
  • 2 replies
  • 1173 views

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

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 Lokesh_Shivalingaiah

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

2 replies

smacdonald2008
Level 10
March 2, 2016

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. 

Lokesh_Shivalingaiah
Lokesh_ShivalingaiahAccepted solution
Level 10
March 2, 2016

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