org.opends.server.types
Interface SchemaFileElement

All Known Implementing Classes:
AttributeType, DITContentRule, DITStructureRule, MatchingRuleUse, NameForm, ObjectClass

@PublicAPI(stability=VOLATILE,
           mayInstantiate=false,
           mayExtend=false,
           mayInvoke=true)
public interface SchemaFileElement

This interface defines a set of methods that must be provided by a schema file element, which is a schema element that is loaded from a schema configuration file.

Note that this interface is not meant to be implemented by third-party code, and only the following classes should be considered schema file elements:


Method Summary
 java.lang.String getDefinition()
          Retrieves the definition string that is used to represent this element in the schema configuration file.
 java.lang.String getSchemaFile()
          Retrieves the name of the schema file in which this element is defined.
 SchemaFileElement recreateFromDefinition()
          Creates a new instance of this schema element based on the definition from the schema file.
 void setSchemaFile(java.lang.String schemaFile)
          Specifies the name of the schema file in which this element is defined.
 

Method Detail

getSchemaFile

java.lang.String getSchemaFile()
Retrieves the name of the schema file in which this element is defined.

Returns:
The name of the schema file in which this element is defined, or null if it is not known or this element is not defined in any schema file.

setSchemaFile

void setSchemaFile(java.lang.String schemaFile)
Specifies the name of the schema file in which this element is defined.

Parameters:
schemaFile - The name of the schema file in which this element is defined, or null if it is not defined in any schema file.

getDefinition

java.lang.String getDefinition()
Retrieves the definition string that is used to represent this element in the schema configuration file.

Returns:
The definition string that should be used to represent this element in the schema configuration file.

recreateFromDefinition

SchemaFileElement recreateFromDefinition()
                                         throws DirectoryException
Creates a new instance of this schema element based on the definition from the schema file. The new instance should also be created with all appropriate state information that may not be directly represented in the schema definition (e.g., the name of the schema file containing the definition).

Whenever an existing schema file element is modified with the server online, this method will be invoked to recreate any schema elements that might have been dependent upon the modified element.

Returns:
A new instance of this schema element based on the definition.
Throws:
DirectoryException - If a problem occurs while attempting to create the new instance of this schema element.