/** * Add an attribute to the entry * * @param attr * The attribute to be added */ public void addAttribute( EntryAttribute attr ) throws LdapException { entry.put( attr ); }
/** * Create a new attributeValue * * @param type The attribute's name */ public void addAttributeValues( String type ) { currentAttributeValue = new DefaultClientAttribute( type ); try { entry.put( currentAttributeValue ); } catch ( LdapException ne ) { // Too bad... But there is nothing we can do. } }
/** * Create a new attributeValue * * @param type The attribute's name (called 'type' in the grammar) */ public void addAttributeType( String type ) throws LdapException { // do not create a new attribute if we have seen this attributeType before if ( entry.get( type ) != null ) { currentAttribute = entry.get( type ); return; } // fix this to use AttributeImpl(type.getString().toLowerCase()) currentAttribute = new DefaultClientAttribute( type ); entry.put( currentAttribute ); }
/** * @return the Names as Ldif lines */ private String nameToLdif() throws NamingException { if ( names.size() == 0 ) { return ""; } else { Entry entry = new DefaultClientEntry(); EntryAttribute attribute = new DefaultClientAttribute( "m-name" ); for ( String name:names ) { attribute.add( name ); } entry.put( attribute ); return LdifUtils.convertAttributesToLdif( entry ); } }
/** * @return The description as a ldif line */ private String descToLdif() throws NamingException { if ( StringTools.isEmpty( description ) ) { return ""; } else { Entry entry = new DefaultClientEntry(); EntryAttribute attribute = new DefaultClientAttribute( "m-description", description ); entry.put( attribute ); return LdifUtils.convertAttributesToLdif( entry ); } }
entry.put( entryAttribute );