com.merkle.oss.magnolia.powernode.AbstractPowerNodeService Maven / Gradle / Ivy
package com.merkle.oss.magnolia.powernode;
import javax.jcr.Node;
import javax.jcr.Session;
import java.util.Optional;
public abstract class AbstractPowerNodeService> {
private final NodeService nodeService;
private final AbstractPowerNodeDecorator powerNodeDecorator;
protected AbstractPowerNodeService(
final NodeService nodeService,
final AbstractPowerNodeDecorator powerNodeDecorator
) {
this.nodeService = nodeService;
this.powerNodeDecorator = powerNodeDecorator;
}
public N convertToPowerNode(final Node node) {
return powerNodeDecorator.wrapNode(node);
}
public Optional getSession(final String workspace) {
return nodeService.getSession(workspace);
}
public Optional getSystemSession(final String workspace) {
return nodeService.getSystemSession(workspace);
}
public Optional getByIdentifier(final String workspace, final String identifier) {
return nodeService.getByIdentifier(workspace, identifier).map(powerNodeDecorator::wrapNode);
}
public Optional getByIdentifier(final Session session, final String identifier) {
return nodeService.getByIdentifier(session, identifier).map(powerNodeDecorator::wrapNode);
}
public Optional getByPath(final String workspace, final String path) {
return nodeService.getByPath(workspace, path).map(powerNodeDecorator::wrapNode);
}
public Optional getByPath(final Session session, final String path) {
return nodeService.getByPath(session, path).map(powerNodeDecorator::wrapNode);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy