public class StateHandler extends JsonRequestHandler
{
"taskmanager" : {
"todo" : 0,
"inprogress" : 0
},
"api" : {
"jobmanager" : "http://localhost:8080/smila/jobmanager/",
"tasks" : "http://localhost:8080/smila/tasks/",
"pipelines" : "http://localhost:8080/smila/pipeline/",
"store" : "http://localhost:8080/smila/store/",
"crawlers" : "http://localhost:8080/smila/crawlers/",
"agents" : "http://localhost:8080/smila/agents/"
}
}
FACTORY, HEADER_REQUEST_HOST, HTTP_UTILS| Constructor and Description |
|---|
StateHandler() |
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
isValidMethod(java.lang.String method,
java.lang.String requestUri)
Checks if the handler allows the HTTP method.
|
java.lang.Object |
process(java.lang.String method,
java.lang.String requestUri,
Record inputRecord,
HttpExchange exchange)
process input record and return result object.
|
void |
setClusterConfigService(ClusterConfigService clusterConfig)
set OSGI service.
|
void |
setTaskManager(TaskManager taskManager)
set OSGI service.
|
void |
setVersionManager(VersionManager versionManager)
set OSGI service.
|
void |
unsetClusterConfigService(ClusterConfigService clusterConfig)
unset OSGI service.
|
void |
unsetTaskManager(TaskManager taskManager)
unset OSGI service.
|
void |
unsetVersionManager(VersionManager versionManager)
unset OSGI service.
|
getErrorStatus, getRequestHost, getSuccessStatus, getSuccessStatus, handle, process, writeErrorResult, writeResultObject, writeSuccessResultactivate, getDynamicUriParts, getRootContextPath, getStaticUriParts, getUriPattern, matches, urlDecodepublic java.lang.Object process(java.lang.String method,
java.lang.String requestUri,
Record inputRecord,
HttpExchange exchange)
process in class JsonRequestHandlermethod - HTTP methodrequestUri - request URI.inputRecord - input record parsed either from request body, if it has content, or from request URI parameters.exchange - http exchange object, contains e.g. the http header fieldsRecord, you have to provide a
JsonRequestHandler.writeResultObject(OutputStream, Object) method, too.protected boolean isValidMethod(java.lang.String method,
java.lang.String requestUri)
isValidMethod in class JsonRequestHandlermethod - HTTP methodrequestUri - request URIpublic void setTaskManager(TaskManager taskManager)
public void unsetTaskManager(TaskManager taskManager)
public void setVersionManager(VersionManager versionManager)
public void unsetVersionManager(VersionManager versionManager)
public void setClusterConfigService(ClusterConfigService clusterConfig)
public void unsetClusterConfigService(ClusterConfigService clusterConfig)