/** * {@inheritDoc} */ @Override public DefaultModification clone() { try { DefaultModification clone = ( DefaultModification ) super.clone(); clone.attribute = this.attribute.clone(); return clone; } catch ( CloneNotSupportedException cnse ) { return null; } }
/** * {@inheritDoc} */ @Override public DefaultModification clone() { try { DefaultModification clone = ( DefaultModification ) super.clone(); clone.attribute = this.attribute.clone(); return clone; } catch ( CloneNotSupportedException cnse ) { return null; } }
/** * {@inheritDoc} */ @Override public DefaultModification clone() { try { DefaultModification clone = ( DefaultModification ) super.clone(); clone.attribute = this.attribute.clone(); return clone; } catch ( CloneNotSupportedException cnse ) { return null; } }
public Entry toClientEntry() throws LdapException { // Copy the Dn Entry clientEntry = new DefaultEntry( clonedEntry.getDn() ); // Convert each attribute for ( Attribute clonedEntry : this ) { Attribute clientAttribute = clonedEntry.clone(); clientEntry.add( clientAttribute ); } return clientEntry; }
Attribute newOperationalAttribute = operationalAttribute.clone();
/** * Update the list of modifications with a modification associated with a specific * role, if it's requested. */ private void getOperationalModForReplace( boolean hasRole, AttributeType attributeType, Entry entry, Dn oldDn, Dn newDn, List<Modification> modifications ) throws LdapInvalidAttributeValueException { String oldDnStr = oldDn.getName(); String newDnStr = newDn.getName(); if ( hasRole ) { Attribute operational = entry.get( attributeType ).clone(); if ( operational == null ) { operational = new DefaultAttribute( attributeType, newDnStr ); } else { operational.remove( oldDnStr ); operational.add( newDnStr ); } modifications.add( new DefaultModification( ModificationOperation.REPLACE_ATTRIBUTE, operational ) ); } }
clientEntry.add( attribute.clone() );
private Set<AdministrativeRole> getSubentryTypes( Entry entry, List<Modification> mods ) throws LdapException Attribute ocFinalState = entry.get( directoryService.getAtProvider().getObjectClass() ).clone();
ldif.addAttribute( addEntry.get( attributeType ).clone() );
opAttr = opAttr.clone(); opAttr.remove( subentryDn.getName() );
Attribute combined = mod.getAttribute().clone(); Attribute toBeAdded = mod.getAttribute(); Attribute existing = entry.get( id );
Attribute combined = mod.getAttribute().clone(); Attribute toBeAdded = mod.getAttribute(); Attribute existing = entry.get( id );
/** * {@inheritDoc} */ @Override public void add( AddOperationContext addContext ) throws LdapException { next( addContext ); if ( !changeLog.isEnabled() ) { return; } Entry addEntry = addContext.getEntry(); // we don't want to record addition of a tag as a change if ( addEntry.get( REV_AT_OID ) != null ) { return; } LdifEntry forward = new LdifEntry(); forward.setChangeType( ChangeType.Add ); forward.setDn( addContext.getDn() ); for ( Attribute attribute : addEntry.getAttributes() ) { AttributeType attributeType = attribute.getAttributeType(); forward.addAttribute( addEntry.get( attributeType ).clone() ); } LdifEntry reverse = LdifRevertor.reverseAdd( addContext.getDn() ); addContext.setChangeLogEvent( changeLog.log( getPrincipal( addContext ), forward, reverse ) ); }
reverseEntry.add( attribute.clone() );