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

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

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

LDAPConnection.disconnect介绍

[英]Synchronously disconnects from the LDAP server.

Before the object can perform LDAP operations again, it must reconnect to the server by calling connect.

The disconnect method abandons any outstanding requests, issues an unbind request to the server, and then closes the socket.
[中]同步断开与LDAP服务器的连接。
在对象可以再次执行LDAP操作之前,它必须通过调用connect重新连接到服务器。
disconnect方法放弃任何未完成的请求,向服务器发出解除绑定请求,然后关闭套接字。

代码示例

代码示例来源:origin: glyptodon/guacamole-client

/**
 * Disconnects the given LDAP connection, logging any failure to do so
 * appropriately.
 *
 * @param ldapConnection
 *     The LDAP connection to disconnect.
 */
public void disconnect(LDAPConnection ldapConnection) {
  // Attempt disconnect
  try {
    ldapConnection.disconnect();
  }
  // Warn if disconnect unexpectedly fails
  catch (LDAPException e) {
    logger.warn("Unable to disconnect from LDAP server: {}", e.getMessage());
    logger.debug("LDAP disconnect failed.", e);
  }
}

代码示例来源:origin: neo4j-contrib/neo4j-apoc-procedures

public static void closeIt(LDAPConnection lc) {
  try {
    lc.disconnect();
  } catch (Exception e) {
    // ignore
    e.printStackTrace();
  }
}

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

/**
 * Closes the connection, if open, and releases any other resources held
 * by the object.
 *
 * @exception LDAPException A general exception which includes an error
 * message and an LDAP error code.
 *
 * @see #disconnect
 */
protected void finalize()
  throws LDAPException
{
  // Disconnect did not come from user API call
  disconnect(defSearchCons, false);
  return;
}

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

/**
 * Synchronously disconnects from the LDAP server.
 *
 * <p>Before the object can perform LDAP operations again, it must
 * reconnect to the server by calling connect.</p>
 *
 * <p>The disconnect method abandons any outstanding requests, issues an
 * unbind request to the server, and then closes the socket.</p>
 *
 * @param cons LDPConstraints to be set with the unbind request
 *
 * @exception LDAPException A general exception which includes an error
 *  message and an LDAP error code.
 */
public void disconnect( LDAPConstraints cons)
  throws LDAPException
{
  // disconnect from API call
  disconnect(cons, true);
  return;
}

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

/**
 *
 * Synchronously disconnects from the LDAP server.
 *
 * <p>Before the object can perform LDAP operations again, it must
 * reconnect to the server by calling connect.</p>
 *
 * <p>The disconnect method abandons any outstanding requests, issues an
 * unbind request to the server, and then closes the socket.</p>
 *
 * @exception LDAPException A general exception which includes an error
 *  message and an LDAP error code.
 *
 */
public void disconnect()
  throws LDAPException
{
  // disconnect from API call
  disconnect( defSearchCons, true);
  return;
}

代码示例来源:origin: sakaiproject/sakai

/**
 * {@inheritDoc}
 */
public void returnConnection(LDAPConnection conn) {
  try {
    if (conn != null)
      conn.disconnect();
  } catch (LDAPException e) {
    log.error("returnConnection(): failed on disconnect: ", e);
  }
}

代码示例来源:origin: org.xwiki.platform/xwiki-platform-ldap-authenticator

/**
 * Close LDAP connection.
 */
public void close()
{
  try {
    if (this.connection != null) {
      this.connection.disconnect();
    }
  } catch (LDAPException e) {
    LOGGER.debug("LDAP close failed.", e);
  }
}

代码示例来源:origin: com.xpn.xwiki.platform/xwiki-core

/**
 * Close LDAP connection.
 */
public void close()
{
  try {
    if (this.connection != null) {
      this.connection.disconnect();
    }
  } catch (LDAPException e) {
    if (LOG.isDebugEnabled()) {
      LOG.debug("LDAP close failed.", e);
    }
  }
}

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

/**
 * Synchronously disconnects from the LDAP server.
 *
 * @see <a href="../../../../api/com/novell/ldap/LDAPConnection.html#disconnect()">
    com.novell.ldap.LDAPConnection.disconnect()</a>
 */
public void disconnect()
  throws LDAPException
{
  try {
    conn.disconnect();
  } catch( com.novell.ldap.LDAPException ex) {
    throw new LDAPException( ex);
  }
  return;
}

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

/**
 * Closes the connection, if open, and releases any other resources held
 * by the object.
 *
 * @see <a href="../../../../api/com/novell/ldap/LDAPConnection.html#finalize()">
    com.novell.ldap.LDAPConnection.finalize()</a>
 */
protected void finalize()
  throws LDAPException
{
  try {
    conn.disconnect();
  } catch ( com.novell.ldap.LDAPException ex) {
    throw new LDAPException( ex);
  }
  return;
}

代码示例来源:origin: pwm-project/pwm

public void close( )
{
  if ( this.ldapConnection != null )
  {
    try
    {
      this.ldapConnection.disconnect();
    }
    catch ( LDAPException e )
    {
      LOGGER.error( "error closing ldap connection: " + e.getMessage(), e );
    }
    this.ldapConnection = null;
  }
}

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

/**
 * Synchronously disconnects from the LDAP server, including
 * constraints to send with the unbind request.
 *
 * @see <a href="../../../../api/com/novell/ldap/LDAPConnection.html#disconnect(com.novell.ldap.LDAPConstraints)">
    com.novell.ldap.LDAPConnection.disconnect(LDAPConstraints)</a>
 */
public void disconnect( LDAPConstraints cons)
  throws LDAPException
{
  try {
    conn.disconnect( cons.getWrappedObject());
  } catch( com.novell.ldap.LDAPException ex) {
    throw new LDAPException( ex);
  }
  return;
}

代码示例来源:origin: com.bbossgroups.pdp/pdp-ldap

if (lc.isConnected()) {
  try {
    lc.disconnect();
  } catch (LDAPException e) {
    e.printStackTrace();

代码示例来源:origin: sakaiproject/sakai

config.getLdapPort() + "]", e);
try {
  conn.disconnect();
} catch ( LDAPException ee ) {}
    config.getLdapPort() + "]", e);
try {
  conn.disconnect();
} catch ( LDAPException ee ) {}

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

rconn.getConnectionName());
  rconn.disconnect();
} catch( ArrayIndexOutOfBoundsException ex) {
  if( Debug.LDAP_DEBUG) {

代码示例来源:origin: OpenNMS/opennms

} catch (LDAPException e) {
    try {
      lc.disconnect();
    } catch (LDAPException ex) {
      LOG.debug(ex.getMessage());
    lc.disconnect();
  } catch (LDAPException ex) {
    LOG.debug(ex.getMessage());
  lc.disconnect();
  LOG.debug("disconected from LDAP server {} on port {}", address, ldapPort);
} catch (LDAPException e) {

代码示例来源:origin: com.bbossgroups.pdp/pdp-ldap

if (lc.isConnected()) {
  try {
    lc.disconnect();
  } catch (LDAPException e) {
    e.printStackTrace();

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

Debug.trace( Debug.apiRequests, "read: disconnect()");
lconn.disconnect();
return toReturn;

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

Debug.trace( Debug.apiRequests, "read: disconnect()");
lconn.disconnect();
return toReturn;

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

toGet.getScope(), toGet.getFilter(), toGet.getAttributeArray(),
    false, cons);
lconn.disconnect();
return toReturn;

相关文章