if ( lowerLine.startsWith( "control:" ) )
{
if ( containsEntries )
{
LOG.error( I18n.err( I18n.ERR_12004_CHANGE_NOT_ALLOWED ) );
throw new LdapLdifException( I18n.err( I18n.ERR_12005_NO_CHANGE ) );
}
containsChanges = true;
if ( controlSeen )
{
LOG.error( I18n.err( I18n.ERR_12050 ) );
throw new LdapLdifException( I18n.err( I18n.ERR_12051 ) );
}
// Parse the control
// SKIP it
}
else if ( lowerLine.startsWith( "changetype:" ) )
{
if ( containsEntries )
{
LOG.error( I18n.err( I18n.ERR_12004_CHANGE_NOT_ALLOWED ) );
throw new LdapLdifException( I18n.err( I18n.ERR_12005_NO_CHANGE ) );
}
containsChanges = true;
if ( changeTypeSeen )
{
LOG.error( I18n.err( I18n.ERR_12052 ) );
throw new LdapLdifException( I18n.err( I18n.ERR_12053 ) );
}
// A change request
type = CHANGE;
controlSeen = true;
operation = parseChangeType( line );
if ( operation != ChangeType.Add )
{
throw new IllegalArgumentException( "ChangeType " + operation + " is not allowed during bulk load" );
}
// Parse the change operation in a separate function
// SKIP it
while ( iter.hasNext() )
{
iter.next();
}
changeTypeSeen = true;
}
else if ( line.indexOf( ':' ) > 0 )
{
if ( containsChanges )
{
LOG.error( I18n.err( I18n.ERR_12004_CHANGE_NOT_ALLOWED ) );
throw new LdapLdifException( I18n.err( I18n.ERR_12005_NO_CHANGE ) );
}
containsEntries = true;
if ( controlSeen || changeTypeSeen )
{
LOG.error( I18n.err( I18n.ERR_12054 ) );
throw new LdapLdifException( I18n.err( I18n.ERR_12055 ) );
}
// SKIP it
//parseAttributeValue( entry, line, lowerLine );
type = LDIF_ENTRY;
}
else
{
// Invalid attribute Value
LOG.error( I18n.err( I18n.ERR_12056 ) );
throw new LdapLdifException( I18n.err( I18n.ERR_12057_BAD_ATTRIBUTE ) );
}
}
if ( type == LDIF_ENTRY )
{
LOG.debug( "Read an entry : {}", tuple );
}
else if ( type == CHANGE )
{
//entry.setChangeType( operation );
LOG.debug( "Read a modification : {}", tuple );
}
else
{
LOG.error( I18n.err( I18n.ERR_12058_UNKNOWN_ENTRY_TYPE ) );
throw new LdapLdifException( I18n.err( I18n.ERR_12059_UNKNOWN_ENTRY ) );
}
return tuple;
}