KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > exoplatform > services > jcr > impl > core > NodeChangeImpl


1 /***************************************************************************
2  * Copyright 2001-2003 The eXo Platform SARL All rights reserved. *
3  * Please look at license.txt in info directory for more license detail. *
4  **************************************************************************/

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 /**
16  * Created by The eXo Platform SARL .
17  *
18  * @author <a HREF="mailto:geaz@users.sourceforge.net">Gennady Azarenkov</a>
19  * @version $Id: NodeChangeImpl.java,v 1.3 2004/09/16 15:26:53 geaz Exp $
20  */

21
22 public class NodeChangeImpl implements NodeChange {
23
24   private NodeData node;
25   private int state;
26   private String JavaDoc realPath;
27
28 // public NodeChangeImpl(NodeData node, int state) {
29
// this(node, state, node.getPath());
30
// }
31

32   public NodeChangeImpl(NodeData node, int state, String JavaDoc 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 JavaDoc 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 JavaDoc toString() {
61     return "NODE CHANGE: state =" + NodeChangeState.getStateName(state) + " " + node;
62   }
63 }
64
Popular Tags