Search in sources :

Example 1 with InteractionManager

use of com.sun.identity.liberty.ws.interaction.InteractionManager in project OpenAM by OpenRock.

the class DSTClient method handleInteraction.

/**
     * Handles interaction request processing.
     * When the interaction is required, it throws and InteractRedirect
     * Exception, and redirect to the caller application(servlet). 
     */
private Message handleInteraction(Message requestMsg) throws DSTException, SOAPFaultException, SOAPBindingException, InteractionRedirectException {
    if (requestMsg == null || httpRequest == null || httpResponse == null || soapURI == null) {
        DSTUtils.debug.error("DSTClient:handeInteraction:null values");
        throw new DSTException(DSTUtils.bundle.getString("nullInputParams"));
    }
    DSTUtils.debug.message("DSTClient:handleInteraction:init");
    String resend = httpRequest.getParameter(InteractionManager.RESEND_MESSAGE);
    String returnURL = httpRequest.getRequestURL().toString();
    Message response;
    try {
        InteractionManager manager = InteractionManager.getInstance();
        if (resend == null) {
            //If the interaction is not required, this will send a
            // original response.
            response = manager.sendRequest(requestMsg, soapURI, certAlias, soapAction, returnURL, httpRequest, httpResponse);
        } else {
            response = manager.resendRequest(returnURL, httpRequest, httpResponse);
        }
        return response;
    } catch (InteractionRedirectException ire) {
        DSTUtils.debug.message("DSTClient:handleInteraction: Interaction" + "Redirection happened.");
        throw ire;
    } catch (InteractionException ie) {
        DSTUtils.debug.error("DSTClient:handleInteraction: Interaction" + " Error occured.", ie);
        throw new DSTException(ie);
    }
}
Also used : InteractionManager(com.sun.identity.liberty.ws.interaction.InteractionManager) InteractionException(com.sun.identity.liberty.ws.interaction.InteractionException) Message(com.sun.identity.liberty.ws.soapbinding.Message) InteractionRedirectException(com.sun.identity.liberty.ws.interaction.InteractionRedirectException)

Aggregations

InteractionException (com.sun.identity.liberty.ws.interaction.InteractionException)1 InteractionManager (com.sun.identity.liberty.ws.interaction.InteractionManager)1 InteractionRedirectException (com.sun.identity.liberty.ws.interaction.InteractionRedirectException)1 Message (com.sun.identity.liberty.ws.soapbinding.Message)1