/** * Add a modification item (used by modify operations) * * @param modification The modification to be added */ public void addModification( Modification modification ) { if ( changeType == ChangeType.Modify ) { modificationList.add( modification ); modifications.put( modification.getAttribute().getId(), modification ); } }
/** * Add a modification item (used by modify operations) * * @param modification The modification to be added */ public void addModification( Modification modification ) { if ( changeType == ChangeType.Modify ) { modificationList.add( modification ); modifications.put( modification.getAttribute().getId(), modification ); } }
/** * Add a modification item (used by modify operations) * * @param modification The modification to be added */ public void addModification( Modification modification ) { if ( changeType == ChangeType.Modify ) { modificationList.add( modification ); modifications.put( modification.getAttribute().getId(), modification ); } }
/** * @see Object#equals(Object) * @return <code>true</code> if both values are equal */ @Override public boolean equals( Object that ) { // Basic equals checks if ( this == that ) { return true; } if ( !( that instanceof Modification ) ) { return false; } Modification otherModification = ( Modification ) that; // Check the operation if ( operation != otherModification.getOperation() ) { return false; } // Check the attribute if ( attribute == null ) { return otherModification.getAttribute() == null; } return attribute.equals( otherModification.getAttribute() ); }
/** * @see Object#equals(Object) * @return <code>true</code> if both values are equal */ @Override public boolean equals( Object that ) { // Basic equals checks if ( this == that ) { return true; } if ( !( that instanceof Modification ) ) { return false; } Modification otherModification = ( Modification ) that; // Check the operation if ( operation != otherModification.getOperation() ) { return false; } // Check the attribute if ( attribute == null ) { return otherModification.getAttribute() == null; } return attribute.equals( otherModification.getAttribute() ); }
/** * Utility method to extract an attribute from a list of modifications. * * @param mods the list of ModificationItems to extract the Attribute from. * @param type the attributeType spec of the Attribute to extract * @return the extract Attribute or null if no such attribute exists */ public static Attribute getAttribute( List<Modification> mods, AttributeType type ) { Modification mod = getModificationItem( mods, type ); if ( mod != null ) { return mod.getAttribute(); } return null; }
/** * @see Object#equals(Object) * @return <code>true</code> if both values are equal */ @Override public boolean equals( Object that ) { // Basic equals checks if ( this == that ) { return true; } if ( !( that instanceof Modification ) ) { return false; } Modification otherModification = ( Modification ) that; // Check the operation if ( operation != otherModification.getOperation() ) { return false; } // Check the attribute if ( attribute == null ) { return otherModification.getAttribute() == null; } return attribute.equals( otherModification.getAttribute() ); }
/** * Utility method to extract a modification item from an array of modifications. * * @param mods the array of ModificationItems to extract the Attribute from. * @param type the attributeType spec of the Attribute to extract * @return the modification item on the attributeType specified */ public static Modification getModificationItem( List<Modification> mods, AttributeType type ) { for ( Modification modification : mods ) { Attribute attribute = modification.getAttribute(); if ( attribute.getAttributeType() == type ) { return modification; } } return null; }
modif.getAttribute().clone() ); clone.modificationList.add( modifClone ); modif.getAttribute().clone() ); clone.modifications.put( modificationEntry.getKey(), modifClone );
modif.getAttribute().clone() ); clone.modificationList.add( modifClone ); modif.getAttribute().clone() ); clone.modifications.put( modificationEntry.getKey(), modifClone );
/** * Convert a Modification to an instance of a ServerModification object. * * @param modificationImpl the modification instance to convert * @param attributeType the associated attributeType * @return a instance of a ServerModification object */ private static Modification toServerModification( Modification modification, AttributeType attributeType ) throws LdapException { Modification serverModification = new DefaultModification( modification.getOperation(), new DefaultAttribute( attributeType, modification.getAttribute() ) ); return serverModification; }
/** * {@inheritDoc} */ @Override public void modify( ModifyOperationContext modifyContext ) throws LdapException { if ( algorithm == null ) { next( modifyContext ); return; } List<Modification> mods = modifyContext.getModItems(); for ( Modification mod : mods ) { Attribute attribute = mod.getAttribute(); if ( attributeTypes.contains( attribute.getAttributeType() ) ) { includeHashed( attribute ); } } next( modifyContext ); } }
/** * 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 ); }
/** * Creates a new instance of DefaultModification. * * @param schemaManager The schema manager * @param modification The modification */ public DefaultModification( SchemaManager schemaManager, Modification modification ) { operation = modification.getOperation(); Attribute modAttribute = modification.getAttribute(); try { AttributeType at = modAttribute.getAttributeType(); if ( at == null ) { at = schemaManager.lookupAttributeTypeRegistry( modAttribute.getId() ); } attribute = new DefaultAttribute( at, modAttribute ); } catch ( LdapException ne ) { // The attributeType is incorrect. Log, but do nothing otherwise. LOG.error( I18n.err( I18n.ERR_13230_INCORRECT_ATTRIBUTE, modAttribute.getId() ) ); } }
/** * Creates a new instance of DefaultModification. * * @param schemaManager The schema manager * @param modification The modification */ public DefaultModification( SchemaManager schemaManager, Modification modification ) { operation = modification.getOperation(); Attribute modAttribute = modification.getAttribute(); try { AttributeType at = modAttribute.getAttributeType(); if ( at == null ) { at = schemaManager.lookupAttributeTypeRegistry( modAttribute.getId() ); } attribute = new DefaultAttribute( at, modAttribute ); } catch ( LdapException ne ) { // The attributeType is incorrect. Log, but do nothing otherwise. LOG.error( I18n.err( I18n.ERR_13230_INCORRECT_ATTRIBUTE, modAttribute.getId() ) ); } }
/** * Creates a new instance of DefaultModification. * * @param schemaManager The schema manager * @param modification The modification */ public DefaultModification( SchemaManager schemaManager, Modification modification ) { operation = modification.getOperation(); Attribute modAttribute = modification.getAttribute(); try { AttributeType at = modAttribute.getAttributeType(); if ( at == null ) { at = schemaManager.lookupAttributeTypeRegistry( modAttribute.getId() ); } attribute = new DefaultAttribute( at, modAttribute ); } catch ( LdapException ne ) { // The attributeType is incorrect. Log, but do nothing otherwise. LOG.error( I18n.err( I18n.ERR_13230_INCORRECT_ATTRIBUTE, modAttribute.getId() ) ); } }
public void subentryModified( ModifyOperationContext opContext, Entry entry ) throws LdapException { if ( !hasPrescriptiveTrigger( entry ) ) { return; } Dn normName = opContext.getDn(); List<Modification> mods = opContext.getModItems(); boolean isTriggerSpecModified = false; for ( Modification mod : mods ) { isTriggerSpecModified |= mod.getAttribute().contains( PRESCRIPTIVE_TRIGGER_ATTR ); } if ( isTriggerSpecModified ) { subentryDeleted( normName, entry ); subentryAdded( normName, entry ); } }
Attribute attr = mod.getAttribute(); AttributeType attrType = attr.getAttributeType();
/** * Proceed with the Modification operation when the PasswordPolicy is not activated. */ private void processStandardModify( ModifyOperationContext modifyContext ) throws LdapException { next( modifyContext ); List<Modification> modifications = modifyContext.getModItems(); for ( Modification modification : modifications ) { if ( directoryService.getAtProvider().getUserPassword() .equals( modification.getAttribute().getAttributeType() ) ) { invalidateAuthenticatorCaches( modifyContext.getDn() ); break; } } return; }
Attribute attribute = disabledModification.getAttribute();