1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20 package org.apache.directory.server.core.api.administrative;
21
22
23 import java.util.Map;
24 import java.util.concurrent.ConcurrentHashMap;
25
26 import org.apache.directory.api.ldap.model.name.Dn;
27 import org.apache.directory.api.ldap.model.subtree.AdministrativeRole;
28
29
30
31
32
33
34
35 public abstract class AbstractAdministrativePoint implements AdministrativePoint
36 {
37
38 protected Dn dn;
39
40
41 protected String uuid;
42
43
44 protected AdministrativeRole role;
45
46
47 protected AdministrativePoint parent;
48
49
50 protected Map<String, AdministrativePoint> children;
51
52
53
54
55
56
57
58
59
60 protected AbstractAdministrativePoint( Dn dn, String uuid, AdministrativeRole role )
61 {
62 this.dn = dn;
63 this.uuid = uuid;
64 this.role = role;
65 this.children = new ConcurrentHashMap<>();
66 }
67
68
69
70
71
72 public AdministrativeRole getRole()
73 {
74 return role;
75 }
76
77
78
79
80
81 public Dn getDn()
82 {
83 return dn;
84 }
85
86
87
88
89
90 public String getUuid()
91 {
92 return uuid;
93 }
94
95
96
97
98
99 public boolean isAutonomous()
100 {
101
102 return false;
103 }
104
105
106
107
108
109 public AdministrativePoint getParent()
110 {
111 return parent;
112 }
113
114
115
116
117
118 public void setParent( AdministrativePoint parent )
119 {
120 this.parent = parent;
121 }
122
123
124
125
126
127 public String toString()
128 {
129 StringBuilder sb = new StringBuilder();
130
131 sb.append( "Role: '" ).append( role ).append( "', " );
132 sb.append( "Dn: '" ).append( dn ).append( "', " );
133 sb.append( "UUID: " ).append( uuid ).append( '\n' );
134
135 return sb.toString();
136 }
137 }