/** * Synchronously adds an entry to the directory. * * @param entry LDAPEntry object specifying the distinguished * name and attributes of the new entry. * * @exception LDAPException A general exception which includes an error * message and an LDAP error code. */ public void add(LDAPEntry entry) throws LDAPException { add(entry, defSearchCons); return; }
/** * Asynchronously adds an entry to the directory. * * @param entry LDAPEntry object specifying the distinguished * name and attributes of the new entry. *<br><br> * @param queue Handler for messages returned from a server in * response to this request. If it is null, a * queue object is created internally. * * @exception LDAPException A general exception which includes an error * message and an LDAP error code. */ public LDAPResponseQueue add(LDAPEntry entry, LDAPResponseQueue queue) throws LDAPException { return add(entry, queue, defSearchCons); }
/** * Synchronously adds an entry to the directory. * * @see <a href="../../../../api/com/novell/ldap/LDAPConnection.html#add(com.novell.ldap.LDAPEntry)"> com.novell.ldap.LDAPConnection.add(LDAPEntry)</a> */ public void add(LDAPEntry entry) throws LDAPException { try { conn.add( entry.getWrappedObject()); } catch( com.novell.ldap.LDAPException ex) { if( ex instanceof com.novell.ldap.LDAPReferralException) { throw new LDAPReferralException( (com.novell.ldap.LDAPReferralException)ex); } else { throw new LDAPException( ex); } } return; }
/** * * Synchronously adds an entry to the directory, using the specified * constraints. * * @param entry LDAPEntry object specifying the distinguished * name and attributes of the new entry. *<br><br> * @param cons Constraints specific to the operation. * * @exception LDAPException A general exception which includes an error * message and an LDAP error code. */ public void add(LDAPEntry entry, LDAPConstraints cons) throws LDAPException { LDAPResponseQueue queue = add(entry, null, cons); // Get a handle to the add response LDAPResponse addResponse = (LDAPResponse)(queue.getResponse()); // Set local copy of responseControls synchronously if there were any synchronized (responseCtlSemaphore) { responseCtls = addResponse.getControls(); } chkResultCode( queue, cons, addResponse); return; }
final LDAPConnection conn2 = ds2.getConnection(opts); conn1.add( "dn: dc=example,dc=com", "objectClass: top", "objectClass: domain", "dc: example"); conn1.add( "dn: ou=Referral Entry,dc=example,dc=com", "objectClass: top", "description: This is a referral entry"); conn2.add( "dn: dc=example,dc=com", "objectClass: top", "objectClass: domain", "dc: example"); conn2.add( "dn: ou=Referral Entry,dc=example,dc=com", "objectClass: top",
/** * Synchronously adds an entry to the directory, using the specified * constraints. * * @see <a href="../../../../api/com/novell/ldap/LDAPConnection.html#add(com.novell.ldap.LDAPEntry, com.novell.ldap.LDAPConstraints)"> com.novell.ldap.LDAPConnection.add(LDAPEntry, LDAPConstraints)</a> */ public void add(LDAPEntry entry, LDAPConstraints cons) throws LDAPException { try { conn.add( entry.getWrappedObject(), cons.getWrappedObject()); } catch( com.novell.ldap.LDAPException ex) { if( ex instanceof com.novell.ldap.LDAPReferralException) { throw new LDAPReferralException( (com.novell.ldap.LDAPReferralException)ex); } else { throw new LDAPException( ex); } } return; }
/** * Asynchronously adds an entry to the directory. * * @see <a href="../../../../api/com/novell/ldap/LDAPConnection.html#add(com.novell.ldap.LDAPEntry, com.novell.ldap.LDAPResponseQueue)"> com.novell.ldap.LDAPConnection.add(LDAPEntry, LDAPResponseQueue)</a> */ public LDAPResponseQueue add(LDAPEntry entry, LDAPResponseQueue queue) throws LDAPException { try { return new LDAPResponseQueue( conn.add( entry.getWrappedObject(), queue.getWrappedObject())); } catch( com.novell.ldap.LDAPException ex) { if( ex instanceof com.novell.ldap.LDAPReferralException) { throw new LDAPReferralException( (com.novell.ldap.LDAPReferralException)ex); } else { throw new LDAPException( ex); } } }
/** * Asynchronously adds an entry to the directory, using the specified * constraints. * * @see <a href="../../../../api/com/novell/ldap/LDAPConnection.html#add(com.novell.ldap.LDAPEntry, com.novell.ldap.LDAPResponseQueue, com.novell.ldap.LDAPConstraints)"> com.novell.ldap.LDAPConnection.add(LDAPEntry, LDAPResponseQueue, LDAPConstraints)</a> */ public LDAPResponseQueue add(LDAPEntry entry, LDAPResponseQueue queue, LDAPConstraints cons) throws LDAPException { try { return new LDAPResponseQueue( conn.add( entry.getWrappedObject(), queue.getWrappedObject(), cons.getWrappedObject())); } catch( com.novell.ldap.LDAPException ex) { if( ex instanceof com.novell.ldap.LDAPReferralException) { throw new LDAPReferralException( (com.novell.ldap.LDAPReferralException)ex); } else { throw new LDAPException( ex); } } }