/** * @see Partition#lookup(org.apache.directory.shared.ldap.name.LdapDN,String[]) */ public Attributes lookup( LdapDN dn, String[] attrIds ) throws NamingException { if ( dn.size() == 0 ) { Attributes retval = new LockableAttributesImpl(); NamingEnumeration list = rootDSE.getIDs(); while ( list.hasMore() ) { String id = ( String ) list.next(); Attribute attr = rootDSE.get( id ); retval.put( ( Attribute ) attr.clone() ); } return retval; } Partition backend = getBackend( dn ); return backend.lookup( dn, attrIds ); }
/** * Checks to see if removing a set of attributes from an entry completely removes * that attribute's values. If change has zero size then all attributes are * presumed to be removed. * * @param change * @param entry * @return * @throws NamingException */ private boolean isCompleteRemoval( Attribute change, Attributes entry ) throws NamingException { // if change size is 0 then all values are deleted then we're in trouble if ( change.size() == 0 ) { return true; } // can't do math to figure our if all values are removed since some // values in the modify request may not be in the entry. we need to // remove the values from a cloned version of the attribute and see // if nothing is left. Attribute changedEntryAttr = ( Attribute ) entry.get( change.getID() ).clone(); for ( int jj = 0; jj < change.size(); jj++ ) { changedEntryAttr.remove( change.get( jj ) ); } return changedEntryAttr.size() == 0; }
return AttributeUtils.getUnion( existing, changes ); case ( DirContext.REPLACE_ATTRIBUTE ): return ( Attribute ) changes.clone(); case ( DirContext.REMOVE_ATTRIBUTE ): return AttributeUtils.getDifference( existing, changes );
Attribute ocFinalState = ( Attribute ) subentry.get( "objectClass" ).clone(); if ( modOp == DirContext.ADD_ATTRIBUTE )
if ( opAttr != null ) opAttr = ( Attribute ) opAttr.clone(); opAttr.remove( subentryDn );
if ( opAttr != null ) opAttr = ( Attribute ) opAttr.clone(); opAttr.remove( subentryDn );
throws NamingException { Attribute originalClone = (Attribute) originalAttr.clone(); Attribute addedValuesAttribute = new NameAwareAttribute(originalAttr .getID());
throws NamingException { Attribute originalClone = (Attribute) originalAttr.clone(); Attribute addedValuesAttribute = new NameAwareAttribute(originalAttr .getID());
throws NamingException { Attribute originalClone = (Attribute) originalAttr.clone(); Attribute addedValuesAttribute = new NameAwareAttribute(originalAttr .getID());
throws NamingException { Attribute originalClone = (Attribute) originalAttr.clone(); Attribute addedValuesAttribute = new NameAwareAttribute(originalAttr .getID());
return ( Attribute ) attr0.clone();
objectClass = new BasicAttribute("objectClass", "top"); } else { objectClass = (Attribute)objectClass.clone();
private int getSubentryTypes( Attributes entry, ModificationItemImpl[] mods ) throws NamingException Attribute ocFinalState = ( Attribute ) entry.get( "objectClass" ).clone(); for ( int ii = 0; ii < mods.length; ii++ )
} else { objectClass = (Attribute)objectClass.clone();
} else { objectClass = (Attribute)objectClass.clone();