if ( !uuidChecker.isValidSyntax( uuid ) )
{
uuidAt = new DefaultAttribute( atType, UUID.randomUUID().toString() );
}
Modification uuidMod = new DefaultModification( ModificationOperation.REPLACE_ATTRIBUTE, uuidAt );
mods.add( uuidMod );
atType = MANDATORY_ENTRY_ATOP_MAP.get( SchemaConstants.ENTRY_CSN_AT ).getAttributeType();
Attribute csnAt = entry.get( atType );
String csn = ( csnAt == null ? null : csnAt.getString() );
if ( !csnChecker.isValidSyntax( csn ) )
{
csnAt = new DefaultAttribute( atType, dirService.getCSN().toString() );
}
Modification csnMod = new DefaultModification( ModificationOperation.REPLACE_ATTRIBUTE, csnAt );
mods.add( csnMod );
atType = MANDATORY_ENTRY_ATOP_MAP.get( SchemaConstants.CREATORS_NAME_AT ).getAttributeType();
Attribute creatorAt = entry.get( atType );
String creator = ( creatorAt == null ? "" : creatorAt.getString().trim() );
if ( ( creator.length() == 0 ) || ( !Dn.isValid( creator ) ) )
{
creatorAt = new DefaultAttribute( atType, adminDn );
}
Modification creatorMod = new DefaultModification( ModificationOperation.REPLACE_ATTRIBUTE, creatorAt );
mods.add( creatorMod );
atType = MANDATORY_ENTRY_ATOP_MAP.get( SchemaConstants.CREATE_TIMESTAMP_AT ).getAttributeType();
Attribute createdTimeAt = entry.get( atType );
String createdTime = ( createdTimeAt == null ? null : createdTimeAt.getString() );
if ( !timeChecker.isValidSyntax( createdTime ) )
{
createdTimeAt = new DefaultAttribute( atType, DateUtils.getGeneralizedTime() );
}
Modification createdMod = new DefaultModification( ModificationOperation.REPLACE_ATTRIBUTE, createdTimeAt );
mods.add( createdMod );
if ( !mods.isEmpty() )
{
LOG.debug( "modifying the entry {} after adding missing manadatory operational attributes",