Class PsaRstApiEvtHdlOut

    • Constructor Detail

      • PsaRstApiEvtHdlOut

        public PsaRstApiEvtHdlOut​(PsaRstApiEvtHdlDat data)
        Constructor
        Parameters:
        data - event data
    • Method Detail

      • setRequest

        public void setRequest​(de.pisa.psc.srv.rst.PscRstCli client,
                               java.lang.Object entity)
        set the request data
        Parameters:
        client - REST client
        entity - payload entity
      • setRequestPath

        public void setRequestPath​(java.lang.String path)
        set the request path
        Parameters:
        path - path
      • getRequestPath

        public java.lang.String getRequestPath()
        get the request path
        Returns:
        path
      • setRequestBody

        public void setRequestBody​(java.lang.Object body)
        set the request body
        Parameters:
        body - body
      • getRequestBody

        public java.lang.String getRequestBody()
        get the request body
        Returns:
        body
      • setRequestHeader

        public void setRequestHeader​(java.lang.String header)
        set the request header
        Parameters:
        header - header
      • getRequestHeader

        public java.lang.String getRequestHeader()
        get the request header
        Returns:
        header
      • setIAMKey

        public void setIAMKey​(java.lang.String key)
        get the key for the IAM properties
        Parameters:
        key - key
      • getIAMKey

        public java.lang.String getIAMKey()
        set the key for the IAM properties
        Returns:
        key
      • sendRequest

        public javax.ws.rs.core.Response sendRequest​(javax.ws.rs.core.Response record)
                                              throws java.lang.Exception
        send a REST request
        Parameters:
        record - record data to send
        Returns:
        response of the called end point
        Throws:
        java.lang.Exception
      • newRestClient

        protected de.pisa.psc.srv.rst.PscRstCli newRestClient​(java.lang.String url)
                                                       throws java.net.URISyntaxException
        create a new REST client
        Parameters:
        url - target URL
        Returns:
        client
        Throws:
        java.net.URISyntaxException
      • sendRequest

        public javax.ws.rs.core.Response sendRequest​(java.lang.Object entity,
                                                     javax.ws.rs.core.MediaType type)
                                              throws java.lang.Exception
        send a REST request
        Parameters:
        entity - payload entity
        type - media type of the entity
        Returns:
        response of the called end point
        Throws:
        java.lang.Exception
      • setAuthorization

        protected void setAuthorization​(de.pisa.psc.srv.rst.PscRstCli client)
                                 throws java.lang.Exception
        set the authorization for the REST client
        Parameters:
        client - REST client
        Throws:
        java.lang.Exception
      • getEntity

        protected javax.ws.rs.client.Entity<?> getEntity​(java.lang.Object entity,
                                                         javax.ws.rs.core.MediaType type)
        get an entity
        Parameters:
        entity - entity object
        type - type of the entity
        Returns:
        entity
      • sendPostRequest

        protected javax.ws.rs.core.Response sendPostRequest​(de.pisa.psc.srv.rst.PscRstCli client,
                                                            java.lang.Object entity,
                                                            javax.ws.rs.core.MediaType type)
                                                     throws java.lang.Exception
        send a POST request
        Parameters:
        client - REST client
        entity - payload entity
        type - media type of the entity
        Returns:
        response of the called end point
        Throws:
        java.lang.Exception
      • sendPutRequest

        protected javax.ws.rs.core.Response sendPutRequest​(de.pisa.psc.srv.rst.PscRstCli client,
                                                           java.lang.Object entity,
                                                           javax.ws.rs.core.MediaType type)
                                                    throws java.lang.Exception
        send a PUT request
        Parameters:
        client - REST client
        entity - payload entity
        type - media type of the entity
        Returns:
        response of the called end point
        Throws:
        java.lang.Exception
      • sendPatchRequest

        protected javax.ws.rs.core.Response sendPatchRequest​(de.pisa.psc.srv.rst.PscRstCli client,
                                                             java.lang.Object entity,
                                                             javax.ws.rs.core.MediaType type)
                                                      throws java.lang.Exception
        send a PATCH request
        Parameters:
        client - REST client
        entity - payload entity
        type - media type of the entity
        Returns:
        response of the called end point
        Throws:
        java.lang.Exception
      • sendGetRequest

        protected javax.ws.rs.core.Response sendGetRequest​(de.pisa.psc.srv.rst.PscRstCli client,
                                                           java.lang.Object entity,
                                                           javax.ws.rs.core.MediaType type)
                                                    throws java.lang.Exception
        send a GET request
        Parameters:
        client - REST client
        entity - payload entity
        type - media type of the entity
        Returns:
        response of the called end point
        Throws:
        java.lang.Exception
      • sendDeleteRequest

        protected javax.ws.rs.core.Response sendDeleteRequest​(de.pisa.psc.srv.rst.PscRstCli client,
                                                              java.lang.Object entity,
                                                              javax.ws.rs.core.MediaType type)
                                                       throws java.lang.Exception
        send a DELETE request
        Parameters:
        client - REST client
        entity - payload entity
        type - media type of the entity
        Returns:
        response of the called end point
        Throws:
        java.lang.Exception