|
SMILA (incubation) API documentation | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.smila.http.server.util.ARequestHandler
org.eclipse.smila.http.server.json.JsonRequestHandler
org.eclipse.smila.objectstore.httphandler.AStoreHandler
org.eclipse.smila.objectstore.httphandler.StoreObjectHandler
public class StoreObjectHandler
Read BON object from a object store object and convert it to JSON. For bulk objects it returns only the first object.
Field Summary |
---|
Fields inherited from class org.eclipse.smila.http.server.json.JsonRequestHandler |
---|
FACTORY |
Constructor Summary | |
---|---|
StoreObjectHandler()
|
Method Summary | |
---|---|
protected int |
getSuccessStatus(java.lang.String requestMethod,
java.lang.String requestUri,
Record inputRecord,
java.lang.Object resultObject)
Returns the success code. |
protected boolean |
isValidMethod(java.lang.String method,
java.lang.String requestUri)
Checks if the handler allows the HTTP method. |
protected Any |
listObjects(java.lang.String storeName,
java.lang.String objectIdPrefix)
list all objects with the given prefix. |
java.lang.Object |
process(java.lang.String method,
java.lang.String requestUri,
Record inputRecord)
process input record and return result object. |
protected void |
putBonObject(java.lang.String storeName,
java.lang.String objectId,
Record inputRecord)
try to write one BON object to the object store. |
protected BinaryObjectStreamIterator |
readBonBulk(java.lang.String storeName,
java.lang.String objectId)
try to read object as a BON bulk. |
protected Any |
readJsonObject(java.lang.String storeName,
java.lang.String objectId)
try to read a single JSON object from the object store object. |
protected void |
removeObject(java.lang.String storeName,
java.lang.String objectId,
Record inputRecord)
Remove object, input record is not needed here but in subclass. |
protected void |
writeResultObject(java.io.OutputStream responseStream,
java.lang.Object resultObject)
write 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, 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 |
Constructor Detail |
---|
public StoreObjectHandler()
Method Detail |
---|
protected boolean isValidMethod(java.lang.String method, java.lang.String requestUri)
isValidMethod
in class JsonRequestHandler
method
- HTTP methodrequestUri
- request URI
public java.lang.Object process(java.lang.String method, java.lang.String requestUri, Record inputRecord) throws java.lang.Exception
process
in class JsonRequestHandler
method
- HTTP methodrequestUri
- request URI.inputRecord
- input record parsed either from request body, if it has content, or from request URI parameters.
Record
, you have to provide a
JsonRequestHandler.writeResultObject(OutputStream, Object)
method, too.
java.lang.Exception
- any failure during processing.protected Any listObjects(java.lang.String storeName, java.lang.String objectIdPrefix) throws ObjectStoreException
ObjectStoreException
protected BinaryObjectStreamIterator readBonBulk(java.lang.String storeName, java.lang.String objectId) throws ObjectStoreException, java.io.IOException
ObjectStoreException
java.io.IOException
protected Any readJsonObject(java.lang.String storeName, java.lang.String objectId) throws ObjectStoreException, java.io.IOException
ObjectStoreException
java.io.IOException
protected void putBonObject(java.lang.String storeName, java.lang.String objectId, Record inputRecord) throws ObjectStoreException
ObjectStoreException
protected void removeObject(java.lang.String storeName, java.lang.String objectId, Record inputRecord) throws ObjectStoreException
ObjectStoreException
protected int getSuccessStatus(java.lang.String requestMethod, java.lang.String requestUri, Record inputRecord, java.lang.Object resultObject)
getSuccessStatus
in class JsonRequestHandler
requestMethod
- HTTP methodrequestUri
- request URIinputRecord
- input recordresultObject
- result object returned from process
protected void writeResultObject(java.io.OutputStream responseStream, java.lang.Object resultObject) throws java.io.IOException
Record
results. Subclasses that produce
different result types must override this method.
writeResultObject
in class JsonRequestHandler
responseStream
- response streamresultObject
- result object.
java.io.IOException
- error writing result
|
SMILA (incubation) API documentation | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |