org.apache.directory.shared.ldap.schema
Interface SchemaObject

All Superinterfaces:
java.io.Serializable
All Known Implementing Classes:
AbstractSchemaObject, AccessPointSyntaxChecker, ACIItemSyntaxChecker, AttributeType, AttributeTypeDescriptionSyntaxChecker, AttributeTypeUsageSyntaxChecker, AudioSyntaxChecker, BinarySyntaxChecker, BitStringSyntaxChecker, BooleanComparator, BooleanNormalizer, BooleanSyntaxChecker, ByteArrayComparator, CachingDeepTrimNormalizer, CachingDeepTrimToLowerNormalizer, CachingDnNormalizer, CachingNormalizer, CertificateListSyntaxChecker, CertificatePairSyntaxChecker, CertificateSyntaxChecker, ComparableComparator, ComparatorSyntaxChecker, CountrySyntaxChecker, CsnComparator, CsnSidComparator, CsnSidSyntaxChecker, CsnSyntaxChecker, DataQualitySyntaxSyntaxChecker, DeepTrimCachingNormalizingComparator, DeepTrimNormalizer, DeepTrimToLowerCachingNormalizingComparator, DeepTrimToLowerNormalizer, DefaultStringNormalizer, DeliveryMethodSyntaxChecker, DirectoryStringSyntaxChecker, DITContentRule, DITContentRuleDescriptionSyntaxChecker, DITStructureRule, DITStructureRuleDescriptionSyntaxChecker, DLSubmitPermissionSyntaxChecker, DnComparator, DnNormalizer, DNSyntaxChecker, DSAQualitySyntaxSyntaxChecker, DSETypeSyntaxChecker, EnhancedGuideSyntaxChecker, FacsimileTelephoneNumberSyntaxChecker, FaxSyntaxChecker, GeneralizedTimeComparator, GeneralizedTimeNormalizer, GeneralizedTimeSyntaxChecker, GuideSyntaxChecker, Ia5StringSyntaxChecker, IntegerOrderingComparator, IntegerSyntaxChecker, JavaByteSyntaxChecker, JavaIntegerSyntaxChecker, JavaLongSyntaxChecker, JavaShortSyntaxChecker, JpegSyntaxChecker, LdapComparator, LdapComparatorDescription, LdapSyntax, LdapSyntaxDescriptionSyntaxChecker, LoadableSchemaObject, LongComparator, MailPreferenceSyntaxChecker, MasterAndShadowAccessPointSyntaxChecker, MatchingRule, MatchingRuleDescriptionSyntaxChecker, MatchingRuleUse, MatchingRuleUseDescriptionSyntaxChecker, MHSORAddressSyntaxChecker, NameAndOptionalUIDSyntaxChecker, NameForm, NameFormDescriptionSyntaxChecker, NameOrNumericIdNormalizer, NoOpNormalizer, Normalizer, NormalizerDescription, NormalizerSyntaxChecker, NumberSyntaxChecker, NumericNormalizer, NumericOidSyntaxChecker, NumericStringComparator, NumericStringSyntaxChecker, ObjectClass, ObjectClassDescriptionSyntaxChecker, ObjectClassTypeComparator, ObjectClassTypeSyntaxChecker, ObjectIdentifierComparator, ObjectIdentifierFirstComponentComparator, ObjectIdentifierNormalizer, ObjectNameSyntaxChecker, OctetStringSyntaxChecker, OidLenSyntaxChecker, OidSyntaxChecker, OtherMailboxSyntaxChecker, PostalAddressSyntaxChecker, PresentationAddressSyntaxChecker, PrintableStringSyntaxChecker, ProtocolInformationSyntaxChecker, RegexNormalizer, RegexSyntaxChecker, SerializableComparator, StringComparator, SubstringAssertionSyntaxChecker, SubtreeSpecificationSyntaxChecker, SupplierAndConsumerSyntaxChecker, SupplierInformationSyntaxChecker, SupplierOrConsumerSyntaxChecker, SupportedAlgorithmSyntaxChecker, SyntaxChecker, SyntaxCheckerDescription, SyntaxCheckerSyntaxChecker, TelephoneNumberComparator, TelephoneNumberNormalizer, TelephoneNumberSyntaxChecker, TeletexTerminalIdentifierSyntaxChecker, TelexNumberSyntaxChecker, UniqueMemberComparator, UniqueMemberNormalizer, UtcTimeSyntaxChecker, UUIDComparator, UuidSyntaxChecker

public interface SchemaObject
extends java.io.Serializable

Most schema objects have some common attributes. This class contains the minimum set of properties exposed by a SchemaObject.
We have 11 types of SchemaObjects :

  • AttributeType
  • DitCOntentRule
  • DitStructureRule
  • LdapComparator (specific to ADS)
  • LdapSyntaxe
  • MatchingRule
  • MatchingRuleUse
  • NameForm
  • Normalizer (specific to ADS)
  • ObjectClass
  • SyntaxChecker (specific to ADS)

    This class provides accessors and setters for the following attributes, which are common to all those SchemaObjects :
  • oid : The numeric OID
  • description : The SchemaObject description
  • obsolete : Tells if the schema object is obsolete
  • extensions : The extensions, a key/Values map
  • schemaObjectType : The SchemaObject type (see upper)
  • schema : The schema the SchemaObject is associated with (it's an extension). Can be null
  • isEnabled : The SchemaObject status (it's related to the schema status)
  • isReadOnly : Tells if the SchemaObject can be modified or not

    Some of those attributes are not used by some Schema elements, even if they should have been used. Here is the list : name : LdapSyntax, Comparator, Normalizer, SyntaxChecker numericOid : DitStructureRule, obsolete : LdapSyntax, Comparator, Normalizer, SyntaxChecker

    Version:
    $Rev: 927122 $
    Author:
    Apache Directory Project

    Method Summary
     void addExtension(java.lang.String key, java.util.List<java.lang.String> values)
              Add an extension with its values
     void addName(java.lang.String... names)
              Add a new name to the list of names for this SchemaObject.
     void addToRegistries(java.util.List<java.lang.Throwable> errors, Registries registries)
              Inject this SchemaObject into the given registries, updating the references to other SchemaObject
     void clear()
              Clear the current SchemaObject : remove all the references to other objects, and all the Maps.
     SchemaObject copy()
              Copy the current SchemaObject on place
     SchemaObject copy(SchemaObject original)
              Copy a SchemaObject.
     boolean equals(java.lang.Object o1)
               
     java.lang.String getDescription()
              Gets a short description about this SchemaObject.
     java.util.Map<java.lang.String,java.util.List<java.lang.String>> getExtensions()
               
     java.lang.String getName()
              Gets the first name in the set of short names for this SchemaObject if any exists for it.
     java.util.List<java.lang.String> getNames()
              Gets short names for this SchemaObject if any exists for it, otherwise, returns an empty list.
     SchemaObjectType getObjectType()
              The SchemaObject type : AttributeType DitCOntentRule DitStructureRule LdapComparator (specific to ADS) LdapSyntaxe MatchingRule MatchingRuleUse NameForm Normalizer (specific to ADS) ObjectClass SyntaxChecker (specific to ADS)
     java.lang.String getOid()
              Gets usually what is the numeric object identifier assigned to this SchemaObject.
     java.lang.String getSchemaName()
              Gets the name of the schema this SchemaObject is associated with.
     java.lang.String getSpecification()
              Gets the SchemaObject specification.
     int hashCode()
               
     boolean isDisabled()
              Tells if this SchemaObject is disabled.
     boolean isEnabled()
              Tells if this SchemaObject is enabled.
     boolean isObsolete()
              Gets whether or not this SchemaObject has been inactivated.
     boolean isReadOnly()
              Tells if this SchemaObject is ReadOnly.
     void lock()
              Transform the SchemaObject to an immutable object TODO locked.
     void registerOid(SchemaObject schemaObject, Registries registries)
              Register the given SchemaObject into the given registries' globalOidRegistry
     void removeFromRegistries(java.util.List<java.lang.Throwable> errors, Registries registries)
              Remove this SchemaObject from the given registries, updating the references to other SchemaObject
     void setDescription(java.lang.String description)
              Sets the SchemaObject's description
     void setEnabled(boolean enabled)
              Sets the SchemaObject state, either enabled or disabled.
     void setExtensions(java.util.Map<java.lang.String,java.util.List<java.lang.String>> extensions)
              Add an extensions with their values.
     void setNames(java.util.List<java.lang.String> names)
              Sets the list of names for this SchemaObject.
     void setObsolete(boolean obsolete)
              Sets the Obsolete flag.
     void setOid(java.lang.String oid)
              A special method used when renaming an SchemaObject: we may have to change it's OID
     void setReadOnly(boolean isReadOnly)
              Sets the SchemaObject readOnly flag
     void setRegistries(Registries registries)
              Inject the Registries into the SchemaObject
     void setSchemaName(java.lang.String schemaName)
              Sets the name of the schema this SchemaObject is associated with.
     void setSpecification(java.lang.String specification)
              Sets the SchemaObject's specification
     

    Method Detail

    getOid

    java.lang.String getOid()
    Gets usually what is the numeric object identifier assigned to this SchemaObject. All schema objects except for MatchingRuleUses have an OID assigned specifically to then. A MatchingRuleUse's OID really is the OID of it's MatchingRule and not specific to the MatchingRuleUse. This effects how MatchingRuleUse objects are maintained by the system.

    Returns:
    an OID for this SchemaObject or its MatchingRule if this SchemaObject is a MatchingRuleUse object

    setOid

    void setOid(java.lang.String oid)
    A special method used when renaming an SchemaObject: we may have to change it's OID

    Parameters:
    oid - The new OID

    getNames

    java.util.List<java.lang.String> getNames()
    Gets short names for this SchemaObject if any exists for it, otherwise, returns an empty list.

    Returns:
    the names for this SchemaObject

    getName

    java.lang.String getName()
    Gets the first name in the set of short names for this SchemaObject if any exists for it.

    Returns:
    the first of the names for this SchemaObject or the oid if one does not exist

    addToRegistries

    void addToRegistries(java.util.List<java.lang.Throwable> errors,
                         Registries registries)
                         throws LdapException
    Inject this SchemaObject into the given registries, updating the references to other SchemaObject

    Parameters:
    errors - The errors we got
    registries - The Registries
    Throws:
    LdapException

    removeFromRegistries

    void removeFromRegistries(java.util.List<java.lang.Throwable> errors,
                              Registries registries)
                              throws LdapException
    Remove this SchemaObject from the given registries, updating the references to other SchemaObject

    Parameters:
    errors - The errors we got
    registries - The Registries
    Throws:
    LdapException

    addName

    void addName(java.lang.String... names)
    Add a new name to the list of names for this SchemaObject. The name is lowercased and trimmed.

    Parameters:
    names - The names to add

    setNames

    void setNames(java.util.List<java.lang.String> names)
    Sets the list of names for this SchemaObject. The names are lowercased and trimmed.

    Parameters:
    names - The list of names. Can be empty

    getDescription

    java.lang.String getDescription()
    Gets a short description about this SchemaObject.

    Returns:
    a short description about this SchemaObject

    setDescription

    void setDescription(java.lang.String description)
    Sets the SchemaObject's description

    Parameters:
    description - The SchemaObject's description

    getSpecification

    java.lang.String getSpecification()
    Gets the SchemaObject specification.

    Returns:
    the SchemaObject specification

    setSpecification

    void setSpecification(java.lang.String specification)
    Sets the SchemaObject's specification

    Parameters:
    specification - The SchemaObject's specification

    isEnabled

    boolean isEnabled()
    Tells if this SchemaObject is enabled.

    Parameters:
    schemaEnabled - the associated schema status
    Returns:
    true if the SchemaObject is enabled, or if it depends on an enabled schema

    isDisabled

    boolean isDisabled()
    Tells if this SchemaObject is disabled.

    Returns:
    true if the SchemaObject is disabled

    setEnabled

    void setEnabled(boolean enabled)
    Sets the SchemaObject state, either enabled or disabled.

    Parameters:
    enabled - The current SchemaObject state

    isReadOnly

    boolean isReadOnly()
    Tells if this SchemaObject is ReadOnly.

    Returns:
    true if the SchemaObject is not modifiable

    setReadOnly

    void setReadOnly(boolean isReadOnly)
    Sets the SchemaObject readOnly flag

    Parameters:
    enabled - The current SchemaObject ReadOnly status

    isObsolete

    boolean isObsolete()
    Gets whether or not this SchemaObject has been inactivated. All SchemaObjects except Syntaxes allow for this parameter within their definition. For Syntaxes this property should always return false in which case it is never included in the description.

    Returns:
    true if inactive, false if active

    setObsolete

    void setObsolete(boolean obsolete)
    Sets the Obsolete flag.

    Parameters:
    obsolete - The Obsolete flag state

    getExtensions

    java.util.Map<java.lang.String,java.util.List<java.lang.String>> getExtensions()
    Returns:
    The SchemaObject extensions, as a Map of [extension, values]

    addExtension

    void addExtension(java.lang.String key,
                      java.util.List<java.lang.String> values)
    Add an extension with its values

    Parameters:
    key - The extension key
    values - The associated values

    setExtensions

    void setExtensions(java.util.Map<java.lang.String,java.util.List<java.lang.String>> extensions)
    Add an extensions with their values. (Actually do a copy)

    Parameters:
    key - The extension key
    values - The associated values

    getObjectType

    SchemaObjectType getObjectType()
    The SchemaObject type :
  • AttributeType
  • DitCOntentRule
  • DitStructureRule
  • LdapComparator (specific to ADS)
  • LdapSyntaxe
  • MatchingRule
  • MatchingRuleUse
  • NameForm
  • Normalizer (specific to ADS)
  • ObjectClass
  • SyntaxChecker (specific to ADS)

    Returns:
    the SchemaObject type

  • getSchemaName

    java.lang.String getSchemaName()
    Gets the name of the schema this SchemaObject is associated with.

    Returns:
    the name of the schema associated with this schemaObject

    setSchemaName

    void setSchemaName(java.lang.String schemaName)
    Sets the name of the schema this SchemaObject is associated with.

    Parameters:
    schemaName - the new schema name

    hashCode

    int hashCode()
    Overrides:
    hashCode in class java.lang.Object
    See Also:
    Object.hashCode()

    equals

    boolean equals(java.lang.Object o1)
    Overrides:
    equals in class java.lang.Object
    See Also:
    Object.equals(Object)

    registerOid

    void registerOid(SchemaObject schemaObject,
                     Registries registries)
                     throws LdapException
    Register the given SchemaObject into the given registries' globalOidRegistry

    Parameters:
    schemaObject - the SchemaObject we want to register
    registries - The registries in which we want it to be stored
    Throws:
    LdapException - If the OID is invalid

    copy

    SchemaObject copy()
    Copy the current SchemaObject on place

    Returns:
    The copied SchemaObject

    copy

    SchemaObject copy(SchemaObject original)
    Copy a SchemaObject.

    Returns:
    A copy of the current SchemaObject

    clear

    void clear()
    Clear the current SchemaObject : remove all the references to other objects, and all the Maps.


    setRegistries

    void setRegistries(Registries registries)
    Inject the Registries into the SchemaObject

    Parameters:
    registries - The Registries

    lock

    void lock()
    Transform the SchemaObject to an immutable object TODO locked.



    Copyright © 2003-2011 Apache Software Foundation. All Rights Reserved.