Package de.pisa.psa.rst.svc
Klasse PsaRstApiSvcBas
java.lang.Object
de.pisa.psa.rst.svc.PsaRstApiSvcBas
- Bekannte direkte Unterklassen:
IplWsvPsaRstApiSvc
,IplWsvPsaRstApiTestSvc
REST API: service base class
- Seit:
- 23.05.2023
- Autor:
- weiland
-
Feldübersicht
FelderModifizierer und TypFeldBeschreibungstatic final String
cookie name: IAM authentication tokenprotected String
key for the IAM propertiesprotected String
service URL for the IAM tokenprotected de.pisa.psa.com.dxhub.iam.UserInfo
IAM user information for the access tokenprotected org.glassfish.jersey.server.ContainerRequest
container request contextprotected String
the session user -
Konstruktorübersicht
Konstruktoren -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungprotected void
createEvent
(de.pisa.psc.srv.glb.PscSsn ssn, String gid, String body, String user, String language, boolean store) create an event recordprotected String[]
get the value of the Authorization headerfinal PsaRstApiEvtHdlDat
getData()
get the request dataprotected final de.pisa.psa.com.dxhub.iam.UserInfo
get the current IAM user informationprotected de.pisa.psa.com.dxhub.iam.UserInfo
getIAMUserInfo
(de.pisa.psc.srv.glb.PscSsn ssn, String account_id, String token) get the IAM user informationprotected String
getLanguageFromRequest
(de.pisa.psc.srv.glb.PscSsn ssn) get the language identifier from the requests accepted languagesprotected Optional
<javax.ws.rs.core.Cookie> getRequestCookie
(String name) get a cookie from the requestprotected String
getRequestHeader
(String key) get a request header valueget all request headerget the acceptable languages for this requestprotected String
get the request methodprotected String
get the request pathprotected String
get the request query stringprotected javax.ws.rs.core.Response
handleRequest
(String gid, String body, String user, String language) handle an incoming requestprotected void
initialize
(de.pisa.psc.srv.glb.PscSsn ssn) initialize the requestprotected boolean
check if the request should be handled synchronouslyprotected de.pisa.psa.ifc.PsaDtoDat
loadConfiguration
(de.pisa.psc.srv.glb.PscSsn ssn, String method, List<String> path_tokens) load the configurationprotected de.pisa.psc.srv.glb.PscSsn
newSsn()
get a new sessionjavax.ws.rs.core.Response
start processing the current eventfinal void
setConfig
(de.pisa.psa.ifc.PsaDtoDat config) set the configurationfinal void
setEvent
(de.pisa.psa.ifc.PsaDtoDat event) set the eventprotected void
validateIAM
(de.pisa.psc.srv.glb.PscSsn ssn) validate the IAM tokenprotected void
validateKey
(de.pisa.psc.srv.glb.PscSsn ssn) validate the authorization key
-
Felddetails
-
Request
@Context protected org.glassfish.jersey.server.ContainerRequest Requestcontainer request context -
User
the session user -
IAM_Key
key for the IAM properties -
IAM_Service
service URL for the IAM token -
IAM_User_Info
protected de.pisa.psa.com.dxhub.iam.UserInfo IAM_User_InfoIAM user information for the access token -
COOKIE_JRAUTH
cookie name: IAM authentication token- Siehe auch:
-
-
Konstruktordetails
-
PsaRstApiSvcBas
public PsaRstApiSvcBas()Constructor
-
-
Methodendetails
-
getData
get the request data- Gibt zurück:
- data
-
setConfig
public final void setConfig(de.pisa.psa.ifc.PsaDtoDat config) set the configuration- Parameter:
config
- configuration object
-
setEvent
public final void setEvent(de.pisa.psa.ifc.PsaDtoDat event) set the event- Parameter:
event
- event object
-
getRequestHeader
get a request header value- Parameter:
key
- key of the header- Gibt zurück:
- value
-
getRequestHeaders
get all request header- Gibt zurück:
- headers
-
getRequestCookie
get a cookie from the request- Parameter:
name
- name of the cookie- Gibt zurück:
- cookie
-
getRequestPath
get the request path- Gibt zurück:
- path
-
getRequestMethod
get the request method- Gibt zurück:
- method
-
getRequestQuery
get the request query string- Gibt zurück:
- query
-
getRequestLanguages
get the acceptable languages for this request- Gibt zurück:
- list of locale (e.g. de_DE, en_US)
-
getAuthorizationHeader
get the value of the Authorization header- Gibt zurück:
- prefix and token (Strings are never null)
-
newSsn
get a new session- Gibt zurück:
- session
- Löst aus:
Exception
-
handleRequest
protected javax.ws.rs.core.Response handleRequest(String gid, String body, String user, String language) throws Exception handle an incoming request- Parameter:
gid
- PSC_GID of the requested recordbody
- body of the requestuser
- the session user for the eventlanguage
- language of the data to return- Gibt zurück:
- the generated response
- Löst aus:
Exception
-
initialize
initialize the request- Parameter:
ssn
- session- Löst aus:
Exception
-
loadConfiguration
protected de.pisa.psa.ifc.PsaDtoDat loadConfiguration(de.pisa.psc.srv.glb.PscSsn ssn, String method, List<String> path_tokens) throws Exception load the configuration- Parameter:
ssn
- sessionmethod
- request methodpath_tokens
- request path tokens- Gibt zurück:
- configuration dto
- Löst aus:
Exception
-
validateKey
validate the authorization key- Parameter:
ssn
- session- Löst aus:
Exception
-
validateIAM
validate the IAM token- Parameter:
ssn
- session- Löst aus:
Exception
-
getIAMUserInfo
protected de.pisa.psa.com.dxhub.iam.UserInfo getIAMUserInfo(de.pisa.psc.srv.glb.PscSsn ssn, String account_id, String token) throws Exception get the IAM user information- Parameter:
ssn
- sessionaccount_id
- IAM account IDtoken
- IAM token- Gibt zurück:
- information
- Löst aus:
Exception
- if the token is invalid
-
getIAMUserInfo
protected final de.pisa.psa.com.dxhub.iam.UserInfo getIAMUserInfo()get the current IAM user information- Gibt zurück:
- information
-
createEvent
protected void createEvent(de.pisa.psc.srv.glb.PscSsn ssn, String gid, String body, String user, String language, boolean store) throws Exception create an event record- Parameter:
ssn
- sessiongid
- PSC_GID of the requested recordbody
- body of the requestuser
- the session user for the eventlanguage
- language of the data to returnstore
- store the event record in the database?- Löst aus:
Exception
-
getLanguageFromRequest
get the language identifier from the requests accepted languages- Parameter:
ssn
- session- Gibt zurück:
- identifier or an empty string if the locale is unknown
- Löst aus:
Exception
-
isSynchronous
check if the request should be handled synchronously- Gibt zurück:
- true for a synchronous handling
- Löst aus:
Exception
-
processEvent
start processing the current event- Gibt zurück:
- the generated response
- Löst aus:
Exception
-