} else if ( POLICY_INTENT_MAP_QNAME.equals(name) ) {
QName providedIntent = getQName(reader, PROVIDES);
if ( qualifierName.equals(providedIntent.getLocalPart()) ) {
readIntentMap(reader, policySet, qualifiedIntent);
} else {
throw new ContributionReadException("Intent provided by IntentMap " +
providedIntent + " does not match parent qualifier " + qualifierName +
" in policyset - " + policySet);
}
}/* else if ( WS_POLICY_QNAME.equals(name) ) {
OMElement policyElement = loadElement(reader);
Policy wsPolicy = PolicyEngine.getPolicy(policyElement);
policySet.getPolicies().add(wsPolicy);
List<Object> policyList = mappedPolicies.get(qualifiedIntent);
if ( policyList == null ) {
policyList = new ArrayList<Object>();
mappedPolicies.put(qualifiedIntent, policyList);
if (qualifierName.equals(defaultQualifier)) {
mappedPolicies.put(mappedIntent, policyList);
}
}
policyList.add((Policy)wsPolicy);
}*/ else {
Object extension = extensionProcessor.read(reader);
if ( extension != null ) {
List<Object> policyList = mappedPolicies.get(qualifiedIntent);
if ( policyList == null ) {
policyList = new ArrayList<Object>();
mappedPolicies.put(qualifiedIntent, policyList);
if (qualifierName.equals(defaultQualifier)) {
mappedPolicies.put(mappedIntent, policyList);
}
}
policyList.add(extension);
}
}
break;
}
case END_ELEMENT : {
if ( POLICY_INTENT_MAP_QNAME.equals(reader.getName()) ) {
if ( defaultQualifier != null ) {
String qualifiedIntentName = mappedIntent.getName().getLocalPart() + QUALIFIER + defaultQualifier;
Intent defaultQualifiedIntent = policyFactory.createIntent();
defaultQualifiedIntent.setName(new QName(mappedIntent.getName().getNamespaceURI(),
qualifiedIntentName));
List<Object> policyList = mappedPolicies.get(defaultQualifiedIntent);
if ( policyList != null ) {
mappedPolicies.put(mappedIntent, policyList);
} else {
throw new ContributionReadException("Unable to map policies for default qualifier in IntentMap for - " +
mappedIntent + " in policy set - " + policySet);
}
defaultQualifier = null;
}
}
break;
}
}
if ( event == END_ELEMENT && POLICY_INTENT_MAP_QNAME.equals(reader.getName()) ) {
break;
}
//Read the next element
if (reader.hasNext()) {
reader.next();
}
}
} catch (XMLStreamException e) {
throw new ContributionReadException(e);
}
}
}