org.apache.directory.server.core.schema
Interface SchemaPartitionDao

All Known Implementing Classes:
SchemaPartitionDaoImpl

public interface SchemaPartitionDao


Method Summary
 void enableSchema(java.lang.String schemaName)
          Enables a schema by removing it's m-disabled attribute if present.
 org.apache.directory.shared.ldap.entry.ServerEntry find(java.lang.String entityName)
          Given the non-normalized name (alias) or the OID for a schema entity.
 org.apache.directory.shared.ldap.name.DN findDn(java.lang.String entityName)
           
 java.lang.String findSchema(java.lang.String entityName)
          Given the non-normalized name (alias) or the OID for a schema entity.
 org.apache.directory.shared.ldap.schema.registries.Schema getSchema(java.lang.String schemaName)
           
 java.util.Set<java.lang.String> getSchemaNames()
           
 java.util.Map<java.lang.String,org.apache.directory.shared.ldap.schema.registries.Schema> getSchemas()
           
 boolean hasAttributeType(java.lang.String oid)
           
 boolean hasMatchingRule(java.lang.String oid)
           
 boolean hasObjectClass(java.lang.String oid)
           
 boolean hasSyntax(java.lang.String oid)
           
 boolean hasSyntaxChecker(java.lang.String oid)
           
 EntryFilteringCursor listAllNames()
           
 java.util.Set<org.apache.directory.shared.ldap.entry.ServerEntry> listAttributeTypeDependents(org.apache.directory.shared.ldap.schema.AttributeType at)
           
 java.util.Set<org.apache.directory.shared.ldap.entry.ServerEntry> listEnabledSchemaDependents(java.lang.String schemaName)
          Lists the SearchResults of metaSchema objects that depend on a schema.
 java.util.Set<org.apache.directory.shared.ldap.entry.ServerEntry> listMatchingRuleDependents(org.apache.directory.shared.ldap.schema.MatchingRule mr)
           
 java.util.Set<org.apache.directory.shared.ldap.entry.ServerEntry> listObjectClassDependents(org.apache.directory.shared.ldap.schema.ObjectClass oc)
           
 java.util.Set<org.apache.directory.shared.ldap.entry.ServerEntry> listSchemaDependents(java.lang.String schemaName)
          Lists the SearchResults of metaSchema objects that depend on a schema.
 java.util.Set<org.apache.directory.shared.ldap.entry.ServerEntry> listSyntaxDependents(java.lang.String numericOid)
          Returns the set of matchingRules and attributeTypes which depend on the provided syntax.
 

Method Detail

getSchemas

java.util.Map<java.lang.String,org.apache.directory.shared.ldap.schema.registries.Schema> getSchemas()
                                                                                                     throws java.lang.Exception
Throws:
java.lang.Exception

getSchemaNames

java.util.Set<java.lang.String> getSchemaNames()
                                               throws java.lang.Exception
Throws:
java.lang.Exception

getSchema

org.apache.directory.shared.ldap.schema.registries.Schema getSchema(java.lang.String schemaName)
                                                                    throws java.lang.Exception
Throws:
java.lang.Exception

hasMatchingRule

boolean hasMatchingRule(java.lang.String oid)
                        throws java.lang.Exception
Throws:
java.lang.Exception

hasAttributeType

boolean hasAttributeType(java.lang.String oid)
                         throws java.lang.Exception
Throws:
java.lang.Exception

hasObjectClass

boolean hasObjectClass(java.lang.String oid)
                       throws java.lang.Exception
Throws:
java.lang.Exception

hasSyntax

boolean hasSyntax(java.lang.String oid)
                  throws java.lang.Exception
Throws:
java.lang.Exception

hasSyntaxChecker

boolean hasSyntaxChecker(java.lang.String oid)
                         throws java.lang.Exception
Throws:
java.lang.Exception

findSchema

java.lang.String findSchema(java.lang.String entityName)
                            throws java.lang.Exception
Given the non-normalized name (alias) or the OID for a schema entity. This method finds the schema under which that entity is located. NOTE: this method presumes that all alias names across schemas are unique. This should be the case for LDAP but this can potentially be violated so we should make sure this is a unique name.

Parameters:
entityName - one of the names of the entity or it's numeric id
Returns:
the name of the schema that contains that entity or null if no entity with that alias name exists
Throws:
javax.naming.NamingException - if more than one entity has the name, or if there are underlying data access problems
java.lang.Exception

findDn

org.apache.directory.shared.ldap.name.DN findDn(java.lang.String entityName)
                                                throws java.lang.Exception
Throws:
java.lang.Exception

find

org.apache.directory.shared.ldap.entry.ServerEntry find(java.lang.String entityName)
                                                        throws java.lang.Exception
Given the non-normalized name (alias) or the OID for a schema entity. This method finds the entry of the schema entity. NOTE: this method presumes that all alias names across schemas are unique. This should be the case for LDAP but this can potentially be violated so we should make sure this is a unique name.

Parameters:
entityName - one of the names of the entity or it's numeric id
Returns:
the search result for the entity or null if no such entity exists with that alias or numeric oid
Throws:
javax.naming.NamingException - if more than one entity has the name, or if there are underlying data access problems
java.lang.Exception

enableSchema

void enableSchema(java.lang.String schemaName)
                  throws java.lang.Exception
Enables a schema by removing it's m-disabled attribute if present. NOTE: This is a write operation and great care must be taken to make sure it is used in a limited capacity. This method is called in two places currently. (1) Within the initialization sequence to enable schemas required for the correct operation of indices in other partitions. (2) Within the partition schema loader to auto enable schemas that are depended on by other schemas which are enabled. In both cases, the modifier is effectively the administrator since the server is performing the operation directly or on behalf of a user. In case (1) during intialization there is no other user involved so naturally the modifier is the administrator. In case (2) when a user enables a schema with a dependency that is not enabled the server enables that dependency on behalf of the user. Again effectively it is the server that is modifying the schema entry and hence the admin is the modifier. No need to worry about a lack of replication propagation in both cases. In case (1) all replicas will enable these schemas anyway on startup. In case (2) the original operation that enabled the schema depending on the on that enableSchema() is called for itself will be replicated. Hence the same chain reaction will occur in a replica.

Parameters:
schemaName - the name of the schema to enable
Throws:
javax.naming.NamingException - if there is a problem updating the schema entry
java.lang.Exception

listSyntaxDependents

java.util.Set<org.apache.directory.shared.ldap.entry.ServerEntry> listSyntaxDependents(java.lang.String numericOid)
                                                                                       throws java.lang.Exception
Returns the set of matchingRules and attributeTypes which depend on the provided syntax.

Parameters:
numericOid - the numeric identifier for the entity
Returns:
the set of matchingRules and attributeTypes depending on a syntax
Throws:
javax.naming.NamingException - if the dao fails to perform search operations
java.lang.Exception

listMatchingRuleDependents

java.util.Set<org.apache.directory.shared.ldap.entry.ServerEntry> listMatchingRuleDependents(org.apache.directory.shared.ldap.schema.MatchingRule mr)
                                                                                             throws java.lang.Exception
Throws:
java.lang.Exception

listAllNames

EntryFilteringCursor listAllNames()
                                  throws java.lang.Exception
Throws:
java.lang.Exception

listAttributeTypeDependents

java.util.Set<org.apache.directory.shared.ldap.entry.ServerEntry> listAttributeTypeDependents(org.apache.directory.shared.ldap.schema.AttributeType at)
                                                                                              throws java.lang.Exception
Throws:
java.lang.Exception

listSchemaDependents

java.util.Set<org.apache.directory.shared.ldap.entry.ServerEntry> listSchemaDependents(java.lang.String schemaName)
                                                                                       throws java.lang.Exception
Lists the SearchResults of metaSchema objects that depend on a schema.

Parameters:
schemaName - the name of the schema to search for dependees
Returns:
a set of SearchResults over the schemas whose m-dependency attribute contains schemaName
Throws:
javax.naming.NamingException - if there is a problem while searching the schema partition
java.lang.Exception

listEnabledSchemaDependents

java.util.Set<org.apache.directory.shared.ldap.entry.ServerEntry> listEnabledSchemaDependents(java.lang.String schemaName)
                                                                                              throws java.lang.Exception
Lists the SearchResults of metaSchema objects that depend on a schema.

Parameters:
schemaName - the name of the schema to search for dependencies
Returns:
a set of SearchResults over the schemas whose m-dependency attribute contains schemaName
Throws:
javax.naming.NamingException - if there is a problem while searching the schema partition
java.lang.Exception

listObjectClassDependents

java.util.Set<org.apache.directory.shared.ldap.entry.ServerEntry> listObjectClassDependents(org.apache.directory.shared.ldap.schema.ObjectClass oc)
                                                                                            throws java.lang.Exception
Throws:
java.lang.Exception


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