Package com.sun.xml.ws.policy
Class PolicyMap
- java.lang.Object
-
- com.sun.xml.ws.policy.PolicyMap
-
public final class PolicyMap extends Object implements Iterable<Policy>
A PolicyMap holds all policies for a scope. This map is modeled around WSDL 1.1 policy scopes according to WS-PolicyAttachment. The map holds an information about every scope for service, endpoint, operation, and input/output/fault message. It also provide accessibility methods for computing and obtaining effective policy on each scope. TODO: rename createWsdlMessageScopeKey to createWsdlInputOutputMessageScopeKey- Author:
- Fabian Ritzmann
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static PolicyMap
createPolicyMap(Collection<? extends PolicyMapMutator> mutators)
Creates new policy map instance and connects provided collection of policy map mutators to the created policy map.static PolicyMapKey
createWsdlEndpointScopeKey(QName service, QName port)
Creates an endpoint policy scope locator object, that serves as a access key into aPolicyMap
where actual endpoint policy scope for given endpoint can be retrieved.static PolicyMapKey
createWsdlFaultMessageScopeKey(QName service, QName port, QName operation, QName fault)
Creates a fault message policy scope locator object identified by a bound operation, that serves as a access key intoPolicyMap
where the actual fault message policy scope for one of the faults of a bound operation can be retrieved.static PolicyMapKey
createWsdlMessageScopeKey(QName service, QName port, QName operation)
Creates an input/output message policy scope locator object identified by a bound operation, that serves as a access key intoPolicyMap
where actual input/output message policy scope for given input message of a bound operation can be retrieved.static PolicyMapKey
createWsdlOperationScopeKey(QName service, QName port, QName operation)
Creates an operation policy scope locator object, that serves as a access key into aPolicyMap
where actual operation policy scope for given bound operation can be retrieved.static PolicyMapKey
createWsdlServiceScopeKey(QName service)
Creates a service policy scope locator object, that serves as a access key into aPolicyMap
where actual service policy scope for given service can be retrieved.Collection<PolicyMapKey>
getAllEndpointScopeKeys()
Returns all endpoint scope keys stored in this policy mapCollection<PolicyMapKey>
getAllFaultMessageScopeKeys()
Returns all fault message scope keys stored in this policy mapCollection<PolicyMapKey>
getAllInputMessageScopeKeys()
Returns all input message scope keys stored in this policy mapCollection<PolicyMapKey>
getAllOperationScopeKeys()
Returns all operation scope keys stored in this policy mapCollection<PolicyMapKey>
getAllOutputMessageScopeKeys()
Returns all output message scope keys stored in this policy mapCollection<PolicyMapKey>
getAllServiceScopeKeys()
Returns all service scope keys stored in this policy mapPolicy
getEndpointEffectivePolicy(PolicyMapKey key)
Policy
getFaultMessageEffectivePolicy(PolicyMapKey key)
Policy
getInputMessageEffectivePolicy(PolicyMapKey key)
Policy
getOperationEffectivePolicy(PolicyMapKey key)
Policy
getOutputMessageEffectivePolicy(PolicyMapKey key)
Collection<PolicySubject>
getPolicySubjects()
Returns all policy subjects contained by this map.Policy
getServiceEffectivePolicy(PolicyMapKey key)
boolean
isEmpty()
Returns true if this map contains no key - policy pairs A null object key or policy constitutes a non-empty map.boolean
isFaultMessageSubject(PolicySubject subject)
boolean
isInputMessageSubject(PolicySubject subject)
boolean
isOutputMessageSubject(PolicySubject subject)
Iterator<Policy>
iterator()
String
toString()
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Method Detail
-
createPolicyMap
public static PolicyMap createPolicyMap(Collection<? extends PolicyMapMutator> mutators)
Creates new policy map instance and connects provided collection of policy map mutators to the created policy map.- Parameters:
mutators
- collection of mutators that should be connected to the newly created map.- Returns:
- new policy map instance (mutable via provided collection of mutators).
-
getServiceEffectivePolicy
public Policy getServiceEffectivePolicy(PolicyMapKey key) throws PolicyException
- Throws:
PolicyException
-
getEndpointEffectivePolicy
public Policy getEndpointEffectivePolicy(PolicyMapKey key) throws PolicyException
- Throws:
PolicyException
-
getOperationEffectivePolicy
public Policy getOperationEffectivePolicy(PolicyMapKey key) throws PolicyException
- Throws:
PolicyException
-
getInputMessageEffectivePolicy
public Policy getInputMessageEffectivePolicy(PolicyMapKey key) throws PolicyException
- Throws:
PolicyException
-
getOutputMessageEffectivePolicy
public Policy getOutputMessageEffectivePolicy(PolicyMapKey key) throws PolicyException
- Throws:
PolicyException
-
getFaultMessageEffectivePolicy
public Policy getFaultMessageEffectivePolicy(PolicyMapKey key) throws PolicyException
- Throws:
PolicyException
-
getAllServiceScopeKeys
public Collection<PolicyMapKey> getAllServiceScopeKeys()
Returns all service scope keys stored in this policy map- Returns:
- collection of service scope policy map keys stored in the map.
-
getAllEndpointScopeKeys
public Collection<PolicyMapKey> getAllEndpointScopeKeys()
Returns all endpoint scope keys stored in this policy map- Returns:
- collection of endpoint scope policy map keys stored in the map.
-
getAllOperationScopeKeys
public Collection<PolicyMapKey> getAllOperationScopeKeys()
Returns all operation scope keys stored in this policy map- Returns:
- collection of operation scope policy map keys stored in the map.
-
getAllInputMessageScopeKeys
public Collection<PolicyMapKey> getAllInputMessageScopeKeys()
Returns all input message scope keys stored in this policy map- Returns:
- collection of input message scope policy map keys stored in the map.
-
getAllOutputMessageScopeKeys
public Collection<PolicyMapKey> getAllOutputMessageScopeKeys()
Returns all output message scope keys stored in this policy map- Returns:
- collection of output message scope policy map keys stored in the map.
-
getAllFaultMessageScopeKeys
public Collection<PolicyMapKey> getAllFaultMessageScopeKeys()
Returns all fault message scope keys stored in this policy map- Returns:
- collection of input message scope policy map keys stored in the map.
-
getPolicySubjects
public Collection<PolicySubject> getPolicySubjects()
Returns all policy subjects contained by this map.- Returns:
- All policy subjects contained by this map
-
isInputMessageSubject
public boolean isInputMessageSubject(PolicySubject subject)
-
isOutputMessageSubject
public boolean isOutputMessageSubject(PolicySubject subject)
-
isFaultMessageSubject
public boolean isFaultMessageSubject(PolicySubject subject)
-
isEmpty
public boolean isEmpty()
Returns true if this map contains no key - policy pairs A null object key or policy constitutes a non-empty map.- Returns:
- true if this map contains no key - policy pairs
-
createWsdlServiceScopeKey
public static PolicyMapKey createWsdlServiceScopeKey(QName service) throws IllegalArgumentException
Creates a service policy scope locator object, that serves as a access key into aPolicyMap
where actual service policy scope for given service can be retrieved.- Parameters:
service
- qualified name of the service. Must not benull
.- Throws:
IllegalArgumentException
- in case service, port or operation parameter isnull
.
-
createWsdlEndpointScopeKey
public static PolicyMapKey createWsdlEndpointScopeKey(QName service, QName port) throws IllegalArgumentException
Creates an endpoint policy scope locator object, that serves as a access key into aPolicyMap
where actual endpoint policy scope for given endpoint can be retrieved.- Parameters:
service
- qualified name of the service. Must not benull
.port
- qualified name of the endpoint. Must not benull
.- Throws:
IllegalArgumentException
- in case service, port or operation parameter isnull
.
-
createWsdlOperationScopeKey
public static PolicyMapKey createWsdlOperationScopeKey(QName service, QName port, QName operation) throws IllegalArgumentException
Creates an operation policy scope locator object, that serves as a access key into aPolicyMap
where actual operation policy scope for given bound operation can be retrieved.- Parameters:
service
- qualified name of the service. Must not benull
.port
- qualified name of the endpoint. Must not benull
.operation
- qualified name of the operation. Must not benull
.- Throws:
IllegalArgumentException
- in case service, port or operation parameter isnull
.
-
createWsdlMessageScopeKey
public static PolicyMapKey createWsdlMessageScopeKey(QName service, QName port, QName operation) throws IllegalArgumentException
Creates an input/output message policy scope locator object identified by a bound operation, that serves as a access key intoPolicyMap
where actual input/output message policy scope for given input message of a bound operation can be retrieved.
The method returns a key that is compliant with WSDL 1.1 Basic Profile Specification, according to which there should be no two operations with the same name in a single port type definition.- Parameters:
service
- qualified name of the service. Must not benull
.port
- qualified name of the endpoint. Must not benull
.operation
- qualified name of the operation. Must not benull
.- Throws:
IllegalArgumentException
- in case service, port or operation parameter isnull
.
-
createWsdlFaultMessageScopeKey
public static PolicyMapKey createWsdlFaultMessageScopeKey(QName service, QName port, QName operation, QName fault) throws IllegalArgumentException
Creates a fault message policy scope locator object identified by a bound operation, that serves as a access key intoPolicyMap
where the actual fault message policy scope for one of the faults of a bound operation can be retrieved.
The method returns a key that is compliant with the WSDL 1.1 Basic Profile Specification, according to which there should be no two operations with the same name in a single port type definition.- Parameters:
service
- qualified name of the service. Must not benull
.port
- qualified name of the endpoint. Must not benull
.operation
- qualified name of the operation. Must not benull
.fault
- qualified name of the fault. Do not confuse this with the name of the actual message. This parameter takes the wsdl:binding/wsdl:operation/wsdl:fault name and not the wsdl:message name. Must not benull
.- Throws:
IllegalArgumentException
- in case service, port or operation parameter isnull
.
-
-