Klasse PsaRstApiSvcBas

java.lang.Object
de.pisa.psa.rst.svc.PsaRstApiSvcBas
Bekannte direkte Unterklassen:
IplWsvPsaRstApiSvc, IplWsvPsaRstApiTestSvc

public class PsaRstApiSvcBas extends Object
REST API: service base class
Seit:
23.05.2023
Autor:
weiland
  • Felddetails

    • Request

      @Context protected org.glassfish.jersey.server.ContainerRequest Request
      container request context
    • User

      protected String User
      the session user
    • IAM_Key

      protected String IAM_Key
      key for the IAM properties
    • IAM_Service

      protected String IAM_Service
      service URL for the IAM token
    • IAM_User_Info

      protected de.pisa.psa.com.dxhub.iam.UserInfo IAM_User_Info
      IAM user information for the access token
  • Konstruktordetails

    • PsaRstApiSvcBas

      public PsaRstApiSvcBas()
      Constructor
  • Methodendetails

    • getData

      public final PsaRstApiEvtHdlDat 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

      protected String getRequestHeader(String key)
      get a request header value
      Parameter:
      key - key of the header
      Gibt zurück:
      value
    • getRequestHeaders

      protected javax.ws.rs.core.MultivaluedMap<String,String> getRequestHeaders()
      get all request header
      Gibt zurück:
      headers
    • getRequestCookie

      protected Optional<javax.ws.rs.core.Cookie> getRequestCookie(String name)
      get a cookie from the request
      Parameter:
      name - name of the cookie
      Gibt zurück:
      cookie
    • getRequestPath

      protected String getRequestPath()
      get the request path
      Gibt zurück:
      path
    • getRequestMethod

      protected String getRequestMethod()
      get the request method
      Gibt zurück:
      method
    • getRequestQuery

      protected String getRequestQuery()
      get the request query string
      Gibt zurück:
      query
    • getRequestLanguages

      protected List<String> getRequestLanguages()
      get the acceptable languages for this request
      Gibt zurück:
      list of locale (e.g. de_DE, en_US)
    • getAuthorizationHeader

      protected String[] getAuthorizationHeader()
      get the value of the Authorization header
      Gibt zurück:
      prefix and token (Strings are never null)
    • newSsn

      protected de.pisa.psc.srv.glb.PscSsn newSsn() throws Exception
      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 record
      body - body of the request
      user - the session user for the event
      language - language of the data to return
      Gibt zurück:
      the generated response
      Löst aus:
      Exception
    • initialize

      protected void initialize(de.pisa.psc.srv.glb.PscSsn ssn) throws Exception
      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 - session
      method - request method
      path_tokens - request path tokens
      Gibt zurück:
      configuration dto
      Löst aus:
      Exception
    • validateKey

      protected void validateKey(de.pisa.psc.srv.glb.PscSsn ssn) throws Exception
      validate the authorization key
      Parameter:
      ssn - session
      Löst aus:
      Exception
    • validateIAM

      protected void validateIAM(de.pisa.psc.srv.glb.PscSsn ssn) throws Exception
      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 - session
      account_id - IAM account ID
      token - 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 - session
      gid - PSC_GID of the requested record
      body - body of the request
      user - the session user for the event
      language - language of the data to return
      store - store the event record in the database?
      Löst aus:
      Exception
    • getLanguageFromRequest

      protected String getLanguageFromRequest(de.pisa.psc.srv.glb.PscSsn ssn) throws Exception
      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

      protected boolean isSynchronous() throws Exception
      check if the request should be handled synchronously
      Gibt zurück:
      true for a synchronous handling
      Löst aus:
      Exception
    • processEvent

      public javax.ws.rs.core.Response processEvent() throws Exception
      start processing the current event
      Gibt zurück:
      the generated response
      Löst aus:
      Exception