com.novell.ldap.LDAPConnection.add()方法的使用及代码示例

x33g5p2x  于2022-01-24 转载在 其他  
字(5.2k)|赞(0)|评价(0)|浏览(104)

本文整理了Java中com.novell.ldap.LDAPConnection.add()方法的一些代码示例,展示了LDAPConnection.add()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。LDAPConnection.add()方法的具体详情如下:
包路径:com.novell.ldap.LDAPConnection
类名称:LDAPConnection
方法名:add

LDAPConnection.add介绍

[英]Synchronously adds an entry to the directory.
[中]同步地将条目添加到目录中。

代码示例

代码示例来源:origin: com.novell.ldap/jldap

/**
 * 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;
}

代码示例来源:origin: com.novell.ldap/jldap

/**
 * 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);
}

代码示例来源:origin: com.novell.ldap/jldap

/**
 * 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;
}

代码示例来源:origin: com.novell.ldap/jldap

/**
 *
 * 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;
}

代码示例来源:origin: stackoverflow.com

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",

代码示例来源:origin: com.novell.ldap/jldap

/**
 * 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;
}

代码示例来源:origin: com.novell.ldap/jldap

/**
 * 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);
    }
  }
}

代码示例来源:origin: com.novell.ldap/jldap

/**
 * 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);
    }
  }
}

相关文章