/** * Remove attribute. */ @Override public Attribute remove(String attrID) { if (attributes == null) { return null; // No reason to implement this } else { return attributes.remove(attrID); } }
/** * Remove attribute. */ public Attribute remove(String attrID) { if (attributes == null) { return null; // No reason to implement this } else { return attributes.remove(attrID); } }
/** * Remove attribute. */ @Override public Attribute remove(String attrID) { if (attributes == null) { return null; // No reason to implement this } else { return attributes.remove(attrID); } }
/** * Remove attribute. */ public Attribute remove(String attrID) { if (attributes == null) { return null; // No reason to implement this } else { return attributes.remove(attrID); } }
/** * Remove attribute. */ @Override public Attribute remove(String attrID) { if (attributes == null) { return null; // No reason to implement this } else { return attributes.remove(attrID); } }
/** * Remove attribute. */ @Override public Attribute remove(String attrID) { if (attributes == null) { return null; // No reason to implement this } else { return attributes.remove(attrID); } }
/** * Remove attribute. */ @Override public Attribute remove(String attrID) { if (attributes == null) { return null; // No reason to implement this } else { return attributes.remove(attrID); } }
private String getAttribute(Attributes attrs, String key) throws NamingException { Attribute attr = attrs.remove(key); return attr != null ? (String) attr.get() : ""; }
private String getUUIDAttribute(Attributes attrs, String key) throws NamingException { Attribute attr = attrs.remove(key); byte[] guid = attr != null ? (byte[]) attr.get() : "".getBytes(); return new String(guid); }
private List<String> getAttrList(Attributes attrs, String key) throws NamingException { List<String> vals = new ArrayList<>(); Attribute attr = attrs.remove(key); if (attr == null) { return vals; } NamingEnumeration a = attr.getAll(); while (a.hasMore()) { vals.add((String) a.next()); } return vals; }
public static Attribute removeAttribute( AttributeType type, Attributes entry ) throws NamingException { Attribute attr = entry.get( type.getOid() ); if ( attr == null ) { String[] aliases = type.getNames(); for ( int ii = 0; ii < aliases.length; ii++ ) { attr = entry.get( aliases[ii] ); if ( attr != null ) { return entry.remove( attr.getID() ); } } } if ( attr == null ) { return null; } return entry.remove( attr.getID() ); } }
/** * Correctly removes an attribute from an entry using it's attributeType information. * * @param type the attributeType of the attribute to remove * @param entry the entry to remove the attribute from * @return the Attribute that is removed */ public static Attribute removeAttribute( AttributeType type, Attributes entry ) { Attribute attr = entry.get( type.getOid() ); if ( attr == null ) { List<String> aliases = type.getNames(); for ( String alias : aliases ) { attr = entry.get( alias ); if ( attr != null ) { return entry.remove( attr.getID() ); } } } if ( attr == null ) { return null; } return entry.remove( attr.getID() ); }
@Override public void removeAttribute(String name) { getLDAPAttributes().remove(name); getCustomAttributes().removeAttribute(name); }
entry.remove( attrId );
private void filterObjectClass( Attributes entry ) throws NamingException { List objectClasses = new ArrayList(); Attribute oc = entry.get( "objectClass" ); if ( oc != null ) { getObjectClasses( oc, objectClasses ); entry.remove( "objectClass" ); Attribute newOc = new LockableAttributeImpl( "objectClass" ); for ( int i = 0; i < objectClasses.size(); i++ ) { Object currentOC = objectClasses.get(i); if ( currentOC instanceof String ) { newOc.add( currentOC ); } else { newOc.add( ( (ObjectClass)currentOC ).getName() ); } } newOc.add( "top" ); entry.put( newOc ); } }
/** * Filters out the operational attributes within a search results attributes. The attributes are directly * modified. * * @param attributes the resultant attributes to filter * @return true always */ private boolean filter( Attributes attributes ) throws NamingException { NamingEnumeration list = attributes.getIDs(); while ( list.hasMore() ) { String attrId = ( String ) list.next(); AttributeType type = null; if ( registry.hasAttributeType( attrId ) ) { type = registry.lookup( attrId ); } if ( type != null && type.getUsage() != UsageEnum.USERAPPLICATIONS ) { // just make sure we do not remove the ref attribute if ( ! type.getOid().equals( refAttrOid.getOid() ) ) { attributes.remove( attrId ); } } } return true; }
public void update() { NamingEnumeration attributesEnumeration = null; try { attributesEnumeration = updatedAttrs.getAll(); // find what to update while (attributesEnumeration.hasMore()) { Attribute a = (Attribute) attributesEnumeration.next(); // if it does not exist it should be added if (isEmptyAttribute(a)) { attrs.remove(a.getID()); } else { // Otherwise it should be set. attrs.put(a); } } } catch (NamingException e) { throw getExceptionTranslator().translate(e); } finally { closeNamingEnumeration(attributesEnumeration); } // Reset the attributes to be updated updatedAttrs = new BasicAttributes(true); }
public void update() { NamingEnumeration attributesEnumeration = null; try { attributesEnumeration = updatedAttrs.getAll(); // find what to update while (attributesEnumeration.hasMore()) { Attribute a = (Attribute) attributesEnumeration.next(); // if it does not exist it should be added if (isEmptyAttribute(a)) { attrs.remove(a.getID()); } else { // Otherwise it should be set. attrs.put(a); } } } catch (NamingException e) { throw getExceptionTranslator().translate(e); } finally { closeNamingEnumeration(attributesEnumeration); } // Reset the attributes to be updated updatedAttrs = new BasicAttributes(true); }
entry.remove( id ); entry.put( binary );
attrs.put("userAccountControl", Integer.toString(UF_NORMAL_ACCOUNT + UF_PASSWD_NOTREQD + UF_PASSWORD_EXPIRED + UF_ACCOUNTDISABLE)); attrs.remove(ldapAttrMapping.userPassword); LdapContext ctx = ldapService.getLdapContext(); try