SMILA (incubation) API documentation

org.eclipse.smila.objectstore.httphandler
Class StoreAdminHandler

java.lang.Object
  extended by org.eclipse.smila.http.server.util.ARequestHandler
      extended by org.eclipse.smila.http.server.json.JsonRequestHandler
          extended by org.eclipse.smila.objectstore.httphandler.AStoreHandler
              extended by org.eclipse.smila.objectstore.httphandler.StoreAdminHandler
All Implemented Interfaces:
HttpHandler, RequestHandler

public class StoreAdminHandler
extends AStoreHandler

Implements the handling of HTTP requests for getting store infos, creating and deleting stores.


Field Summary
static java.lang.String PARAM_RETURNOBJECTS
          parameter to switch on or off list of objects in store info.
 
Fields inherited from class org.eclipse.smila.http.server.json.JsonRequestHandler
FACTORY
 
Constructor Summary
StoreAdminHandler()
          Default constructor.
 
Method Summary
protected  int getSuccessStatus(java.lang.String method, java.lang.String requestUri)
          for PUT and DELETE, success status is HttpStatus.CREATED.
protected  boolean isValidMethod(java.lang.String method, java.lang.String requestUri)
          Valid methods are GET (store info), PUT (create store) or DELETE (remove store).
 java.lang.Object process(java.lang.String method, java.lang.String requestUri, Record parameters)
          process input record and return result object.
 
Methods inherited from class org.eclipse.smila.objectstore.httphandler.AStoreHandler
getErrorStatus, getObjectId, getObjectStoreService, getStoreName, setObjectStoreService, unsetObjectStoreService
 
Methods inherited from class org.eclipse.smila.http.server.json.JsonRequestHandler
getRequestHost, getSuccessStatus, handle, writeErrorResult, writeResultObject, writeSuccessResult
 
Methods inherited from class org.eclipse.smila.http.server.util.ARequestHandler
activate, getDynamicUriParts, getRootContextPath, getStaticUriParts, getUriPattern, matches, urlDecode
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PARAM_RETURNOBJECTS

public static final java.lang.String PARAM_RETURNOBJECTS
parameter to switch on or off list of objects in store info.

See Also:
Constant Field Values
Constructor Detail

StoreAdminHandler

public StoreAdminHandler()
Default constructor.

Method Detail

isValidMethod

protected boolean isValidMethod(java.lang.String method,
                                java.lang.String requestUri)
Valid methods are GET (store info), PUT (create store) or DELETE (remove store). Checks if the handler allows the HTTP method.

Overrides:
isValidMethod in class JsonRequestHandler
Parameters:
method - HTTP method
requestUri - request URI
Returns:
true if the method can be used for the URI, else false.

getSuccessStatus

protected int getSuccessStatus(java.lang.String method,
                               java.lang.String requestUri)
for PUT and DELETE, success status is HttpStatus.CREATED.

Overrides:
getSuccessStatus in class JsonRequestHandler
Parameters:
method - HTTP method
requestUri - request URI
Returns:
the status code to return for successful requests using the method and request URI. By default it is "OK" (200).

process

public java.lang.Object process(java.lang.String method,
                                java.lang.String requestUri,
                                Record parameters)
                         throws ObjectStoreException
process input record and return result object.

Specified by:
process in class JsonRequestHandler
Parameters:
method - HTTP method
requestUri - request URI.
parameters - input record parsed either from request body, if it has content, or from request URI parameters.
Returns:
null for create- and delete-store requests, Store information object else.
Throws:
ObjectStoreException

SMILA (incubation) API documentation