Package org.ldaptive.schema
Class Schema
- java.lang.Object
-
- org.ldaptive.AbstractFreezable
-
- org.ldaptive.schema.Schema
-
- All Implemented Interfaces:
Freezable
public final class Schema extends AbstractFreezable
Bean that contains the schema definitions in RFC 4512.
-
-
Field Summary
Fields Modifier and Type Field Description private Collection<AttributeType>attributeTypesAttribute types.private Collection<DITContentRule>ditContentRulesDIT content rules.private Collection<DITStructureRule>ditStructureRulesDIT structure rules.private static intHASH_CODE_SEEDhash code seed.private Collection<MatchingRule>matchingRulesMatching rules.private Collection<MatchingRuleUse>matchingRuleUsesMatching rule uses.private Collection<NameForm>nameFormsName forms.private Collection<ObjectClass>objectClassesObject classes.private Collection<Syntax>syntaxesSyntaxes.
-
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 booleanequals(Object o)voidfreeze()Freezes this object, making it immutable.AttributeTypegetAttributeType(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.DITContentRulegetDITContentRule(String name)Returns the DIT content rule with the supplied OID or name.Collection<DITContentRule>getDitContentRules()Returns the DIT content rules.DITStructureRulegetDITStructureRule(int id)Returns the DIT structure rule with the supplied ID.DITStructureRulegetDITStructureRule(String name)Returns the DIT structure rule with the supplied name.Collection<DITStructureRule>getDitStructureRules()Returns the DIT structure rules.MatchingRulegetMatchingRule(String name)Returns the matching rule with the supplied OID or name.Collection<MatchingRule>getMatchingRules()Returns the matching rules.MatchingRuleUsegetMatchingRuleUse(String name)Returns the matching rule use with the supplied OID or name.Collection<MatchingRuleUse>getMatchingRuleUses()Returns the matching rule uses.NameFormgetNameForm(String name)Returns the name form with the supplied OID or name.Collection<NameForm>getNameForms()Returns the name forms.ObjectClassgetObjectClass(String name)Returns the object class with the supplied OID or name.Collection<ObjectClass>getObjectClasses()Returns the object classes.SyntaxgetSyntax(String oid)Returns the syntax with the supplied OID.Collection<Syntax>getSyntaxes()Returns the syntaxes.inthashCode()voidsetAttributeTypes(Collection<AttributeType> c)Sets the attribute types.voidsetDitContentRules(Collection<DITContentRule> c)Sets the DIT content rules.voidsetDitStructureRules(Collection<DITStructureRule> c)Sets the DIT structure rules.voidsetMatchingRules(Collection<MatchingRule> c)Sets the matching rules.voidsetMatchingRuleUses(Collection<MatchingRuleUse> c)Sets the matching rule uses.voidsetNameForms(Collection<NameForm> c)Sets the name forms.voidsetObjectClasses(Collection<ObjectClass> c)Sets the object classes.voidsetSyntaxes(Collection<Syntax> c)Sets the syntaxes.StringtoString()-
Methods inherited from class org.ldaptive.AbstractFreezable
assertMutable, freeze, freeze, isFrozen
-
-
-
-
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
-
freeze
public void freeze()
Description copied from interface:FreezableFreezes this object, making it immutable.- Specified by:
freezein interfaceFreezable- Overrides:
freezein classAbstractFreezable
-
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
-
-