001/*
002 * CDDL HEADER START
003 *
004 * The contents of this file are subject to the terms of the
005 * Common Development and Distribution License, Version 1.0 only
006 * (the "License").  You may not use this file except in compliance
007 * with the License.
008 *
009 * You can obtain a copy of the license at
010 * docs/licenses/cddl.txt
011 * or http://www.opensource.org/licenses/cddl1.php.
012 * See the License for the specific language governing permissions
013 * and limitations under the License.
014 *
015 * When distributing Covered Code, include this CDDL HEADER in each
016 * file and include the License file at
017 * docs/licenses/cddl.txt.  If applicable,
018 * add the following below this CDDL HEADER, with the fields enclosed
019 * by brackets "[]" replaced with your own identifying information:
020 *      Portions Copyright [yyyy] [name of copyright owner]
021 *
022 * CDDL HEADER END
023 *
024 *
025 *      Copyright 2010-2021 Ping Identity Corporation
026 */
027package com.unboundid.directory.sdk.common.schema;
028
029
030
031import java.util.List;
032import java.util.Map;
033import java.util.Set;
034
035import com.unboundid.util.NotExtensible;
036import com.unboundid.util.ThreadSafety;
037import com.unboundid.util.ThreadSafetyLevel;
038
039
040
041/**
042 * This interface defines a set of methods that may be used to obtain
043 * information about a DIT structure rule defined in the server schema.
044 */
045@NotExtensible()
046@ThreadSafety(level=ThreadSafetyLevel.INTERFACE_THREADSAFE)
047public interface DITStructureRule
048{
049  /**
050   * Retrieves the rule ID for this DIT structure rule.
051   *
052   * @return  The rule ID for this DIT structure rule.
053   */
054  int getRuleID();
055
056
057
058  /**
059   * Retrieves the list of names for this DIT structure rule, if any.
060   *
061   * @return  The list of names for this DIT structure rule, or an empty list if
062   *          there are no user-defined names.
063   */
064  List<String> getNames();
065
066
067
068  /**
069   * Retrieves the primary name for this DIT structure rule, or the rule ID if
070   * no names are defined.
071   *
072   * @return The primary name or rule ID for this DIT structure rule.
073   */
074  String getNameOrRuleID();
075
076
077
078  /**
079   * Indicates whether the provided string is equal to any of the defined names
080   * or the rule ID for this DIT structure rule.
081   *
082   * @param  name  The name for which to make the determination.
083   *
084   * @return  {@code true} if the provided string matches one of the names or
085   *          the rule ID for this DIT structure rule, or {@code false} if not.
086   */
087  boolean hasNameOrRuleID(final String name);
088
089
090
091  /**
092   * Retrieves the description for this DIT content rule, if any.
093   *
094   * @return  The description for this DIT content rule, or {@code null} if it
095   *          does not have a description.
096   */
097  String getDescription();
098
099
100
101  /**
102   * Retrieves the name form for this DIT structure rule.
103   *
104   * @return  The name form for this DIT structure rule.
105   */
106  NameForm getNameForm();
107
108
109
110  /**
111   * Retrieves the structural object class for this DIT content rule.
112   *
113   * @return  The structural object class for this DIT content rule.
114   */
115  ObjectClass getStructuralClass();
116
117
118
119  /**
120   * Retrieves the set of superior DIT structure rules for this rule, if any.
121   *
122   * @return  The set of superior DIT structure rules, or an empty set if there
123   *          are no superior rules.
124   */
125  Set<DITStructureRule> getSuperiorRules();
126
127
128
129  /**
130   * Indicates whether this DIT structure rule is declared obsolete in the
131   * server schema.
132   *
133   * @return  {@code true} if this DIT structure rule is declared obsolete in
134   *          the server schema, or {@code false} if not.
135   */
136  boolean isObsolete();
137
138
139
140  /**
141   * Retrieves a map of all defined extensions for this DIT structure rule.
142   *
143   * @return  A map of all defined extensions for this DIT structure rule.
144   */
145  Map<String,List<String>> getExtensions();
146
147
148
149  /**
150   * Retrieves the name of the schema file in which this DIT structure rule is
151   * defined.
152   *
153   * @return  The name of the schema file in which this DIT structure rule is
154   *          defined.
155   */
156  String getSchemaFileName();
157
158
159
160  /**
161   * Indicates whether the provided object is equal to this DIT structure rule.
162   *
163   * @param  o  The object for which to make the determination.
164   *
165   * @return  {@code true} if the provided object is equal to this DIT structure
166   *          rule, or {@code false} if not.
167   */
168  boolean equals(final Object o);
169
170
171
172  /**
173   * Retrieves a hash code for this DIT structure rule.
174   *
175   * @return  A hash code for this DIT structure rule.
176   */
177  int hashCode();
178
179
180
181  /**
182   * Retrieves a string representation of this DIT structure rule definition.
183   *
184   * @return  A string representation of this DIT structure rule definition.
185   */
186  String toString();
187}