Package com.arcadedb.server.http.handler
Class AbstractServerHttpHandler
- java.lang.Object
-
- com.arcadedb.server.http.handler.AbstractServerHttpHandler
-
- All Implemented Interfaces:
io.undertow.server.HttpHandler
- Direct Known Subclasses:
DatabaseAbstractHandler
,DeleteDropUserHandler
,GetDatabasesHandler
,GetDynamicContentHandler
,GetExistsDatabaseHandler
,GetReadyHandler
,GetServerHandler
,PostServerCommandHandler
,WebSocketConnectionHandler
public abstract class AbstractServerHttpHandler extends Object implements io.undertow.server.HttpHandler
-
-
Field Summary
Fields Modifier and Type Field Description protected HttpServer
httpServer
-
Constructor Summary
Constructors Constructor Description AbstractServerHttpHandler(HttpServer httpServer)
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected ServerSecurityUser
authenticate(String userName, String userPassword)
protected static void
checkRootUser(ServerSecurityUser user)
protected JSONObject
createResult(SecurityUser user, Database database)
protected String
decode(String command)
protected String
encodeError(String message)
protected String
error2json(String error, String detail, Throwable exception, String exceptionArgs, String help)
protected abstract ExecutionResponse
execute(io.undertow.server.HttpServerExchange exchange, ServerSecurityUser user)
protected String
getQueryParameter(io.undertow.server.HttpServerExchange exchange, String name)
protected String
getQueryParameter(io.undertow.server.HttpServerExchange exchange, String name, String defaultValue)
void
handleRequest(io.undertow.server.HttpServerExchange exchange)
boolean
isRequireAuthentication()
Returns true if the handler require authentication to be executed, any valid user.protected boolean
mustExecuteOnWorkerThread()
Returns true if the handler is reading the payload in the request.protected String
parseRequestPayload(io.undertow.server.HttpServerExchange e)
-
-
-
Field Detail
-
httpServer
protected final HttpServer httpServer
-
-
Constructor Detail
-
AbstractServerHttpHandler
public AbstractServerHttpHandler(HttpServer httpServer)
-
-
Method Detail
-
execute
protected abstract ExecutionResponse execute(io.undertow.server.HttpServerExchange exchange, ServerSecurityUser user) throws Exception
- Throws:
Exception
-
parseRequestPayload
protected String parseRequestPayload(io.undertow.server.HttpServerExchange e)
-
handleRequest
public void handleRequest(io.undertow.server.HttpServerExchange exchange)
- Specified by:
handleRequest
in interfaceio.undertow.server.HttpHandler
-
isRequireAuthentication
public boolean isRequireAuthentication()
Returns true if the handler require authentication to be executed, any valid user. False means the handler can be executed without authentication.
-
authenticate
protected ServerSecurityUser authenticate(String userName, String userPassword)
-
checkRootUser
protected static void checkRootUser(ServerSecurityUser user)
-
createResult
protected JSONObject createResult(SecurityUser user, Database database)
-
error2json
protected String error2json(String error, String detail, Throwable exception, String exceptionArgs, String help)
-
mustExecuteOnWorkerThread
protected boolean mustExecuteOnWorkerThread()
Returns true if the handler is reading the payload in the request. In this case, the execution is delegated to the worker thread.
-
getQueryParameter
protected String getQueryParameter(io.undertow.server.HttpServerExchange exchange, String name)
-
-