@Override @NotNull public BindRequest createBindRequest() { return new SimpleBindRequest(bindDn, password); } }
/** * Creates a new bind request protocol op from the provided bind request * object. * * @param request The simple bind request to use to create this protocol op. * It must have been created with a static password rather * than using a password provider. * * @throws LDAPSDKUsageException If the provided simple bind request is * configured to use a password provider * rather than a static password. */ public BindRequestProtocolOp(final SimpleBindRequest request) throws LDAPSDKUsageException { version = 3; credentialsType = CRED_TYPE_SIMPLE; bindDN = request.getBindDN(); simplePassword = request.getPassword(); saslMechanism = null; saslCredentials = null; if (simplePassword == null) { throw new LDAPSDKUsageException( ERR_BIND_REQUEST_CANNOT_CREATE_WITH_PASSWORD_PROVIDER.get()); } }
/** * {@inheritDoc} */ @Override() public SimpleBindRequest duplicate() { return duplicate(getControls()); }
/** * {@inheritDoc} */ @Override() public SimpleBindRequest duplicate(final Control[] controls) { final SimpleBindRequest bindRequest = new SimpleBindRequest(bindDN, password, passwordProvider, controls); bindRequest.setResponseTimeoutMillis(getResponseTimeoutMillis(null)); return bindRequest; }
/** * {@inheritDoc} */ @Override() public SimpleBindRequest getRebindRequest(final String host, final int port) { return new SimpleBindRequest(bindDN, password, passwordProvider, getControls()); }
new LDAPMessage(messageID, this, getControls()); (int) getResponseTimeoutMillis(connection)); final BindResult bindResult = reconnectAndRetry(connection, le.getResultCode()); if (bindResult != null) getIntermediateResponseListener(); if (listener != null) return handleResponse(connection, response, requestTime, allowRetry);
final boolean autoReconnect = connection.getConnectionOptions().autoReconnect(); return processSync(connection, autoReconnect); final LDAPMessage message = new LDAPMessage(messageID, this, getControls()); try final long responseTimeout = getResponseTimeoutMillis(connection); if (responseTimeout > 0) return handleResponse(connection, response, requestTime, false);
/** * Resolves the authzId (user) of a simple bind request. * * @param bindRequest The bind request, must not be {@code null}. * * @return The authzId, {@code null} if it couldn't be resolved. */ public static AuthzId resolve(final SimpleBindRequest bindRequest) { if (bindRequest == null) throw new IllegalArgumentException("The bind request must not be null"); DN user; try { user = new DN(bindRequest.getBindDN()); } catch (LDAPException e ) { return null; } return new AuthzId(user); }
/** * {@inheritDoc} */ @Override() public void toString(final StringBuilder buffer) { buffer.append("SimpleBindRequest(dn='"); buffer.append(bindDN); buffer.append('\''); final Control[] controls = getControls(); if (controls.length > 0) { buffer.append(", controls={"); for (int i=0; i < controls.length; i++) { if (i > 0) { buffer.append(", "); } buffer.append(controls[i]); } buffer.append('}'); } buffer.append(')'); }
/** * {@inheritDoc} */ @Override() public SimpleBindRequest duplicate(final Control[] controls) { final SimpleBindRequest bindRequest = new SimpleBindRequest(bindDN, password, passwordProvider, controls); bindRequest.setResponseTimeoutMillis(getResponseTimeoutMillis(null)); return bindRequest; }
/** * {@inheritDoc} */ @Override() public SimpleBindRequest getRebindRequest(final String host, final int port) { return new SimpleBindRequest(bindDN, password, passwordProvider, getControls()); }
new LDAPMessage(messageID, this, getControls()); (int) getResponseTimeoutMillis(connection)); final BindResult bindResult = reconnectAndRetry(connection, le.getResultCode()); if (bindResult != null) getIntermediateResponseListener(); if (listener != null) return handleResponse(connection, response, requestTime, allowRetry);
final boolean autoReconnect = connection.getConnectionOptions().autoReconnect(); return processSync(connection, autoReconnect); final LDAPMessage message = new LDAPMessage(messageID, this, getControls()); try final long responseTimeout = getResponseTimeoutMillis(connection); if (responseTimeout > 0) return handleResponse(connection, response, requestTime, false);
/** * {@inheritDoc} */ @Override() public void toString(final StringBuilder buffer) { buffer.append("SimpleBindRequest(dn='"); buffer.append(bindDN); buffer.append('\''); final Control[] controls = getControls(); if (controls.length > 0) { buffer.append(", controls={"); for (int i=0; i < controls.length; i++) { if (i > 0) { buffer.append(", "); } buffer.append(controls[i]); } buffer.append('}'); } buffer.append(')'); }
/** * Processes a simple bind request with the provided DN and password. Note * that the bind processing will verify that the provided credentials are * valid, but it will not alter the server in any way. * * @param bindDN The bind DN for the bind operation. * @param password The password for the simple bind operation. * * @return The result of processing the bind operation. * * @throws LDAPException If the server rejects the bind request, or if a * problem occurs while sending the request or reading * the response. */ public BindResult bind(final String bindDN, final String password) throws LDAPException { return bind(new SimpleBindRequest(bindDN, password)); }
/** * Creates a new bind request protocol op from the provided bind request * object. * * @param request The simple bind request to use to create this protocol op. * It must have been created with a static password rather * than using a password provider. * * @throws LDAPSDKUsageException If the provided simple bind request is * configured to use a password provider * rather than a static password. */ public BindRequestProtocolOp(final SimpleBindRequest request) throws LDAPSDKUsageException { version = 3; credentialsType = CRED_TYPE_SIMPLE; bindDN = request.getBindDN(); simplePassword = request.getPassword(); saslMechanism = null; saslCredentials = null; if (simplePassword == null) { throw new LDAPSDKUsageException( ERR_BIND_REQUEST_CANNOT_CREATE_WITH_PASSWORD_PROVIDER.get()); } }
/** * {@inheritDoc} */ @Override() public SimpleBindRequest duplicate() { return duplicate(getControls()); }
"Bind Password")); final Control[] controls = getControls(); if (controls.length > 0)
/** * Processes a simple bind request with the provided DN and password using a * connection from this connection pool. Note that this will impact the state * of the connection in the pool, and therefore this method should only be * used if this connection pool is used exclusively for processing bind * operations, or if the retain identity request control (only available in * the Commercial Edition of the LDAP SDK for use with the Ping Identity, * UnboundID, or Alcatel-Lucent 8661 Directory Server) is included in the bind * request to ensure that the authentication state is not impacted. * * @param bindDN The bind DN for the bind operation. * @param password The password for the simple bind operation. * * @return The result of processing the bind operation. * * @throws LDAPException If the server rejects the bind request, or if a * problem occurs while sending the request or reading * the response. */ public final BindResult bind(final String bindDN, final String password) throws LDAPException { return bind(new SimpleBindRequest(bindDN, password)); }