/** * Retrieve the schema name for a specific SchemaObject, or return "other" if none is found. */ private String getSchemaName( SchemaObject schemaObject ) { String schemaName = StringTools.toLowerCase( schemaObject.getSchemaName() ); if ( loadedSchemas.containsKey( schemaName ) ) { return schemaName; } else { return MetaSchemaConstants.SCHEMA_OTHER; } }
/** * Tells if the given SchemaObject is present in one schema. The schema * may be disabled. * * @param schemaObject The schemaObject we are looking for * @return true if the schemaObject is present in a schema */ public boolean contains( SchemaObject schemaObject ) { String schemaName = schemaObject.getSchemaName(); Set<SchemaObjectWrapper> setSchemaObjects = schemaObjects.get( schemaName ); if ( ( setSchemaObjects == null ) || setSchemaObjects.isEmpty() ) { return false; } SchemaObjectWrapper wrapper = new SchemaObjectWrapper( schemaObject ); return setSchemaObjects.contains( wrapper ); }
/** * {@inheritDoc} */ public void renameSchema( String originalSchemaName, String newSchemaName ) { // Loop on all the SchemaObjects stored and remove those associated // with the give schemaName for ( T schemaObject : this ) { if ( originalSchemaName.equalsIgnoreCase( schemaObject.getSchemaName() ) ) { schemaObject.setSchemaName( newSchemaName ); if ( DEBUG ) { LOG.debug( "Renamed {} schemaName to {}", schemaObject, newSchemaName ); } } } }
/** * {@inheritDoc} */ public void unregisterSchemaElements( String schemaName ) throws LdapException { if ( schemaName == null ) { return; } // Loop on all the SchemaObjects stored and remove those associated // with the give schemaName for ( T schemaObject : this ) { if ( schemaName.equalsIgnoreCase( schemaObject.getSchemaName() ) ) { String oid = schemaObject.getOid(); SchemaObject removed = unregister( oid ); if ( DEBUG ) { LOG.debug( "Removed {} with oid {} from the registry", removed, oid ); } } } }
/** * {@inheritDoc} */ public String getSchemaName( String oid ) throws LdapException { if ( !OID.isOID( oid ) ) { String msg = I18n.err( I18n.ERR_04267 ); LOG.warn( msg ); throw new LdapException( msg ); } SchemaObject schemaObject = byName.get( oid ); if ( schemaObject != null ) { return schemaObject.getSchemaName(); } String msg = I18n.err( I18n.ERR_04268, oid ); LOG.warn( msg ); throw new LdapException( msg ); }
/** * Retrieve the schema name for a specific SchemaObject, or return "other" if none is found. */ private String getSchemaName( SchemaObject schemaObject ) { String schemaName = StringTools.toLowerCase( schemaObject.getSchemaName() ); if ( StringTools.isEmpty( schemaName ) ) { return MetaSchemaConstants.SCHEMA_OTHER; } if ( schemaLoader.getSchema( schemaName ) == null ) { return null; } else { return schemaName; } }
schemaName = original.getSchemaName();
Set<SchemaObjectWrapper> content = schemaObjects.get( StringTools.toLowerCase( schemaObject.getSchemaName() ) );
copy.getSchemaName() ) ); errors.add( error );