Package de.pisa.psa.rst.hdl.out
Class PsaRstApiEvtHdlOut
java.lang.Object
de.pisa.psa.rst.hdl.PsaRstApiEvtHdl
de.pisa.psa.rst.hdl.out.PsaRstApiEvtHdlOut
- All Implemented Interfaces:
AutoCloseable
- Direct Known Subclasses:
PsaRstApiEvtHdlOutDelete
,PsaRstApiEvtHdlOutGet
,PsaRstApiEvtHdlOutPatch
,PsaRstApiEvtHdlOutPost
,PsaRstApiEvtHdlOutPut
REST API: outgoing event handler
- Since:
- 07.08.2023
- Author:
- weiland
-
Nested Class Summary
Nested classes/interfaces inherited from class de.pisa.psa.rst.hdl.PsaRstApiEvtHdl
PsaRstApiEvtHdl.EurekaHighlighting
-
Field Summary
Fields inherited from class de.pisa.psa.rst.hdl.PsaRstApiEvtHdl
Default_External_Language, Default_User, Force_IAM_User, Max_Records
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
bufferEntity
(javax.ws.rs.core.Response response) Buffer the response entity.
In case of an exception, the exception is logged.protected javax.ws.rs.client.Entity<?>
get an entityset the key for the IAM propertiesget the request bodyget the request headerget the request pathprotected de.pisa.psc.srv.rst.PscRstCli
newRestClient
(String url) create a new REST clientprotected javax.ws.rs.core.Response
sendDeleteRequest
(de.pisa.psc.srv.rst.PscRstCli client, Object entity, javax.ws.rs.core.MediaType type) send a DELETE requestprotected javax.ws.rs.core.Response
sendGetRequest
(de.pisa.psc.srv.rst.PscRstCli client, Object entity, javax.ws.rs.core.MediaType type) send a GET requestprotected javax.ws.rs.core.Response
sendPatchRequest
(de.pisa.psc.srv.rst.PscRstCli client, Object entity, javax.ws.rs.core.MediaType type) send a PATCH requestprotected javax.ws.rs.core.Response
sendPostRequest
(de.pisa.psc.srv.rst.PscRstCli client, Object entity, javax.ws.rs.core.MediaType type) send a POST requestprotected javax.ws.rs.core.Response
sendPutRequest
(de.pisa.psc.srv.rst.PscRstCli client, Object entity, javax.ws.rs.core.MediaType type) send a PUT requestjavax.ws.rs.core.Response
sendRequest
(Object entity, javax.ws.rs.core.MediaType type) send a REST requestjavax.ws.rs.core.Response
sendRequest
(javax.ws.rs.core.Response record) send a REST requestprotected void
setAuthorization
(de.pisa.psc.srv.rst.PscRstCli client) set the authorization for the REST clientvoid
setBufferResponseEntity
(boolean buffer) Control whether the received response entity should be buffered or notvoid
get the key for the IAM propertiesvoid
setRequest
(de.pisa.psc.srv.rst.PscRstCli client, Object entity) set the request datavoid
setRequestBody
(Object body) set the request bodyvoid
setRequestHeader
(String header) set the request headervoid
setRequestPath
(String path) set the request pathMethods inherited from class de.pisa.psa.rst.hdl.PsaRstApiEvtHdl
buildResponse, cloneRecords, close, fetchContact, fetchEureka, fetchEurekaRecords, fetchIAMContact, fetchRecord, fetchRecord, fetchRecords, findEmail, getActiveEventHandler, getContinuation, getData, getEurekaDtoQuery, getEurekaHighlighting, getEurekaQueryField, getExternalCommunicationLanguage, getFetchRecordKeyField, getField, getIAMUser, getJsonIncludeEmpty, getQuery, getSsn, getSsnUsr, getSysSsn, handleEvent, isIAMUser, loadRecord, mapQuery, newDto, newObject, newPsaRstApiObjLis, noEventLogging, queryEureka, queryEurekaRecords, queryRecord, queryRecords, queryRecordsAddSort, queryRecordsSetQuery, setActiveEventHandler, setExternalLanguage, setJsonIncludeEmpty, toJson
-
Constructor Details
-
PsaRstApiEvtHdlOut
Constructor- Parameters:
data
- event data
-
-
Method Details
-
setBufferResponseEntity
public void setBufferResponseEntity(boolean buffer) Control whether the received response entity should be buffered or not- Parameters:
buffer
- if true it will be buffered (default=false)
-
setRequest
set the request data- Parameters:
client
- REST cliententity
- payload entity
-
setRequestPath
set the request path- Parameters:
path
- path
-
getRequestPath
get the request path- Returns:
- path
-
setRequestBody
set the request body- Parameters:
body
- body
-
getRequestBody
get the request body- Returns:
- body
-
setRequestHeader
set the request header- Parameters:
header
- header
-
getRequestHeader
get the request header- Returns:
- header
-
setIAMKey
get the key for the IAM properties- Parameters:
key
- key
-
getIAMKey
set the key for the IAM properties- Returns:
- key
-
sendRequest
send a REST request- Parameters:
record
- record data to send- Returns:
- response of the called end point
- Throws:
Exception
-
newRestClient
create a new REST client- Parameters:
url
- target URL- Returns:
- client
- Throws:
URISyntaxException
-
sendRequest
public javax.ws.rs.core.Response sendRequest(Object entity, javax.ws.rs.core.MediaType type) throws Exception send a REST request- Parameters:
entity
- payload entitytype
- media type of the entity- Returns:
- response of the called end point
- Throws:
Exception
-
setAuthorization
set the authorization for the REST client- Parameters:
client
- REST client- Throws:
Exception
-
getEntity
get an entity- Parameters:
entity
- entity objecttype
- type of the entity- Returns:
- entity
-
sendPostRequest
protected javax.ws.rs.core.Response sendPostRequest(de.pisa.psc.srv.rst.PscRstCli client, Object entity, javax.ws.rs.core.MediaType type) throws Exception send a POST request- Parameters:
client
- REST cliententity
- payload entitytype
- media type of the entity- Returns:
- response of the called end point
- Throws:
Exception
-
sendPutRequest
protected javax.ws.rs.core.Response sendPutRequest(de.pisa.psc.srv.rst.PscRstCli client, Object entity, javax.ws.rs.core.MediaType type) throws Exception send a PUT request- Parameters:
client
- REST cliententity
- payload entitytype
- media type of the entity- Returns:
- response of the called end point
- Throws:
Exception
-
sendPatchRequest
protected javax.ws.rs.core.Response sendPatchRequest(de.pisa.psc.srv.rst.PscRstCli client, Object entity, javax.ws.rs.core.MediaType type) throws Exception send a PATCH request- Parameters:
client
- REST cliententity
- payload entitytype
- media type of the entity- Returns:
- response of the called end point
- Throws:
Exception
-
sendGetRequest
protected javax.ws.rs.core.Response sendGetRequest(de.pisa.psc.srv.rst.PscRstCli client, Object entity, javax.ws.rs.core.MediaType type) throws Exception send a GET request- Parameters:
client
- REST cliententity
- payload entitytype
- media type of the entity- Returns:
- response of the called end point
- Throws:
Exception
-
sendDeleteRequest
protected javax.ws.rs.core.Response sendDeleteRequest(de.pisa.psc.srv.rst.PscRstCli client, Object entity, javax.ws.rs.core.MediaType type) throws Exception send a DELETE request- Parameters:
client
- REST cliententity
- payload entitytype
- media type of the entity- Returns:
- response of the called end point
- Throws:
Exception
-
bufferEntity
protected void bufferEntity(javax.ws.rs.core.Response response) Buffer the response entity.
In case of an exception, the exception is logged.- Parameters:
response
- response
-