use of com.unboundid.ldap.protocol.AbandonRequestProtocolOp in project ldapsdk by pingidentity.
the class LDAPConnection method abandon.
/**
* Sends an abandon request with the provided information.
*
* @param messageID The message ID for the request to abandon.
* @param controls The set of controls to include in the abandon request.
* It may be {@code null} or empty if there are no
* controls.
*
* @throws LDAPException If a problem occurs while sending the request to
* the server.
*/
void abandon(final int messageID, @Nullable final Control... controls) throws LDAPException {
try {
connectionInternals.getConnectionReader().deregisterResponseAcceptor(messageID);
} catch (final Exception e) {
Debug.debugException(e);
}
connectionStatistics.incrementNumAbandonRequests();
final int abandonMessageID = nextMessageID();
if (Debug.debugEnabled(DebugType.LDAP)) {
Debug.debugLDAPRequest(Level.INFO, createAbandonRequestString(messageID, controls), abandonMessageID, this);
}
final LDAPConnectionLogger logger = connectionOptions.getConnectionLogger();
if (logger != null) {
final List<Control> controlList;
if (controls == null) {
controlList = Collections.emptyList();
} else {
controlList = Arrays.asList(controls);
}
logger.logAbandonRequest(this, abandonMessageID, messageID, controlList);
}
sendMessage(new LDAPMessage(abandonMessageID, new AbandonRequestProtocolOp(messageID), controls), connectionOptions.getResponseTimeoutMillis(OperationType.ABANDON));
}
use of com.unboundid.ldap.protocol.AbandonRequestProtocolOp in project ldapsdk by pingidentity.
the class LDAPConnection method abandon.
/**
* Processes an abandon request with the provided information.
*
* @param requestID The async request ID for the request to abandon.
* @param controls The set of controls to include in the abandon request.
* It may be {@code null} or empty if there are no
* controls.
*
* @throws LDAPException If a problem occurs while sending the request to
* the server.
*/
public void abandon(@NotNull final AsyncRequestID requestID, @Nullable final Control[] controls) throws LDAPException {
if (synchronousMode()) {
throw new LDAPException(ResultCode.NOT_SUPPORTED, ERR_ABANDON_NOT_SUPPORTED_IN_SYNCHRONOUS_MODE.get());
}
final int messageID = requestID.getMessageID();
try {
connectionInternals.getConnectionReader().deregisterResponseAcceptor(messageID);
} catch (final Exception e) {
Debug.debugException(e);
}
connectionStatistics.incrementNumAbandonRequests();
final int abandonMessageID = nextMessageID();
if (Debug.debugEnabled(DebugType.LDAP)) {
Debug.debugLDAPRequest(Level.INFO, createAbandonRequestString(messageID, controls), abandonMessageID, this);
}
final LDAPConnectionLogger logger = connectionOptions.getConnectionLogger();
if (logger != null) {
final List<Control> controlList;
if (controls == null) {
controlList = Collections.emptyList();
} else {
controlList = Arrays.asList(controls);
}
logger.logAbandonRequest(this, abandonMessageID, messageID, controlList);
}
sendMessage(new LDAPMessage(abandonMessageID, new AbandonRequestProtocolOp(messageID), controls), connectionOptions.getResponseTimeoutMillis(OperationType.ABANDON));
}
Aggregations