Search in sources :

Example 1 with InteractionSOAPFaultException

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

the class PPRequestHandler method initInteraction.

/**
     * Initialize interaction for the queries that require interaction
     * @param isQuery true if this is a <code>PP</code> query request, 
     *                false if this is a <code>PP</code> modify request.
     * @param interactResourceMap map of resources that need an interaction
     *                            This map will have key as the resource
     *                            and the value as interaction type. 
     * @param msg SOAP request message
     * @exception SOAPFaultException for interaction redirection
     * @exception IDPPException for any other failure.
     */
private void initInteraction(boolean isQuery, Map interactResourceMap, Message msg) throws SOAPFaultException, IDPPException {
    IDPPUtils.debug.message("PPRequestHandler.initInteraction:Init");
    if (msg == null || interactResourceMap == null || interactResourceMap.isEmpty()) {
        IDPPUtils.debug.error("PPRequestHandler.initInteraction:Null" + "Input parameters");
        throw new IDPPException(IDPPUtils.bundle.getString("nullInputParams"));
    }
    try {
        //Create Interaction inquiry element
        InquiryElement inquiry = JAXBObjectFactory.getObjectFactory().createInquiryElement();
        inquiry.setTitle(IDPPUtils.bundle.getString(IDPPConstants.INTERACTION_TITLE));
        List selectElements = inquiry.getSelectOrConfirmOrText();
        Set inquirySelects = interactResourceMap.keySet();
        Iterator iter = inquirySelects.iterator();
        while (iter.hasNext()) {
            String resource = (String) iter.next();
            String interactionType = (String) interactResourceMap.get(resource);
            if (interactionType.equals(IDPPConstants.INTERACT_FOR_CONSENT)) {
                selectElements.add(getInteractConfirmElement(isQuery, resource, msg));
            } else if (interactionType.equals(IDPPConstants.INTERACT_FOR_VALUE)) {
                selectElements.addAll(getInteractTextElements(isQuery, resource, msg));
            }
        }
        String lang = getLanguage(msg);
        if (LogUtil.isLogEnabled()) {
            String[] data = { logMsg };
            LogUtil.access(Level.INFO, LogUtil.PP_INTERACTION_SUCCESS, data);
        }
        InteractionManager.getInstance().handleInteraction(msg, inquiry, lang);
    } catch (InteractionSOAPFaultException ise) {
        if (IDPPUtils.debug.messageEnabled()) {
            IDPPUtils.debug.message("PPRequestHandler.initInteraction:" + "Interact redirection happened");
        }
        throw ise.getSOAPFaultException();
    } catch (Exception ex) {
        IDPPUtils.debug.error("PPRequestHandler.initInteraction:Failed");
        throw new IDPPException(ex);
    }
}
Also used : Set(java.util.Set) InquiryElement(com.sun.identity.liberty.ws.interaction.jaxb.InquiryElement) Iterator(java.util.Iterator) InteractionSOAPFaultException(com.sun.identity.liberty.ws.interaction.InteractionSOAPFaultException) ArrayList(java.util.ArrayList) List(java.util.List) SOAPFaultException(com.sun.identity.liberty.ws.soapbinding.SOAPFaultException) SOAPBindingException(com.sun.identity.liberty.ws.soapbinding.SOAPBindingException) JAXBException(javax.xml.bind.JAXBException) DSTException(com.sun.identity.liberty.ws.dst.DSTException) InteractionSOAPFaultException(com.sun.identity.liberty.ws.interaction.InteractionSOAPFaultException)

Aggregations

DSTException (com.sun.identity.liberty.ws.dst.DSTException)1 InteractionSOAPFaultException (com.sun.identity.liberty.ws.interaction.InteractionSOAPFaultException)1 InquiryElement (com.sun.identity.liberty.ws.interaction.jaxb.InquiryElement)1 SOAPBindingException (com.sun.identity.liberty.ws.soapbinding.SOAPBindingException)1 SOAPFaultException (com.sun.identity.liberty.ws.soapbinding.SOAPFaultException)1 ArrayList (java.util.ArrayList)1 Iterator (java.util.Iterator)1 List (java.util.List)1 Set (java.util.Set)1 JAXBException (javax.xml.bind.JAXBException)1