Class AbstractListenerHandler<ObjType>
java.lang.Object
org.apache.druid.server.listener.resource.AbstractListenerHandler<ObjType>
- Type Parameters:
ObjType- A List of this type is expected in the input stream as JSON. Must be able to be converted to/from Map<String, Object>
- All Implemented Interfaces:
ListenerHandler
This is a simplified handler for announcement listeners. The input is expected to be a JSON list objects.
Empty maps `{}` are taken care of at this level and never passed down to the subclass's handle method.
-
Constructor Summary
ConstructorsConstructorDescriptionAbstractListenerHandler(com.fasterxml.jackson.core.type.TypeReference<ObjType> inObjTypeRef) The standard constructor takes in a type reference for the object and for a list of the object. -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract ObjectDelete the object for a particular idprotected abstract ObjectGet the object for a particular idprotected abstract ObjectgetAll()final javax.ws.rs.core.ResponsehandleDELETE(String id) final javax.ws.rs.core.Responsefinal javax.ws.rs.core.Responsefinal javax.ws.rs.core.ResponsehandlePOST(InputStream inputStream, com.fasterxml.jackson.databind.ObjectMapper mapper, String id) final javax.ws.rs.core.ResponsehandlePOSTAll(InputStream inputStream, com.fasterxml.jackson.databind.ObjectMapper mapper) abstract ObjectProcess a POST request of the input itemsfinal voidMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.druid.server.listener.resource.ListenerHandler
handleUpdates
-
Constructor Details
-
AbstractListenerHandler
The standard constructor takes in a type reference for the object and for a list of the object. This is to work around some limitations in Java with type erasure.- Parameters:
inObjTypeRef- The TypeReference for the input object type
-
-
Method Details
-
handlePOST
public final javax.ws.rs.core.Response handlePOST(InputStream inputStream, com.fasterxml.jackson.databind.ObjectMapper mapper, String id) - Specified by:
handlePOSTin interfaceListenerHandler
-
handlePOSTAll
public final javax.ws.rs.core.Response handlePOSTAll(InputStream inputStream, com.fasterxml.jackson.databind.ObjectMapper mapper) - Specified by:
handlePOSTAllin interfaceListenerHandler
-
handleGET
- Specified by:
handleGETin interfaceListenerHandler
-
handleGETAll
public final javax.ws.rs.core.Response handleGETAll()- Specified by:
handleGETAllin interfaceListenerHandler
-
handleDELETE
- Specified by:
handleDELETEin interfaceListenerHandler
-
use_AbstractListenerHandler_instead
public final void use_AbstractListenerHandler_instead()- Specified by:
use_AbstractListenerHandler_insteadin interfaceListenerHandler
-
delete
Delete the object for a particular id- Parameters:
id- A string id of the object to be deleted. This id is never null or empty.- Returns:
- The object to be returned in the entity. A NULL return will cause a 404 response. A non-null return will cause a 202 response. An Exception thrown will cause a 500 response.
-
get
Get the object for a particular id- Parameters:
id- A string id of the object desired. This id is never null or empty.- Returns:
- The object to be returned in the entity. A NULL return will cause a 404 response. A non-null return will cause a 200 response. An Exception thrown will cause a 500 response.
-
getAll
-
post
Process a POST request of the input items- Parameters:
inputObject- A list of the objects which were POSTed- Returns:
- An object to be returned in the entity of the response.
-