Package com.day.cq.replication
Interface ReplicationPathTransformer
-
public interface ReplicationPathTransformer
Transforms the replication path for the replication request. It provides a hook, while building and importing replication content package, that can map a given replication path (i.e. /content/dam/skiing/images/Banner.JPG) to new target replication path (i.e. /content/dam/campaigns/skiing/images/Banner.JPG) This can be used when you need to replicate between system where path hierarchies on one system do not exactly match to path hierarchies on other system. Please note that it only allows for one-to-one mapping between source and target for a replication request. Implementations can choose usingaccepts(javax.jcr.Session, ReplicationAction, Agent)
, whether to map/transform given replication path in the context of the current replication request.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
accepts(Session session, ReplicationAction action, Agent agent)
Returnstrue
if Transformer can transform replication path for given replication request.java.lang.String
transform(Session session, java.lang.String replicationPath, ReplicationAction action, Agent agent)
Transforms the replication path.
-
-
-
Method Detail
-
transform
java.lang.String transform(Session session, java.lang.String replicationPath, ReplicationAction action, Agent agent)
Transforms the replication path. Should return the samereplicationPath
in case of error or if it can not be transform. i.e. an implementation map a given replication path (i.e. /content/dam/skiing/images/Banner.JPG) to new target replication path (i.e. /content/dam/campaigns/skiing/images/Banner.JPG) or vice versa, depending on the current replication context i.e. replication vs reverse replication Implementations can choose usingaccepts(javax.jcr.Session, ReplicationAction, Agent)
, whether to map/transform given replication path in the context of the current replication request. Replication Agentagent
and Replication Actionaction
is also available, based on the context in which the transform is called. i.e. in case of reverse replication, agent will not be null. So based on agent, transform method implementation may choose to do reverse mapping by identifying that it is a reverse replication.- Parameters:
session
- jcr sessionreplicationPath
- replication path that needs to be transformedaction
- replication action if availableagent
- replication agent if available in the current context. i.e. Replication agent is not available while importing a replication content package.- Returns:
- the transformed path
-
accepts
boolean accepts(Session session, ReplicationAction action, Agent agent)
Returnstrue
if Transformer can transform replication path for given replication request. This allows implementation to choose which requests to intercept i.e. replicate request in case of reverse replication, would have theAgent
, so the implementation can check if it is the agent that implementation is interested in. Or usingSession
, implementation can look at the current user context and decide whether a transformation is needed or not.- Parameters:
session
- jcr sessionaction
- replication action if availableagent
- replication agent if available in the current context. i.e. Replication agent is not available while importing a replication content package.- Returns:
true
if it can transformfalse
if it can not transform
-
-