Class AbstractRestStub
java.lang.Object
de.aristaflow.ilm.ws.rest.base.service.AbstractStub
de.aristaflow.ilm.ws.rest.base.service.AbstractRestStub
- Direct Known Subclasses:
ActivityStateNotificationRestStub,ClientWorklistRestStub,ExecutionMessageNotificationRestStub,InstanceStateNotificationRestStub,OrgPolicyScriptHandlerRestStub
This class provides the means for making REST calls to callback objects. These objects are
provided as URLs satisfying the corresponding callback interface. Subclasses of this class have
to implement the callback interface defined as Java or ILM and forward the calls to the REST
callback. Afterwards the responses of the callback have to be converted and returned to the
caller of the callback (stub).
This also includes handling of expected exceptions (which belong to the interface) as well as various unexpected exceptions, especially ones caused by the REST framework.
This also includes handling of expected exceptions (which belong to the interface) as well as various unexpected exceptions, especially ones caused by the REST framework.
This stub implementation is rather simple and uses a plain HttpURLConnection and an
ObjectMapper for converting to and from JSON.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclassARequestrepresents a request sent to the REST callback and also provides the return value sent via callback response. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final URLThe base URL of the callback.protected final StringThe API version which to expect from the callback.Fields inherited from class de.aristaflow.ilm.ws.rest.base.service.AbstractStub
logger, om -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractRestStub(URL baseUrl, String version, Supplier<com.fasterxml.jackson.databind.ObjectMapper> om, LogService logService) Creates a new abstract stub providing the basic means for making REST callback calls. -
Method Summary
Modifier and TypeMethodDescriptionGets a#DELETErequest for the designated path (operation) at the callback.Gets a#GETrequest for the designated path (operation) at the callback.Gets a#POSTrequest for the designated path (operation) at the callback.Gets a#PUTrequest for the designated path (operation) at the callback.Methods inherited from class de.aristaflow.ilm.ws.rest.base.service.AbstractStub
getJsonFor
-
Field Details
-
baseUrl
The base URL of the callback. -
version
The API version which to expect from the callback.
-
-
Constructor Details
-
AbstractRestStub
protected AbstractRestStub(URL baseUrl, String version, Supplier<com.fasterxml.jackson.databind.ObjectMapper> om, LogService logService) Creates a new abstract stub providing the basic means for making REST callback calls.- Parameters:
baseUrl- The base URL of the callback.version- The API version which to expect from the callback.om- The object mapper (supplier) for reading JSON objects from responses (including exceptions).logService- The log service for creating class-specific loggers.
-
-
Method Details
-
get
Gets a#GETrequest for the designated path (operation) at the callback.- Parameters:
path- The path (operation) which to call.- Returns:
- A
#GETrequest for the designated path (operation) at the callback.
-
post
Gets a#POSTrequest for the designated path (operation) at the callback.- Parameters:
path- The path (operation) which to call.- Returns:
- A
#POSTrequest for the designated path (operation) at the callback.
-
delete
Gets a#DELETErequest for the designated path (operation) at the callback.- Parameters:
path- The path (operation) which to call.- Returns:
- A
#DELETErequest for the designated path (operation) at the callback.
-
put
Gets a#PUTrequest for the designated path (operation) at the callback.- Parameters:
path- The path (operation) which to call.- Returns:
- A
#PUTrequest for the designated path (operation) at the callback.
-