Class ServerQDLScriptHandler

  • All Implemented Interfaces:
    Serializable, org.oa4mp.delegation.server.jwt.PayloadHandler

    public class ServerQDLScriptHandler
    extends Object
    implements org.oa4mp.delegation.server.jwt.PayloadHandler
    This is a handler for all scripts that the user may set in the configuration. These scripts are run before any that the client defines so this is the first handler if present. Mostly this is vessel for conveying the scripts.

    Created by Jeff Gaynor
    on 4/30/22 at 5:52 AM

    See Also:
    Serialized Form
    • Method Detail

      • init

        public void init()
                  throws Throwable
        Specified by:
        init in interface org.oa4mp.delegation.server.jwt.PayloadHandler
        Throws:
        Throwable
      • refresh

        public void refresh()
                     throws Throwable
        Specified by:
        refresh in interface org.oa4mp.delegation.server.jwt.PayloadHandler
        Throws:
        Throwable
      • addRequestState

        public void addRequestState​(edu.uiuc.ncsa.security.util.scripting.ScriptRunRequest req)
                             throws Throwable
        For the server script, request everything. This allows for complete access as needed, so if a script, e.g., wants to set up all values in the pre_auth stage, it can do it once and be done, rather than require it to set it in increments.
        Specified by:
        addRequestState in interface org.oa4mp.delegation.server.jwt.PayloadHandler
        Parameters:
        req -
        Throws:
        Throwable
      • getRTData

        public net.sf.json.JSONObject getRTData()
      • setRTData

        public void setRTData​(net.sf.json.JSONObject rtData)
      • checkClaims

        public void checkClaims()
                         throws Throwable
        Specified by:
        checkClaims in interface org.oa4mp.delegation.server.jwt.PayloadHandler
        Throws:
        Throwable
      • getSources

        public List<org.oa4mp.delegation.server.server.claims.ClaimSource> getSources()
                                                                               throws Throwable
        Must be empty since there are no sources
        Specified by:
        getSources in interface org.oa4mp.delegation.server.jwt.PayloadHandler
        Returns:
        Throws:
        Throwable
      • execute

        public net.sf.json.JSONObject execute​(org.oa4mp.delegation.server.server.claims.ClaimSource source,
                                              net.sf.json.JSONObject claims)
                                       throws Throwable
        Specified by:
        execute in interface org.oa4mp.delegation.server.jwt.PayloadHandler
        Throws:
        Throwable
      • finish

        public void finish​(String execPhase)
                    throws Throwable
        Specified by:
        finish in interface org.oa4mp.delegation.server.jwt.PayloadHandler
        Throws:
        Throwable
      • saveState

        public void saveState​(String execPhase)
                       throws Throwable
        Specified by:
        saveState in interface org.oa4mp.delegation.server.jwt.PayloadHandler
        Throws:
        Throwable
      • getUserMetaData

        public net.sf.json.JSONObject getUserMetaData()
      • setClaims

        public void setClaims​(net.sf.json.JSONObject claims)
      • getExtendedAttributes

        public net.sf.json.JSONObject getExtendedAttributes()
        Gets the extended attributes from the current transaction. See OA2ServiceTransaction.getExtendedAttributes() for more.
        Specified by:
        getExtendedAttributes in interface org.oa4mp.delegation.server.jwt.PayloadHandler
        Returns:
      • setExtendedAttributes

        public void setExtendedAttributes​(net.sf.json.JSONObject extendedAttributes)
      • setAccountingInformation

        public void setAccountingInformation()
        Specified by:
        setAccountingInformation in interface org.oa4mp.delegation.server.jwt.PayloadHandler
      • refreshAccountingInformation

        public void refreshAccountingInformation()
        Specified by:
        refreshAccountingInformation in interface org.oa4mp.delegation.server.jwt.PayloadHandler
      • getPhCfg

        public ServerQDLScriptHandlerConfig getPhCfg()
        Specified by:
        getPhCfg in interface org.oa4mp.delegation.server.jwt.PayloadHandler
      • setPhCfg

        public void setPhCfg​(org.oa4mp.delegation.server.jwt.PayloadHandlerConfig phCfg)
        Specified by:
        setPhCfg in interface org.oa4mp.delegation.server.jwt.PayloadHandler
      • hasScript

        public boolean hasScript()
        Specified by:
        hasScript in interface org.oa4mp.delegation.server.jwt.PayloadHandler
      • setResponseCode

        public void setResponseCode​(int responseCode)
        Specified by:
        setResponseCode in interface org.oa4mp.delegation.server.jwt.PayloadHandler
      • getResponseCode

        public int getResponseCode()
        Specified by:
        getResponseCode in interface org.oa4mp.delegation.server.jwt.PayloadHandler
      • getAtData

        public net.sf.json.JSONObject getAtData()
      • setAtData

        public void setAtData​(net.sf.json.JSONObject atData)
      • handleResponse

        public void handleResponse​(edu.uiuc.ncsa.security.util.scripting.ScriptRunResponse resp)
                            throws Throwable
        Specified by:
        handleResponse in interface org.oa4mp.delegation.server.jwt.PayloadHandler
        Throws:
        Throwable
      • getPayload

        public net.sf.json.JSONObject getPayload()
        Specified by:
        getPayload in interface org.oa4mp.delegation.server.jwt.PayloadHandler
      • setPayload

        public void setPayload​(net.sf.json.JSONObject payload)
        Specified by:
        setPayload in interface org.oa4mp.delegation.server.jwt.PayloadHandler
      • getSignedPayload

        public TokenImpl getSignedPayload​(edu.uiuc.ncsa.security.util.jwk.JSONWebKey key)
        Specified by:
        getSignedPayload in interface org.oa4mp.delegation.server.jwt.PayloadHandler
      • getSignedPayload

        public TokenImpl getSignedPayload​(edu.uiuc.ncsa.security.util.jwk.JSONWebKey key,
                                          String headerType)
        Specified by:
        getSignedPayload in interface org.oa4mp.delegation.server.jwt.PayloadHandler