Search in sources :

Example 1 with OHttpRequest

use of com.orientechnologies.orient.server.network.protocol.http.OHttpRequest in project orientdb by orientechnologies.

the class OServerCommandPostKillDbConnection method doPost.

private void doPost(OHttpRequest iRequest, OHttpResponse iResponse, String db, String command) throws IOException {
    final List<OClientConnection> connections = server.getClientConnectionManager().getConnections();
    for (OClientConnection connection : connections) {
        if (connection.getProtocol() instanceof ONetworkProtocolHttpAbstract) {
            final ONetworkProtocolHttpAbstract http = (ONetworkProtocolHttpAbstract) connection.getProtocol();
            final OHttpRequest req = http.getRequest();
            if (req != null && req != iRequest && req.sessionId.equals(iRequest.sessionId)) {
                server.getClientConnectionManager().interrupt(connection.getId());
            }
        }
    }
    iResponse.send(OHttpUtils.STATUS_OK_NOCONTENT_CODE, OHttpUtils.STATUS_OK_NOCONTENT_DESCRIPTION, OHttpUtils.CONTENT_TEXT_PLAIN, null, null);
}
Also used : OHttpRequest(com.orientechnologies.orient.server.network.protocol.http.OHttpRequest) ONetworkProtocolHttpAbstract(com.orientechnologies.orient.server.network.protocol.http.ONetworkProtocolHttpAbstract) OClientConnection(com.orientechnologies.orient.server.OClientConnection)

Aggregations

OClientConnection (com.orientechnologies.orient.server.OClientConnection)1 OHttpRequest (com.orientechnologies.orient.server.network.protocol.http.OHttpRequest)1 ONetworkProtocolHttpAbstract (com.orientechnologies.orient.server.network.protocol.http.ONetworkProtocolHttpAbstract)1