attribute.clear(); attribute.add( values.toArray( new byte[values.size()][] ) );
at.clear(); at.add( String.valueOf( stored + 1 ) );
/** * Store the new CSN sent by the consumer in place of the previous one. * * @param replica The consumer informations * @throws Exception If the update failed */ public void updateReplicaLastSentCsn( ReplicaEventLog replica ) throws Exception { Modification mod = modMap.get( replica.getId() ); Attribute lastSentCsnAt = null; if ( mod == null ) { mod = new DefaultModification( ModificationOperation.REPLACE_ATTRIBUTE, adsReplLastSentCsn, replica.getLastSentCsn() ); modMap.put( replica.getId(), mod ); } else { lastSentCsnAt = mod.getAttribute(); lastSentCsnAt.clear(); // clearing is mandatory lastSentCsnAt.add( replica.getLastSentCsn() ); } Dn dn = directoryService.getDnFactory().create( SchemaConstants.ADS_DS_REPLICA_ID + "=" + replica.getId() + "," + replConsumerDn ); adminSession.modify( dn, mod ); LOG.debug( "updated last sent CSN of consumer entry {}", dn ); PROVIDER_LOG.debug( "updated the LastSentCSN of consumer entry {}", dn ); }
private void denormalizeEntryOpAttrs( Entry entry ) throws LdapException { if ( directoryService.isDenormalizeOpAttrsEnabled() ) { Attribute attr = entry.get( SchemaConstants.CREATORS_NAME_AT ); if ( attr != null ) { Dn creatorsName = dnFactory.create( attr.getString() ); attr.clear(); attr.add( denormalizeTypes( creatorsName ).getName() ); } attr = entry.get( SchemaConstants.MODIFIERS_NAME_AT ); if ( attr != null ) { Dn modifiersName = dnFactory.create( attr.getString() ); attr.clear(); attr.add( denormalizeTypes( modifiersName ).getName() ); } attr = entry.get( ApacheSchemaConstants.SCHEMA_MODIFIERS_NAME_AT ); if ( attr != null ) { Dn modifiersName = dnFactory.create( attr.getString() ); attr.clear(); attr.add( denormalizeTypes( modifiersName ).getName() ); } } }
modifiedAdminRole.clear(); break;