use of com.sun.xml.ws.api.fastinfoset.FastInfosetFeature in project metro-jax-ws by eclipse-ee4j.
the class FastInfosetFeatureConfigurator method getFeatures.
/**
* Process FastInfoset policy assertions.
*
* @param key Key to identify the endpoint scope.
* @param policyMap the policy map.
* @throws PolicyException If retrieving the policy triggered an exception.
*/
public Collection<WebServiceFeature> getFeatures(final PolicyMapKey key, final PolicyMap policyMap) throws PolicyException {
final Collection<WebServiceFeature> features = new LinkedList<>();
if ((key != null) && (policyMap != null)) {
Policy policy = policyMap.getEndpointEffectivePolicy(key);
if (null != policy && policy.contains(EncodingConstants.OPTIMIZED_FI_SERIALIZATION_ASSERTION)) {
Iterator<AssertionSet> assertions = policy.iterator();
while (assertions.hasNext()) {
AssertionSet assertionSet = assertions.next();
Iterator<PolicyAssertion> policyAssertion = assertionSet.iterator();
while (policyAssertion.hasNext()) {
PolicyAssertion assertion = policyAssertion.next();
if (EncodingConstants.OPTIMIZED_FI_SERIALIZATION_ASSERTION.equals(assertion.getName())) {
String value = assertion.getAttributeValue(enabled);
boolean isFastInfosetEnabled = Boolean.valueOf(value.trim());
features.add(new FastInfosetFeature(isFastInfosetEnabled));
}
// end-if non optional fast infoset assertion found
}
// next assertion
}
// next alternative
}
// end-if policy contains fast infoset assertion
}
return features;
}
Aggregations