public class AttributeType extends AbstractSchemaObject implements Cloneable
According to ldapbis [MODELS]:
4.1.2. Attribute Types
Attribute Type definitions are written according to the ABNF:
AttributeTypeDescription = LPAREN WSP
numericoid ; object identifier
[ SP "NAME" SP qdescrs ] ; short names (descriptors)
[ SP "DESC" SP qdstring ] ; description
[ SP "OBSOLETE" ] ; not active
[ SP "SUP" SP oid ] ; supertype
[ SP "EQUALITY" SP oid ] ; equality matching rule
[ SP "ORDERING" SP oid ] ; ordering matching rule
[ SP "SUBSTR" SP oid ] ; substrings matching rule
[ SP "SYNTAX" SP noidlen ] ; value syntax
[ SP "SINGLE-VALUE" ] ; single-value
[ SP "COLLECTIVE" ] ; collective
[ SP "NO-USER-MODIFICATION" ]; not user modifiable
[ SP "USAGE" SP usage ] ; usage
extensions WSP RPAREN ; extensions
usage = "userApplications" / ; user
"directoryOperation" / ; directory operational
"distributedOperation" / ; DSA-shared operational
"dSAOperation" ; DSA-specific operational
where:
[numericoid] is object identifier assigned to this attribute type;
NAME [qdescrs] are short names (descriptors) identifying this
attribute type;
DESC [qdstring] is a short descriptive string;
OBSOLETE indicates this attribute type is not active;
SUP oid specifies the direct supertype of this type;
EQUALITY, ORDERING, SUBSTRING provide the oid of the equality,
ordering, and substrings matching rules, respectively;
SYNTAX identifies value syntax by object identifier and may suggest
a minimum upper bound;
COLLECTIVE indicates this attribute type is collective [X.501];
NO-USER-MODIFICATION indicates this attribute type is not user
modifiable;
USAGE indicates the application of this attribute type; and
[extensions] describe extensions.
Each attribute type description must contain at least one of the SUP
or SYNTAX fields.
Usage of userApplications, the default, indicates that attributes of
this type represent user information. That is, they are user
attributes.
COLLECTIVE requires usage userApplications. Use of collective
attribute types in LDAP is not discussed in this technical
specification.
A usage of directoryOperation, distributedOperation, or dSAOperation
indicates that attributes of this type represent operational and/or
administrative information. That is, they are operational attributes.
directoryOperation usage indicates that the attribute of this type is
a directory operational attribute. distributedOperation usage
indicates that the attribute of this DSA-shared usage operational
attribute. dSAOperation usage indicates that the attribute of this
type is a DSA-specific operational attribute.
NO-USER-MODIFICATION requires an operational usage.
Note that the [AttributeTypeDescription] does not list the matching
rules which can be used with that attribute type in an extensibleMatch
search filter. This is done using the 'matchingRuleUse' attribute
described in Section 4.1.4.
This document refines the schema description of X.501 by requiring
that the SYNTAX field in an [AttributeTypeDescription] be a string
representation of an object identifier for the LDAP string syntax
definition with an optional indication of the suggested minimum bound
of a value of this attribute.
A suggested minimum upper bound on the number of characters in a value
with a string-based syntax, or the number of bytes in a value for all
other syntaxes, may be indicated by appending this bound count inside
of curly braces following the syntax's OBJECT IDENTIFIER in an
Attribute Type Description. This bound is not part of the syntax name
itself. For instance, "1.3.6.4.1.1466.0{64}" suggests that server
implementations should allow a string to be 64 characters long,
although they may allow longer strings. Note that a single character
of the Directory String syntax may be encoded in more than one octet
since UTF-8 is a variable-length encoding.
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
canUserModify
whether or not this type can be modified by directory users
|
protected MatchingRule |
equality
The equality MatchingRule associated with the equalityID
|
protected String |
equalityOid
The equality OID associated with this AttributeType
|
protected boolean |
isCollective
whether or not this type is a collective attribute
|
private boolean |
isRelaxed
A flag set when the SchemaManager is in relaxed mode
|
protected boolean |
isSingleValued
whether or not this type is single valued
|
protected MatchingRule |
ordering
The ordering MatchingRule associated with the orderingID
|
protected String |
orderingOid
The ordering OID associated with this AttributeType
|
static long |
serialVersionUID
The mandatory serialVersionUID
|
protected MatchingRule |
substring
The substring MatchingRule associated with the substringID
|
protected String |
substringOid
The substring OID associated with this AttributeType
|
protected AttributeType |
superior
The superior AttributeType
|
protected String |
superiorOid
The superior AttributeType OID
|
protected LdapSyntax |
syntax
The syntax associated with the syntaxID
|
protected long |
syntaxLength
the length of this attribute in bytes
|
protected String |
syntaxOid
The syntax OID associated with this AttributeType
|
protected UsageEnum |
usage
the usage for this attributeType
|
description, extensions, h, isEnabled, isObsolete, locked, names, objectType, oid, schemaName, specification| Constructor and Description |
|---|
AttributeType(String oid)
Creates a AttributeType object using a unique OID.
|
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Clear the current SchemaObject : remove all the references to other objects,
and all the Maps.
|
AttributeType |
copy()
Copy the current SchemaObject on place
|
boolean |
equals(Object o) |
MatchingRule |
getEquality()
Gets the MatchingRule for this AttributeType used for equality matching.
|
String |
getEqualityName()
Gets the Equality Name for this AttributeType's values.
|
String |
getEqualityOid()
Gets the Equality OID for this AttributeType's values.
|
MatchingRule |
getOrdering()
Gets the MatchingRule for this AttributeType used for Ordering matching.
|
String |
getOrderingName()
Gets the MatchingRule name for this AttributeType used for Ordering matching.
|
String |
getOrderingOid()
Gets the Ordering OID for this AttributeType's values.
|
MatchingRule |
getSubstring()
Gets the MatchingRule for this AttributeType used for Substr matching.
|
String |
getSubstringName()
Gets the MatchingRule name for this AttributeType used for Substring matching.
|
String |
getSubstringOid()
Gets the Substr OID for this AttributeType's values.
|
AttributeType |
getSuperior()
Gets the the superior AttributeType of this AttributeType.
|
String |
getSuperiorName()
Gets the Name of the superior AttributeType for this AttributeType.
|
String |
getSuperiorOid()
Gets the OID of the superior AttributeType for this AttributeType.
|
LdapSyntax |
getSyntax()
Gets the Syntax for this AttributeType's values.
|
long |
getSyntaxLength()
Gets a length limit for this AttributeType.
|
String |
getSyntaxName()
Gets the Syntax name for this AttributeType's values.
|
String |
getSyntaxOid()
Gets the Syntax OID for this AttributeType's values.
|
UsageEnum |
getUsage()
Determines the usage for this AttributeType.
|
int |
hashCode() |
boolean |
isAncestorOf(AttributeType descendant)
Checks to see if this AttributeType is the ancestor of another
attributeType.
|
private boolean |
isAncestorOrEqual(AttributeType ancestor,
AttributeType descendant)
Recursive method which checks to see if a descendant is really an ancestor or if the two
are equal.
|
boolean |
isCollective()
Gets whether or not this AttributeType is a collective attribute.
|
boolean |
isDescendantOf(AttributeType ancestor)
Checks to see if this AttributeType is the descendant of another
attributeType.
|
boolean |
isHR()
Tells if an AttributeType is HumanReadable or not, depending on its Syntax.
|
boolean |
isOperational()
Tells if the attributeType is an OPERATIONAL attribute or not
|
boolean |
isRelaxed() |
boolean |
isSingleValued()
Gets whether or not this AttributeType is single-valued.
|
boolean |
isUser()
Tells if the attributeType is a USER attribute or not
|
boolean |
isUserModifiable()
Gets whether or not this AttributeType can be modified by a user.
|
void |
setCollective(boolean collective)
Sets the collective flag
|
void |
setEquality(MatchingRule equality)
Sets the Equality MR for this AttributeType
|
void |
setEqualityOid(String equalityOid)
Sets the Equality OID for this AttributeType
|
void |
setOrdering(MatchingRule ordering)
Sets the Ordering MR for this AttributeType
|
void |
setOrderingOid(String orderingOid)
Sets the Ordering OID for this AttributeType
|
void |
setRelaxed(boolean isRelaxed)
Set this AttributeType mode to relaxed
|
void |
setSingleValued(boolean singleValued)
Tells if this AttributeType is Single Valued or not
|
void |
setSubstring(MatchingRule substring)
Sets the Substr MR for this AttributeType
|
void |
setSubstringOid(String substrOid)
Sets the Substr OID for this AttributeType
|
void |
setSuperior(AttributeType superior)
Sets the superior for this AttributeType
|
void |
setSuperior(String newSuperiorOid)
Sets the superior oid for this AttributeType
|
void |
setSuperiorOid(String superiorOid)
Sets the superior AttributeType OID of this AttributeType
|
void |
setSyntax(LdapSyntax syntax)
Sets the Syntax for this AttributeType
|
void |
setSyntaxLength(long length)
Sets the length limit of this AttributeType based on its associated
syntax.
|
void |
setSyntaxOid(String syntaxOid)
Sets the Syntax OID for this AttributeType
|
void |
setUsage(UsageEnum usage)
Sets the AttributeType usage, one of :
USER_APPLICATIONS
DIRECTORY_OPERATION
DISTRIBUTED_OPERATION
DSA_OPERATION
|
void |
setUserModifiable(boolean userModifiable)
Tells if this AttributeType can be modified by a user or not
|
String |
toString() |
addExtension, addExtension, addName, compareOid, computeHashCode, copy, getDescription, getExtension, getExtensions, getName, getNames, getObjectType, getOid, getSchemaName, getSpecification, hasExtension, isDisabled, isEnabled, isObsolete, lock, setDescription, setEnabled, setExtensions, setNames, setNames, setObsolete, setOid, setSchemaName, setSpecification, unlockpublic static final long serialVersionUID
protected String syntaxOid
protected LdapSyntax syntax
protected String equalityOid
protected MatchingRule equality
protected String substringOid
protected MatchingRule substring
protected String orderingOid
protected MatchingRule ordering
protected String superiorOid
protected AttributeType superior
protected boolean isSingleValued
protected boolean isCollective
protected boolean canUserModify
protected UsageEnum usage
protected long syntaxLength
private boolean isRelaxed
public AttributeType(String oid)
oid - the OID for this AttributeTypepublic boolean isSingleValued()
public void setSingleValued(boolean singleValued)
singleValued - True if the AttributeType is single-valuedpublic boolean isUserModifiable()
public void setUserModifiable(boolean userModifiable)
userModifiable - The flag to setpublic boolean isCollective()
public void setCollective(boolean collective)
collective - The new value to setpublic boolean isRelaxed()
public void setRelaxed(boolean isRelaxed)
isRelaxed - true if the syntax checker for this AttributeType should not be activatedpublic UsageEnum getUsage()
public void setUsage(UsageEnum usage)
usage - The AttributeType usageUsageEnumpublic long getSyntaxLength()
public void setSyntaxLength(long length)
length - the new length to setpublic AttributeType getSuperior()
public String getSuperiorOid()
public void setSuperior(AttributeType superior)
superior - The superior for this AttributeTypepublic void setSuperior(String newSuperiorOid)
newSuperiorOid - The superior oid for this AttributeTypepublic void setSuperiorOid(String superiorOid)
superiorOid - The superior AttributeType OID of this AttributeTypepublic String getSuperiorName()
public LdapSyntax getSyntax()
public void setSyntax(LdapSyntax syntax)
syntax - The Syntax for this AttributeTypepublic String getSyntaxName()
public String getSyntaxOid()
public void setSyntaxOid(String syntaxOid)
syntaxOid - The syntax OID for this AttributeTypepublic MatchingRule getEquality()
public void setEquality(MatchingRule equality)
equality - The Equality MR for this AttributeTypepublic String getEqualityOid()
public void setEqualityOid(String equalityOid)
equalityOid - The Equality OID for this AttributeTypepublic String getEqualityName()
public MatchingRule getOrdering()
public void setOrdering(MatchingRule ordering)
ordering - The Ordering MR for this AttributeTypepublic String getOrderingName()
public String getOrderingOid()
public void setOrderingOid(String orderingOid)
orderingOid - The Ordering OID for this AttributeTypepublic MatchingRule getSubstring()
public void setSubstring(MatchingRule substring)
substring - The Substr MR for this AttributeTypepublic String getSubstringName()
public String getSubstringOid()
public void setSubstringOid(String substrOid)
substrOid - The Substr OID for this AttributeTypepublic boolean isUser()
public boolean isOperational()
public boolean isAncestorOf(AttributeType descendant)
descendant - the perspective descendant to checkpublic boolean isHR()
public boolean isDescendantOf(AttributeType ancestor)
ancestor - the perspective ancestor to checkprivate boolean isAncestorOrEqual(AttributeType ancestor, AttributeType descendant)
ancestor - the possible ancestor of the descendantdescendant - the possible descendant of the ancestorpublic AttributeType copy()
copy in interface SchemaObjectpublic int hashCode()
hashCode in interface SchemaObjecthashCode in class AbstractSchemaObjectpublic boolean equals(Object o)
equals in interface SchemaObjectequals in class AbstractSchemaObjectpublic void clear()
clear in interface SchemaObjectclear in class AbstractSchemaObjectCopyright © 2003–2019 The Apache Software Foundation. All rights reserved.