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);
}
}
Aggregations