1 /*
2 * Licensed to the Apache Software Foundation (ASF) under one
3 * or more contributor license agreements. See the NOTICE file
4 * distributed with this work for additional information
5 * regarding copyright ownership. The ASF licenses this file
6 * to you under the Apache License, Version 2.0 (the
7 * "License"); you may not use this file except in compliance
8 * with the License. You may obtain a copy of the License at
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing,
13 * software distributed under the License is distributed on an
14 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 * KIND, either express or implied. See the License for the
16 * specific language governing permissions and limitations
17 * under the License.
18 *
19 */
20 package org.apache.directory.server.core.subtree;
21
22
23 import org.apache.directory.shared.ldap.subtree.SubtreeSpecification;
24
25
26 /**
27 * An operational view of a subentry within the system.
28 *
29 * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
30 * @version $Rev$
31 */
32 public class Subentry
33 {
34 static final int COLLECTIVE_SUBENTRY = 1;
35 static final int SCHEMA_SUBENTRY = 2;
36 static final int ACCESS_CONTROL_SUBENTRY = 4;
37 static final int TRIGGER_SUBENTRY = 8;
38
39 private SubtreeSpecification ss;
40 private int type;
41
42
43 final void setSubtreeSpecification( SubtreeSpecification ss )
44 {
45 this.ss = ss;
46 }
47
48
49 final SubtreeSpecification getSubtreeSpecification()
50 {
51 return ss;
52 }
53
54
55 final void setTypes( int type )
56 {
57 this.type = type;
58 }
59
60
61 final int getTypes()
62 {
63 return type;
64 }
65
66
67 final boolean isCollectiveSubentry()
68 {
69 return ( COLLECTIVE_SUBENTRY & type ) == COLLECTIVE_SUBENTRY;
70 }
71
72
73 final boolean isSchemaSubentry()
74 {
75 return ( SCHEMA_SUBENTRY & type ) == SCHEMA_SUBENTRY;
76 }
77
78
79 final boolean isAccessControlSubentry()
80 {
81 return ( ACCESS_CONTROL_SUBENTRY & type ) == ACCESS_CONTROL_SUBENTRY;
82 }
83
84
85 final boolean isTriggerSubentry()
86 {
87 return ( TRIGGER_SUBENTRY & type ) == TRIGGER_SUBENTRY;
88 }
89 }