use of com.sun.identity.policy.remote.PolicyNotification in project OpenAM by OpenRock.
the class PolicyNotificationHandler method processPLLNotifications.
/**
* Processes PLL notifications
* @param notifications PLL notification to be processed
*/
void processPLLNotifications(Vector notifications) {
for (int i = 0; i < notifications.size(); i++) {
Notification notification = (Notification) notifications.elementAt(i);
if (debug.messageEnabled()) {
debug.message("PolicyNotificationHandler." + "processPLLNotifications():" + "got notification: " + notification.getContent());
}
try {
PolicyService ps = PolicyService.parseXML(notification.getContent());
PolicyNotification pn = ps.getPolicyNotification();
if (pn != null) {
processPolicyNotification(pn);
}
} catch (PolicyException pe) {
debug.error("PolicyNotificationHandler." + "processPLLNotifications():" + "invalid notifcation format", pe);
}
}
}
use of com.sun.identity.policy.remote.PolicyNotification in project OpenAM by OpenRock.
the class ResultsCacheUtil method extractPolicyNotification.
/**
* Returns the notification XML node
*
* @param xml XML node
*
* @return XML Notification node
*
* @throws PolicyEvaluationException
*
*/
private static PolicyNotification extractPolicyNotification(String xml) throws PolicyEvaluationException {
PolicyNotification policyNotification = null;
try {
String notificationDataBlock = getNotificationDataBlock(xml);
if (notificationDataBlock != null) {
Document doc = XMLUtils.getXMLDocument(new ByteArrayInputStream(notificationDataBlock.getBytes()));
Node rootNode = XMLUtils.getRootNode(doc, NODE_POLICY_SERVICE);
if (rootNode != null) {
Node notificationNode = XMLUtils.getChildNode(rootNode, NODE_POLICY_NOTIFICATION);
if (notificationNode != null) {
policyNotification = PolicyNotification.parseXML(notificationNode);
} else {
debug.error("ResultsCacheUtil." + "extractPolicyNotification():" + "cannot find notification node");
throw new PolicyEvaluationException(ResBundleUtils.rbName, "invalid_root_element", null, null);
}
} else {
debug.error("ResultsCacheUtil." + "extractPolicyNotification():");
}
} else {
//null notification data block
debug.error("ResultsCacheUtil:" + "extractPolicyNotification():" + "notification data block is null");
}
} catch (Exception xe) {
debug.error("ResultsCacheUtil.extractPolicyNotification():", xe);
throw new PolicyEvaluationException(ResBundleUtils.rbName, "xml_parsing_error", null, xe);
}
return policyNotification;
}
Aggregations