| | |
| | | import java.util.LinkedHashSet; |
| | | import java.util.concurrent.atomic.AtomicInteger; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | import org.forgerock.opendj.ldap.AbstractAsynchronousConnection; |
| | | import org.forgerock.opendj.ldap.ConnectionEventListener; |
| | | import org.forgerock.opendj.ldap.ErrorResultException; |
| | |
| | | import org.opends.server.core.QueueingStrategy; |
| | | import org.opends.server.core.SearchOperationBasis; |
| | | import org.opends.server.core.UnbindOperationBasis; |
| | | import org.opends.server.loggers.HTTPRequestInfo; |
| | | import org.opends.server.loggers.debug.DebugTracer; |
| | | import org.opends.server.types.AuthenticationInfo; |
| | | import org.opends.server.types.ByteString; |
| | |
| | | /** The HTTP client connection being "adapted". */ |
| | | private final HTTPClientConnection clientConnection; |
| | | |
| | | /** The HTTP request information to log. */ |
| | | private final HTTPRequestInfo requestInfo; |
| | | |
| | | /** |
| | | * The next message ID (and operation ID) that should be used for this |
| | | * connection. |
| | |
| | | * |
| | | * @param clientConnection |
| | | * the HTTP client connection being "adapted" |
| | | * @param requestInfo |
| | | * the HTTP request information to log |
| | | */ |
| | | public SdkConnectionAdapter(HTTPClientConnection clientConnection) |
| | | public SdkConnectionAdapter(HTTPClientConnection clientConnection, |
| | | HTTPRequestInfo requestInfo) |
| | | { |
| | | this.clientConnection = clientConnection; |
| | | this.requestInfo = requestInfo; |
| | | this.queueingStrategy = |
| | | new BoundedWorkQueueStrategy(clientConnection.getConnectionHandler() |
| | | .getCurrentConfig().getMaxConcurrentOpsPerConnection()); |
| | |
| | | { |
| | | this.clientConnection.disconnect(DisconnectReason.UNBIND, false, null); |
| | | } |
| | | |
| | | // At this point, we try to log the request with OK status code. |
| | | // If it was already logged, it will be a no op. |
| | | this.requestInfo.log(HttpServletResponse.SC_OK); |
| | | |
| | | isClosed = true; |
| | | } |
| | | |