public Entry add( String upId, AttributeType attributeType, String... values ) throws LdapException { return clonedEntry.add( attributeType, values ); }
public Entry add( Attribute... attributes ) throws LdapException { return clonedEntry.add( attributes ); }
public Entry add( String upId, String... values ) throws LdapException { return clonedEntry.add( upId, values ); }
public Entry add( String upId, AttributeType attributeType, Value... values ) throws LdapException { return clonedEntry.add( attributeType, values ); }
public Entry add( String upId, byte[]... values ) throws LdapException { return clonedEntry.add( upId, values ); }
public Entry add( AttributeType attributeType, byte[]... values ) throws LdapException { return clonedEntry.add( attributeType, values ); }
public Entry add( String upId, Value... values ) throws LdapException { return clonedEntry.add( upId, values ); }
public Entry add( AttributeType attributeType, String... values ) throws LdapException { return clonedEntry.add( attributeType, values ); }
public Entry add( AttributeType attributeType, Value... values ) throws LdapException { return clonedEntry.add( attributeType, values ); }
public Entry add( String upId, AttributeType attributeType, byte[]... values ) throws LdapException { return clonedEntry.add( attributeType, values ); }
/** * Given an ldap attribute name and a set of attribute values, construct an ldap attribute set to be added to * directory. * * @param values set of type string containing attribute values to load into attribute set. * @param entry contains ldap entry to pull attrs from. * @param attrName name of ldap attribute being added. * @throws LdapException If we weren't able to add the values into the entry */ protected void loadAttrs( Set<String> values, Entry entry, String attrName ) throws LdapException { if ( ( values != null ) && ( values.size() > 0 ) ) { entry.add( attrName, values.toArray( new String[] {} ) ); } }
@Override public void buildRequest( AddRequest request ) throws LdapException { request.getEntry().add( attributes ); } } );
@Override public void buildRequest( AddRequest request ) throws LdapException { request.getEntry().add( attributes ); } } );
@Override public void buildRequest( AddRequest request ) throws LdapException { request.getEntry().add( attributes ); } } );
/** * add the CSN and UUID attributes to the entry if they are not present */ private void addMandatoryOpAt( Entry entry ) throws LdapException { if ( entry.get( SchemaConstants.ENTRY_CSN_AT ) == null ) { entry.add( SchemaConstants.ENTRY_CSN_AT, defaultCSNFactory.newInstance().toString() ); } if ( entry.get( SchemaConstants.ENTRY_UUID_AT ) == null ) { String uuid = UUID.randomUUID().toString(); entry.add( SchemaConstants.ENTRY_UUID_AT, uuid ); } }
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; }
private void addEntryIfNotExists(CoreSession session, String dnString, String... objectClasses) throws LdapException { final Dn dn = new Dn(dnString); final Rdn rdn = dn.getRdn(); final Entry entryRoda = service.newEntry(dn).add(OBJECT_CLASS, objectClasses).add(rdn.getType(), rdn.getValue()); try { session.add(entryRoda); } catch (LdapEntryAlreadyExistsException e) { LOGGER.debug("Error injecting the context entry for {}: {}", dnString, e.getMessage()); } }
/** * {@inheritDoc} */ @Override public void registerSupportedSaslMechanisms( Set<String> supportedSaslMechanisms ) throws LdapException { Attribute supportedSaslMechanismsAt; supportedSaslMechanismsAt = new DefaultAttribute( schemaManager.lookupAttributeTypeRegistry( SchemaConstants.SUPPORTED_SASL_MECHANISMS_AT ) ); for ( String saslMechanism : supportedSaslMechanisms ) { supportedSaslMechanismsAt.add( saslMechanism ); } rootDse.add( supportedSaslMechanismsAt ); }
/** * Adds attributes to the given Entry which will enable krb5key attributes to be added to them. * * @param entry Entry to add attributes to. * @return The provided entry. */ private Entry kerberize(Entry entry) throws LdapException { // Add csn and uuids for kerberos, this is needed to generate krb5keys. entry.add(SchemaConstants.ENTRY_CSN_AT, new CsnFactory(0).newInstance().toString()); entry.add(SchemaConstants.ENTRY_UUID_AT, UUID.randomUUID().toString()); return entry; }
private void addMemberToRoleOrGroup(final CoreSession session, final String dn, final String memberDN, final String attributeName) throws LdapException { final Entry entry = session.lookup(new Dn(dn), attributeName); Attribute attribute = entry.get(attributeName); if (attribute == null) { entry.add(attributeName, memberDN); attribute = entry.get(attributeName); } else { attribute.add(memberDN); } final ModifyRequestImpl modifyRequestImpl = new ModifyRequestImpl(); modifyRequestImpl.setName(entry.getDn()); modifyRequestImpl.replace(attribute); session.modify(modifyRequestImpl); }