1 9 package org.jboss.portal.core.impl.tree; 10 11 import org.jboss.cache.Fqn; 12 13 20 public class NodeStateEvent 21 { 22 23 24 public static final int STATUS_CREATED = 0; 25 26 27 public static final int STATUS_MODIFIED = 1; 28 29 30 public static final int STATUS_REMOVED = 2; 31 32 33 private static final String [] toStrings = {"created","modified","removed"}; 34 35 36 private final Fqn fqn; 37 38 39 private int status; 40 41 public NodeStateEvent(Fqn fqn, int state) 42 { 43 if (fqn == null) 44 { 45 throw new IllegalArgumentException ("No null fqn"); 46 } 47 if (state < 0 || state > 2) 48 { 49 throw new IllegalArgumentException ("State not accepted"); 50 } 51 this.fqn = fqn; 52 this.status = state; 53 } 54 55 public int getStatus() 56 { 57 return status; 58 } 59 60 public void setStatus(int status) 61 { 62 if (status < 0 || status > 2) 63 { 64 throw new IllegalArgumentException ("State not accepted"); 65 } 66 this.status = status; 67 } 68 69 public Fqn getFqn() 70 { 71 return fqn; 72 } 73 74 public String toString() 75 { 76 return "NodeState[" + fqn + "," + toStrings[status] + "]"; 77 } 78 } 79 | Popular Tags |