How to know if asset was replicated to preview or publish instance
I have a requirement to know after an asset is replicated whether it was replicated to the preview instance or the publish instance. Anyone has any idea how can I get this inside the Event handler?
The code below was implemented for another purpose. How can I implement the above-mentioned requirement in this?
@9944223
public void handleEvent(Event event) {
processEventIfNeeded(event);
}
private void processEventIfNeeded(Event event) {
ReplicationAction replicationAction = ReplicationAction.fromEvent(event);
String eventType = replicationAction.getType().getName();
String eventPath = replicationAction.getPath();
if ((eventType.equals(REPLICATIONACTION_ACTIVATE) || eventType.equals(REPLICATIONACTION_DEACTIVATE))
&& eventPath.startsWith("/content/dam")) {
processAssets(eventPath, eventType);
}
}