/**
* @inheritDoc
* @see OperationVisitor#visit(Restore)
*/
public void visit(Restore operation) throws VersionException, PathNotFoundException, ItemExistsException, UnsupportedRepositoryOperationException, LockException, InvalidItemStateException, RepositoryException {
NodeId nId = operation.getNodeId();
if (nId == null) {
service.restore(sessionInfo, operation.getVersionIds(), operation.removeExisting());
} else {
NodeId targetId;
Path relPath = operation.getRelativePath();
if (relPath != null) {
targetId = idFactory.createNodeId(nId, relPath);
} else {
targetId = nId;
}
NodeId versionId = operation.getVersionIds()[0];
service.restore(sessionInfo, targetId, versionId, operation.removeExisting());
}
}