1 23 24 package org.apache.slide.structure; 25 26 import java.util.Vector ; 27 28 33 public class SubjectNode extends ObjectNode { 34 35 36 public static final String ALL_URI = "all"; 37 public static final String OWNER_URI = "owner"; 38 public static final String SELF_URI = "self"; 39 public static final String UNAUTHENTICATED_URI = "unauthenticated"; 40 public static final String AUTHENTICATED_URI = "authenticated"; 41 42 public static final SubjectNode ALL = new SubjectNode(ALL_URI); 43 public static final SubjectNode OWNER = new SubjectNode(OWNER_URI); 44 public static final SubjectNode SELF = new SubjectNode(SELF_URI); 45 public static final SubjectNode UNAUTHENTICATED = new SubjectNode(UNAUTHENTICATED_URI); 46 public static final SubjectNode AUTHENTICATED = new SubjectNode(AUTHENTICATED_URI); 47 48 49 51 52 55 public SubjectNode() { 56 super(); 57 } 58 59 60 63 public SubjectNode(String uri) { 64 super(uri); 65 } 66 67 68 71 public SubjectNode(String uri, Vector children, Vector links) { 72 super(uri, children, links); 73 } 74 75 76 79 public SubjectNode(String uuri, Vector bindings, Vector parentset, Vector links) { 80 super(uuri, bindings, parentset, links); 81 } 82 83 public static SubjectNode getSubjectNode(String subjectUri) { 84 if (SubjectNode.ALL_URI.equals(subjectUri)) { 85 return SubjectNode.ALL; 86 } 87 else if (SubjectNode.AUTHENTICATED_URI.equals(subjectUri)) { 88 return SubjectNode.AUTHENTICATED; 89 } 90 else if (SubjectNode.OWNER_URI.equals(subjectUri)) { 91 return SubjectNode.OWNER; 92 } 93 else if (SubjectNode.SELF_URI.equals(subjectUri)) { 94 return SubjectNode.SELF; 95 } 96 else if (SubjectNode.UNAUTHENTICATED_URI.equals(subjectUri)) { 97 return SubjectNode.UNAUTHENTICATED; 98 } 99 return new SubjectNode(subjectUri); 100 } 101 } 102 | Popular Tags |