* @return Attributes
* @throws LdapException
*/
public ServerEntry getAttributes( AttributeType attributeType, Schema schema, SchemaManager schemaManager ) throws LdapException
{
ServerEntry entry = new DefaultServerEntry( schemaManager );
entry.put( SchemaConstants.OBJECT_CLASS_AT, SchemaConstants.TOP_OC, MetaSchemaConstants.META_ATTRIBUTE_TYPE_OC );
entry.put( MetaSchemaConstants.M_SYNTAX_AT, attributeType.getSyntaxOid() );
entry.put( MetaSchemaConstants.M_COLLECTIVE_AT, getBoolean( attributeType.isCollective() ) );
entry.put( MetaSchemaConstants.M_NO_USER_MODIFICATION_AT, getBoolean( ! attributeType.isUserModifiable() ) );
entry.put( MetaSchemaConstants.M_SINGLE_VALUE_AT, getBoolean( attributeType.isSingleValued() ) );
entry.put( MetaSchemaConstants.M_USAGE_AT, attributeType.getUsage().toString() );
entry.put( SchemaConstants.CREATORS_NAME_AT, schema.getOwner() );
entry.put( SchemaConstants.CREATE_TIMESTAMP_AT, DateUtils.getGeneralizedTime() );
injectCommon( attributeType, entry, schemaManager );
String superiorOid = attributeType.getSuperiorOid();
if ( superiorOid != null )
{
entry.put( MetaSchemaConstants.M_SUP_ATTRIBUTE_TYPE_AT, superiorOid );
}
if ( attributeType.getEqualityOid() != null )
{
entry.put( MetaSchemaConstants.M_EQUALITY_AT, attributeType.getEqualityOid() );
}
if ( attributeType.getSubstringOid() != null )
{
entry.put( MetaSchemaConstants.M_SUBSTR_AT, attributeType.getSubstringOid() );
}
if ( attributeType.getOrderingOid() != null )
{
entry.put( MetaSchemaConstants.M_ORDERING_AT, attributeType.getOrderingOid() );
}
return entry;
}