Package org.ldaptive.schema
Class Schema
- java.lang.Object
-
- org.ldaptive.schema.Schema
-
public final class Schema extends Object
Bean that contains the schema definitions in RFC 4512.
-
-
Field Summary
Fields Modifier and Type Field Description private Collection<AttributeType>
attributeTypes
Attribute types.private Collection<DITContentRule>
ditContentRules
DIT content rules.private Collection<DITStructureRule>
ditStructureRules
DIT structure rules.private static int
HASH_CODE_SEED
hash code seed.private Collection<MatchingRule>
matchingRules
Matching rules.private Collection<MatchingRuleUse>
matchingRuleUses
Matching rule uses.private Collection<NameForm>
nameForms
Name forms.private Collection<ObjectClass>
objectClasses
Object classes.private Collection<Syntax>
syntaxes
Syntaxes.
-
Constructor Summary
Constructors Constructor Description Schema()
Default constructor.Schema(Collection<AttributeType> attributeTypes, Collection<DITContentRule> ditContentRules, Collection<DITStructureRule> ditStructureRules, Collection<Syntax> syntaxes, Collection<MatchingRule> matchingRules, Collection<MatchingRuleUse> matchingRuleUses, Collection<NameForm> nameForms, Collection<ObjectClass> objectClasses)
Creates a new schema.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object o)
AttributeType
getAttributeType(String name)
Returns the attribute type with the supplied OID or name.Collection<AttributeType>
getAttributeTypes()
Returns the attribute types.String[]
getBinaryAttributeNames()
Returns the attribute names in this schema that represent binary data.DITContentRule
getDITContentRule(String name)
Returns the DIT content rule with the supplied OID or name.Collection<DITContentRule>
getDitContentRules()
Returns the DIT content rules.DITStructureRule
getDITStructureRule(int id)
Returns the DIT structure rule with the supplied ID.DITStructureRule
getDITStructureRule(String name)
Returns the DIT structure rule with the supplied name.Collection<DITStructureRule>
getDitStructureRules()
Returns the DIT structure rules.MatchingRule
getMatchingRule(String name)
Returns the matching rule with the supplied OID or name.Collection<MatchingRule>
getMatchingRules()
Returns the matching rules.MatchingRuleUse
getMatchingRuleUse(String name)
Returns the matching rule use with the supplied OID or name.Collection<MatchingRuleUse>
getMatchingRuleUses()
Returns the matching rule uses.NameForm
getNameForm(String name)
Returns the name form with the supplied OID or name.Collection<NameForm>
getNameForms()
Returns the name forms.ObjectClass
getObjectClass(String name)
Returns the object class with the supplied OID or name.Collection<ObjectClass>
getObjectClasses()
Returns the object classes.Syntax
getSyntax(String oid)
Returns the syntax with the supplied OID.Collection<Syntax>
getSyntaxes()
Returns the syntaxes.int
hashCode()
void
setAttributeTypes(Collection<AttributeType> c)
Sets the attribute types.void
setDitContentRules(Collection<DITContentRule> c)
Sets the DIT content rules.void
setDitStructureRules(Collection<DITStructureRule> c)
Sets the DIT structure rules.void
setMatchingRules(Collection<MatchingRule> c)
Sets the matching rules.void
setMatchingRuleUses(Collection<MatchingRuleUse> c)
Sets the matching rule uses.void
setNameForms(Collection<NameForm> c)
Sets the name forms.void
setObjectClasses(Collection<ObjectClass> c)
Sets the object classes.void
setSyntaxes(Collection<Syntax> c)
Sets the syntaxes.String
toString()
-
-
-
Field Detail
-
HASH_CODE_SEED
private static final int HASH_CODE_SEED
hash code seed.- See Also:
- Constant Field Values
-
attributeTypes
private Collection<AttributeType> attributeTypes
Attribute types.
-
ditContentRules
private Collection<DITContentRule> ditContentRules
DIT content rules.
-
ditStructureRules
private Collection<DITStructureRule> ditStructureRules
DIT structure rules.
-
syntaxes
private Collection<Syntax> syntaxes
Syntaxes.
-
matchingRules
private Collection<MatchingRule> matchingRules
Matching rules.
-
matchingRuleUses
private Collection<MatchingRuleUse> matchingRuleUses
Matching rule uses.
-
nameForms
private Collection<NameForm> nameForms
Name forms.
-
objectClasses
private Collection<ObjectClass> objectClasses
Object classes.
-
-
Constructor Detail
-
Schema
public Schema()
Default constructor.
-
Schema
public Schema(Collection<AttributeType> attributeTypes, Collection<DITContentRule> ditContentRules, Collection<DITStructureRule> ditStructureRules, Collection<Syntax> syntaxes, Collection<MatchingRule> matchingRules, Collection<MatchingRuleUse> matchingRuleUses, Collection<NameForm> nameForms, Collection<ObjectClass> objectClasses)
Creates a new schema.- Parameters:
attributeTypes
- attribute typesditContentRules
- DIT content rulesditStructureRules
- DIT structure rulessyntaxes
- syntaxesmatchingRules
- matching rulesmatchingRuleUses
- matching rule usesnameForms
- name formsobjectClasses
- object classses
-
-
Method Detail
-
getAttributeTypes
public Collection<AttributeType> getAttributeTypes()
Returns the attribute types.- Returns:
- attribute types
-
getAttributeType
public AttributeType getAttributeType(String name)
Returns the attribute type with the supplied OID or name.- Parameters:
name
- OID or name- Returns:
- attribute type or null if name does not exist
-
setAttributeTypes
public void setAttributeTypes(Collection<AttributeType> c)
Sets the attribute types.- Parameters:
c
- attribute types
-
getBinaryAttributeNames
public String[] getBinaryAttributeNames()
Returns the attribute names in this schema that represent binary data. This includes attributes with a syntax OID of '1.3.6.1.4.1.1466.115.121.1.5' and any syntax with the 'X-NOT-HUMAN-READABLE' extension.- Returns:
- binary attribute names
-
getDitContentRules
public Collection<DITContentRule> getDitContentRules()
Returns the DIT content rules.- Returns:
- DIT content rules
-
getDITContentRule
public DITContentRule getDITContentRule(String name)
Returns the DIT content rule with the supplied OID or name.- Parameters:
name
- OID or name- Returns:
- DIT content rule or null if name does not exist
-
setDitContentRules
public void setDitContentRules(Collection<DITContentRule> c)
Sets the DIT content rules.- Parameters:
c
- DIT content rules
-
getDitStructureRules
public Collection<DITStructureRule> getDitStructureRules()
Returns the DIT structure rules.- Returns:
- DIT structure rules
-
getDITStructureRule
public DITStructureRule getDITStructureRule(int id)
Returns the DIT structure rule with the supplied ID.- Parameters:
id
- rule ID- Returns:
- DIT structure rule or null if id does not exist
-
getDITStructureRule
public DITStructureRule getDITStructureRule(String name)
Returns the DIT structure rule with the supplied name.- Parameters:
name
- rule name- Returns:
- DIT structure rule or null if name does not exist
-
setDitStructureRules
public void setDitStructureRules(Collection<DITStructureRule> c)
Sets the DIT structure rules.- Parameters:
c
- DIT structure rules
-
getSyntaxes
public Collection<Syntax> getSyntaxes()
Returns the syntaxes.- Returns:
- syntaxes
-
getSyntax
public Syntax getSyntax(String oid)
Returns the syntax with the supplied OID.- Parameters:
oid
- OID- Returns:
- syntax or null if OID does not exist
-
setSyntaxes
public void setSyntaxes(Collection<Syntax> c)
Sets the syntaxes.- Parameters:
c
- syntaxes
-
getMatchingRules
public Collection<MatchingRule> getMatchingRules()
Returns the matching rules.- Returns:
- matching rules
-
getMatchingRule
public MatchingRule getMatchingRule(String name)
Returns the matching rule with the supplied OID or name.- Parameters:
name
- OID or name- Returns:
- matching rule or null if name does not exist
-
setMatchingRules
public void setMatchingRules(Collection<MatchingRule> c)
Sets the matching rules.- Parameters:
c
- matching rules
-
getMatchingRuleUses
public Collection<MatchingRuleUse> getMatchingRuleUses()
Returns the matching rule uses.- Returns:
- matching rule uses
-
getMatchingRuleUse
public MatchingRuleUse getMatchingRuleUse(String name)
Returns the matching rule use with the supplied OID or name.- Parameters:
name
- OID or name- Returns:
- matching rule use or null if name does not exist
-
setMatchingRuleUses
public void setMatchingRuleUses(Collection<MatchingRuleUse> c)
Sets the matching rule uses.- Parameters:
c
- matching rule uses
-
getNameForms
public Collection<NameForm> getNameForms()
Returns the name forms.- Returns:
- name forms
-
getNameForm
public NameForm getNameForm(String name)
Returns the name form with the supplied OID or name.- Parameters:
name
- OID or name- Returns:
- name form or null if name does not exist
-
setNameForms
public void setNameForms(Collection<NameForm> c)
Sets the name forms.- Parameters:
c
- name forms
-
getObjectClasses
public Collection<ObjectClass> getObjectClasses()
Returns the object classes.- Returns:
- object classes
-
getObjectClass
public ObjectClass getObjectClass(String name)
Returns the object class with the supplied OID or name.- Parameters:
name
- OID or name- Returns:
- object class or null if name does not exist
-
setObjectClasses
public void setObjectClasses(Collection<ObjectClass> c)
Sets the object classes.- Parameters:
c
- object classes
-
-