throws NamingException
{
monitor.subTask( "Reading schema '" + name + "'" );
// Creating the schema
Schema schema = new SchemaImpl( name );
// Looking for the nodes of the schema
SearchControls constraintSearch = new SearchControls();
constraintSearch.setSearchScope( SearchControls.SUBTREE_SCOPE );
NamingEnumeration<SearchResult> answer = wrapper.search( "cn=" + name + ", ou=schema", "(objectclass=*)",
constraintSearch, DEREF_ALIAS_METHOD, HANDLE_REFERALS_METHOD, null, monitor, null );
if ( answer != null )
{
while ( answer.hasMoreElements() )
{
SearchResult searchResult = ( SearchResult ) answer.nextElement();
switch ( getNodeType( searchResult ) )
{
case ATTRIBUTE_TYPE:
AttributeTypeImpl at = createAttributeType( searchResult );
at.setSchema( name );
schema.addAttributeType( at );
break;
case OBJECT_CLASS:
ObjectClassImpl oc = createObjectClass( searchResult );
oc.setSchema( name );
schema.addObjectClass( oc );
break;
case MATCHING_RULE:
MatchingRuleImpl mr = createMatchingRule( searchResult );
mr.setSchema( name );
schema.addMatchingRule( mr );
break;
case SYNTAX:
SyntaxImpl syntax = createSyntax( searchResult );
syntax.setSchema( name );
schema.addSyntax( syntax );
break;
default:
break;
}
}