com.unboundid.ldap.sdk.LDAPConnection.getConnectionOptions()方法的使用及代码示例

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

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

LDAPConnection.getConnectionOptions介绍

[英]Retrieves the set of connection options for this connection. Changes to the object that is returned will directly impact this connection.
[中]检索此连接的连接选项集。对返回对象的更改将直接影响此连接。

代码示例

代码示例来源:origin: com.unboundid/unboundid-ldapsdk-commercial-edition

/**
 * {@inheritDoc}
 */
public final long getResponseTimeoutMillis(final LDAPConnection connection)
{
 if ((responseTimeout < 0L) && (connection != null))
 {
  return connection.getConnectionOptions().getResponseTimeoutMillis();
 }
 else
 {
  return responseTimeout;
 }
}

代码示例来源:origin: com.unboundid/unboundid-ldapsdk-minimal-edition

/**
 * {@inheritDoc}
 */
public final long getResponseTimeoutMillis(final LDAPConnection connection)
{
 if ((responseTimeout < 0L) && (connection != null))
 {
  return connection.getConnectionOptions().getResponseTimeoutMillis();
 }
 else
 {
  return responseTimeout;
 }
}

代码示例来源:origin: com.unboundid/unboundid-ldapsdk-commercial-edition

/**
 * Indicates whether to automatically follow any referrals encountered while
 * processing this request.  If a value has been set for this request, then it
 * will be returned.  Otherwise, the default from the connection options for
 * the provided connection will be used.
 *
 * @param  connection  The connection whose connection options may be used in
 *                     the course of making the determination.  It must not
 *                     be {@code null}.
 *
 * @return  {@code true} if any referrals encountered during processing should
 *          be automatically followed, or {@code false} if not.
 */
public final boolean followReferrals(final LDAPConnection connection)
{
 if (followReferrals == null)
 {
  return connection.getConnectionOptions().followReferrals();
 }
 else
 {
  return followReferrals;
 }
}

代码示例来源:origin: com.unboundid/unboundid-ldapsdk-commercial-edition

/**
 * Retrieves the maximum length of time to wait for the connection to be
 * established, in seconds.
 *
 * @return  The maximum length of time to wait for the connection to be
 *          established.
 */
public int getConnectTimeout()
{
 final int connectTimeoutMillis =
    conn.getConnectionOptions().getConnectTimeoutMillis();
 if (connectTimeoutMillis > 0)
 {
  return Math.max(1, (connectTimeoutMillis / 1000));
 }
 else
 {
  return 0;
 }
}

代码示例来源:origin: com.unboundid/unboundid-ldapsdk-minimal-edition

/**
 * Indicates whether to automatically follow any referrals encountered while
 * processing this request.  If a value has been set for this request, then it
 * will be returned.  Otherwise, the default from the connection options for
 * the provided connection will be used.
 *
 * @param  connection  The connection whose connection options may be used in
 *                     the course of making the determination.  It must not
 *                     be {@code null}.
 *
 * @return  {@code true} if any referrals encountered during processing should
 *          be automatically followed, or {@code false} if not.
 */
public final boolean followReferrals(final LDAPConnection connection)
{
 if (followReferrals == null)
 {
  return connection.getConnectionOptions().followReferrals();
 }
 else
 {
  return followReferrals;
 }
}

代码示例来源:origin: com.unboundid/unboundid-ldapsdk-commercial-edition

/**
 * Notifies the disconnect handler that the associated connection has been
 * closed.
 */
void notifyDisconnectHandler()
{
 final boolean alreadyNotified = handlerNotified.getAndSet(true);
 if (alreadyNotified)
 {
  return;
 }
 final DisconnectHandler handler =
    connection.getConnectionOptions().getDisconnectHandler();
 if (handler != null)
 {
  handler.handleDisconnect(connection, host, port, type, message, cause);
 }
}

代码示例来源:origin: com.unboundid/unboundid-ldapsdk-minimal-edition

/**
 * Notifies the disconnect handler that the associated connection has been
 * closed.
 */
void notifyDisconnectHandler()
{
 final boolean alreadyNotified = handlerNotified.getAndSet(true);
 if (alreadyNotified)
 {
  return;
 }
 final DisconnectHandler handler =
    connection.getConnectionOptions().getDisconnectHandler();
 if (handler != null)
 {
  handler.handleDisconnect(connection, host, port, type, message, cause);
 }
}

代码示例来源:origin: com.unboundid/unboundid-ldapsdk-commercial-edition

/**
 * Specifies the maximum length of time to wait for the connection to be
 * established, in seconds.
 *
 * @param  timeout  The maximum length of time to wait for the connection to
 *                  be established.
 */
public void setConnectTimeout(final int timeout)
{
 final LDAPConnectionOptions options = conn.getConnectionOptions();
 if (timeout > 0)
 {
  options.setConnectTimeoutMillis(1000 * timeout);
 }
 else
 {
  options.setConnectTimeoutMillis(0);
 }
 conn.setConnectionOptions(options);
}

代码示例来源:origin: com.unboundid/unboundid-ldapsdk-commercial-edition

DEFAULT_INPUT_BUFFER_SIZE);
asn1StreamReader = new ASN1StreamReader(inputStream,
   connection.getConnectionOptions().getMaxMessageSize());
 final LDAPConnectionOptions options = connection.getConnectionOptions();
 final int connectTimeout = options.getConnectTimeoutMillis();
 if (connectTimeout > 0)

代码示例来源:origin: com.unboundid/unboundid-ldapsdk-minimal-edition

connection.getConnectionOptions().autoReconnect();
return processSync(connection, depth, autoReconnect);

代码示例来源:origin: com.unboundid/unboundid-ldapsdk-commercial-edition

connection.getConnectionOptions().autoReconnect();
return processSync(connection, depth, autoReconnect);

代码示例来源:origin: com.unboundid/unboundid-ldapsdk-commercial-edition

connection.getConnectionOptions().getResponseTimeoutMillis();

代码示例来源:origin: com.unboundid/unboundid-ldapsdk-minimal-edition

connection.getConnectionOptions().getResponseTimeoutMillis();

代码示例来源:origin: com.unboundid/unboundid-ldapsdk-commercial-edition

connection.getConnectionOptions().autoReconnect();
return processSync(connection, autoReconnect);
   connection.getConnectionOptions().bindWithDNRequiresPassword())

代码示例来源:origin: com.unboundid/unboundid-ldapsdk-minimal-edition

/**
 * {@inheritDoc}
 */
public void processPreAuthenticatedConnection(final LDAPConnection connection)
    throws LDAPException
{
 final StartTLSExtendedRequest startTLSRequest;
 if (sslContext == null)
 {
  startTLSRequest = new StartTLSExtendedRequest(sslSocketFactory);
 }
 else
 {
  startTLSRequest = new StartTLSExtendedRequest(sslContext);
 }
 // Since the StartTLS processing will occur during the course of
 // establishing the connection for use in the pool, set the connect timeout
 // for the operation to be equal to the connect timeout from the connection
 // options.
 final LDAPConnectionOptions opts = connection.getConnectionOptions();
 startTLSRequest.setResponseTimeoutMillis(opts.getConnectTimeoutMillis());
 final ExtendedResult r =
    connection.processExtendedOperation(startTLSRequest);
 if (! r.getResultCode().equals(ResultCode.SUCCESS))
 {
  throw new LDAPExtendedOperationException(r);
 }
}

代码示例来源:origin: com.unboundid/unboundid-ldapsdk-commercial-edition

/**
 * {@inheritDoc}
 */
public void processPreAuthenticatedConnection(final LDAPConnection connection)
    throws LDAPException
{
 final StartTLSExtendedRequest startTLSRequest;
 if (sslContext == null)
 {
  startTLSRequest = new StartTLSExtendedRequest(sslSocketFactory);
 }
 else
 {
  startTLSRequest = new StartTLSExtendedRequest(sslContext);
 }
 // Since the StartTLS processing will occur during the course of
 // establishing the connection for use in the pool, set the connect timeout
 // for the operation to be equal to the connect timeout from the connection
 // options.
 final LDAPConnectionOptions opts = connection.getConnectionOptions();
 startTLSRequest.setResponseTimeoutMillis(opts.getConnectTimeoutMillis());
 final ExtendedResult r =
    connection.processExtendedOperation(startTLSRequest);
 if (! r.getResultCode().equals(ResultCode.SUCCESS))
 {
  throw new LDAPExtendedOperationException(r);
 }
}

代码示例来源:origin: com.unboundid/unboundid-ldapsdk-minimal-edition

connection.getConnectionOptions();
@SuppressWarnings("deprecation")
final boolean autoReconnect = connectionOptions.autoReconnect();

代码示例来源:origin: com.unboundid/unboundid-ldapsdk-commercial-edition

connection.getConnectionOptions();
@SuppressWarnings("deprecation")
final boolean autoReconnect = connectionOptions.autoReconnect();

代码示例来源:origin: com.unboundid/unboundid-ldapsdk-minimal-edition

if (connection.getConnectionOptions().abandonOnTimeout())

代码示例来源:origin: com.unboundid/unboundid-ldapsdk-commercial-edition

if (connection.getConnectionOptions().abandonOnTimeout())

相关文章

LDAPConnection类方法