April 27, 2020
Estimated Post Reading Time ~

How to check the replication status through java API in AEM/Adobe CQ5

This post will explain how to check the replication status through java API in AEM

Maven dependency:
Add the following dependency to the pom.xml

<dependency>
 <groupId>com.adobe.granite</groupId>
 <artifactId>com.adobe.granite.replication.core</artifactId>
 <version>5.12.2</version>
 <scope>provided</scope>
</dependency>

API's:

@Reference
Replicator replicator;

@Reference
SlingRepository repository;

Session  session = repository.loginAdministrative(null);
ReplicationStatus status=replicator.getReplicationStatus(session, “nodepath”);

status.isDelivered(); //Checks if the content is delivered

Other methods to get different status

isActivated()
isDeactivated
isPending()


By aem4beginner

No comments:

Post a Comment

If you have any doubts or questions, please let us know.