Class MovingNode
- java.lang.Object
-
- com.adobe.acs.commons.mcp.impl.processes.renovator.MovingNode
-
- Direct Known Subclasses:
MovingAsset,MovingFolder,MovingPage,MovingResource
public abstract class MovingNode extends Object
Represents a node in the process of moving.
-
-
Constructor Summary
Constructors Constructor Description MovingNode()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidaddChild(MovingNode child)Optional<MovingNode>findByPath(String path)voidfindReferences(org.apache.sling.api.resource.ResourceResolver rr, String referenceSearchRoot, int maxReferences)List<String>getAllReferences()List<MovingNode>getChildren()protected Map<String,Object>getClonedProperties(org.apache.sling.api.resource.Resource source)StringgetDestinationPath()MovingNodegetParent()StringgetPreviousSibling()List<String>getPublishedReferences()StringgetSourcePath()booleanhasChild(String path)abstract booleanisAbleToHaveChildren()abstract booleanisCopiedBeforeMove()booleanisDestinationAlreadyExists()booleanisLeaf()booleanisSourceActivated()abstract booleanisSupposedToBeReferenced()abstract voidmove(ReplicatorQueue replicatorQueue, org.apache.sling.api.resource.ResourceResolver rr)voidsetChildren(List<MovingNode> children)voidsetDestinationAlreadyExists(boolean destinationAlreadyExists)voidsetDestinationPath(String destinationPath)voidsetParent(MovingNode parent)voidsetSourcePath(String sourcePath)voidvisit(Consumer<MovingNode> consumer)Depth-first visitor, provide consumer function every node in the treevoidvisit(Consumer<MovingNode> consumer, Consumer<MovingNode> leafConsumer, Function<MovingNode,Boolean> traversalFilter)Depth-first visitor
-
-
-
Method Detail
-
isCopiedBeforeMove
public abstract boolean isCopiedBeforeMove()
-
isSupposedToBeReferenced
public abstract boolean isSupposedToBeReferenced()
-
isAbleToHaveChildren
public abstract boolean isAbleToHaveChildren()
-
addChild
public void addChild(MovingNode child)
-
isLeaf
public boolean isLeaf()
-
isSourceActivated
public boolean isSourceActivated()
-
getSourcePath
public String getSourcePath()
- Returns:
- the sourcePath
-
setSourcePath
public void setSourcePath(String sourcePath)
- Parameters:
sourcePath- the sourcePath to set
-
getDestinationPath
public String getDestinationPath()
- Returns:
- the destinationPath
-
setDestinationPath
public void setDestinationPath(String destinationPath)
- Parameters:
destinationPath- the destinationPath to set
-
getParent
public MovingNode getParent()
- Returns:
- the parent
-
setParent
public void setParent(MovingNode parent)
- Parameters:
parent- the parent to set
-
getChildren
public List<MovingNode> getChildren()
- Returns:
- the children
-
setChildren
public void setChildren(List<MovingNode> children)
- Parameters:
children- the children to set
-
isDestinationAlreadyExists
public boolean isDestinationAlreadyExists()
- Returns:
- the destinationAlreadyExists
-
setDestinationAlreadyExists
public void setDestinationAlreadyExists(boolean destinationAlreadyExists)
- Parameters:
destinationAlreadyExists- the destinationAlreadyExists to set
-
getPreviousSibling
public String getPreviousSibling()
-
move
public abstract void move(ReplicatorQueue replicatorQueue, org.apache.sling.api.resource.ResourceResolver rr) throws IllegalAccessException, MovingException
-
findReferences
public void findReferences(org.apache.sling.api.resource.ResourceResolver rr, String referenceSearchRoot, int maxReferences) throws IllegalAccessException- Throws:
IllegalAccessException
-
visit
public void visit(Consumer<MovingNode> consumer)
Depth-first visitor, provide consumer function every node in the tree- Parameters:
consumer- Consumer which accepts nodes
-
visit
public void visit(Consumer<MovingNode> consumer, Consumer<MovingNode> leafConsumer, Function<MovingNode,Boolean> traversalFilter)
Depth-first visitor- Parameters:
consumer- Consumer for traversed nodesleafConsumer- Consumer for leaf nodes (first level after traversalFilter returns false), if no traversal function this is never calledtraversalFilter- Function which determines if the tree should be evaluated any deeper, Null means always true
-
findByPath
public Optional<MovingNode> findByPath(String path)
-
hasChild
public boolean hasChild(String path)
-
-