com.sun.xml.ws.rx.rm.policy.spi_impl.RmPolicyMapConfigurator Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of webservices-osgi Show documentation
Show all versions of webservices-osgi Show documentation
Metro Web Services Runtime OSGi Bundle
/*
* Copyright (c) 1997, 2021 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
* http://www.eclipse.org/org/documents/edl-v10.php.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
package com.sun.xml.ws.rx.rm.policy.spi_impl;
import com.sun.xml.ws.api.WSBinding;
import com.sun.xml.ws.api.model.SEIModel;
import com.sun.istack.logging.Logger;
import com.sun.xml.ws.policy.PolicyException;
import com.sun.xml.ws.policy.PolicyMap;
import com.sun.xml.ws.policy.PolicySubject;
import com.sun.xml.ws.policy.jaxws.spi.PolicyMapConfigurator;
import com.sun.xml.ws.rx.rm.api.ReliableMessagingFeature;
import java.util.Collection;
import java.util.LinkedList;
import java.util.logging.Level;
/**
*
*/
public class RmPolicyMapConfigurator implements PolicyMapConfigurator {
private static final Logger LOGGER = Logger.getLogger(RmPolicyMapConfigurator.class);
public Collection update(PolicyMap policyMap, SEIModel model, WSBinding wsBinding) throws PolicyException {
final Collection subjects = new LinkedList();
try {
LOGGER.entering(policyMap, model, wsBinding);
updateReliableMessagingSettings(subjects, wsBinding, model, policyMap);
return subjects;
} finally {
LOGGER.exiting(subjects);
}
}
private void updateReliableMessagingSettings(Collection subjects, WSBinding wsBinding, SEIModel model, PolicyMap policyMap) throws PolicyException, IllegalArgumentException {
final ReliableMessagingFeature feature = wsBinding.getFeature(ReliableMessagingFeature.class);
if (feature == null || !feature.isEnabled()) {
return;
}
if (LOGGER.isLoggable(Level.FINEST)) {
LOGGER.finest(String.format("Reliable messaging feature enabled on service '%s', port '%s'", model.getServiceQName(), model.getPortName()));
}
// TODO : update map with RM policy based on RM feature
}
}