1 5 6 package org.exoplatform.services.jcr.impl.core; 7 8 9 import javax.jcr.PathNotFoundException; 10 import javax.jcr.RepositoryException; 11 12 import org.exoplatform.services.jcr.core.NodeChange; 13 import org.exoplatform.services.jcr.core.NodeData; 14 15 21 22 public class NodeChangeImpl implements NodeChange { 23 24 private NodeData node; 25 private int state; 26 private String realPath; 27 28 32 public NodeChangeImpl(NodeData node, int state, String path) { 33 this.node = node; 34 this.state = state; 35 this.realPath = path; 36 } 37 38 public NodeData getNode() { 39 return node; 40 } 41 42 public int getState() { 43 return state; 44 } 45 46 public String getPath() { 47 return realPath; 48 } 49 50 public void setState(int state) { 51 this.state = state; 52 } 53 54 public NodeData refreshNode(NodeData withNode) throws RepositoryException, PathNotFoundException { 55 node.refresh(withNode); 56 return node; 57 } 58 59 60 public String toString() { 61 return "NODE CHANGE: state =" + NodeChangeState.getStateName(state) + " " + node; 62 } 63 } 64 | Popular Tags |