* schema depends on
*/
private String[] getSchemaDependencies( Schema schema )
{
Set<String> schemaNames = new HashSet<String>();
SchemaPool schemaPool = SchemaPool.getInstance();
// Looping on Attribute Types
for ( AttributeType at : schema.getAttributeTypesAsArray() )
{
// Superior
String supName = at.getSuperior();
if ( supName != null )
{
AttributeType sup = schemaPool.getAttributeType( supName );
if ( sup != null )
{
if ( !schema.equals( sup.getOriginatingSchema() ) )
{
schemaNames.add( sup.getOriginatingSchema().getName() );
}
}
}
}
// Looping on Object Classes
for ( ObjectClass oc : schema.getObjectClassesAsArray() )
{
// Superiors
for ( String supName : oc.getSuperiors() )
{
ObjectClass sup = schemaPool.getObjectClass( supName );
if ( sup != null )
{
if ( !schema.equals( sup.getOriginatingSchema() ) )
{
schemaNames.add( sup.getOriginatingSchema().getName() );
}
}
}
// Mays
for ( String mayName : oc.getMay() )
{
AttributeType may = schemaPool.getAttributeType( mayName );
if ( may != null )
{
if ( !schema.equals( may.getOriginatingSchema() ) )
{
schemaNames.add( may.getOriginatingSchema().getName() );
}
}
}
// Musts
for ( String mustName : oc.getMust() )
{
AttributeType must = schemaPool.getAttributeType( mustName );
if ( must != null )
{
if ( !schema.equals( must.getOriginatingSchema() ) )
{
schemaNames.add( must.getOriginatingSchema().getName() );