public final class PolicyMap extends java.lang.Object implements java.lang.Iterable<Policy>
| Modifier and Type | Class and Description |
|---|---|
private static class |
PolicyMap.ScopeMap |
(package private) static class |
PolicyMap.ScopeType |
| Modifier and Type | Field and Description |
|---|---|
private static PolicyMapKeyHandler |
endpointKeyHandler |
private PolicyMap.ScopeMap |
endpointMap |
private static PolicyMapKeyHandler |
faultMessageHandler |
private PolicyMap.ScopeMap |
faultMessageMap |
private PolicyMap.ScopeMap |
inputMessageMap |
private static PolicyLogger |
LOGGER |
private static PolicyMerger |
merger |
private static PolicyMapKeyHandler |
operationAndInputOutputMessageKeyHandler |
private PolicyMap.ScopeMap |
operationMap |
private PolicyMap.ScopeMap |
outputMessageMap |
private static PolicyMapKeyHandler |
serviceKeyHandler |
private PolicyMap.ScopeMap |
serviceMap |
| Modifier | Constructor and Description |
|---|---|
private |
PolicyMap()
This constructor is private to prevent direct instantiation from outside of the class
|
| Modifier and Type | Method and Description |
|---|---|
private void |
addSubjects(java.util.Collection<PolicySubject> subjects,
PolicyMap.ScopeMap scopeMap)
Add all subjects in the given map to the collection
|
private static PolicyMapKey |
createOperationOrInputOutputMessageKey(javax.xml.namespace.QName service,
javax.xml.namespace.QName port,
javax.xml.namespace.QName operation) |
static PolicyMap |
createPolicyMap(java.util.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(javax.xml.namespace.QName service,
javax.xml.namespace.QName port)
Creates an endpoint policy scope
PolicyMap where actual endpoint policy scope for given endpoint can be retrieved. |
static PolicyMapKey |
createWsdlFaultMessageScopeKey(javax.xml.namespace.QName service,
javax.xml.namespace.QName port,
javax.xml.namespace.QName operation,
javax.xml.namespace.QName fault)
Creates a fault message policy scope
PolicyMap where the actual fault message policy scope for one of the faults of a bound operation
can be retrieved. |
static PolicyMapKey |
createWsdlMessageScopeKey(javax.xml.namespace.QName service,
javax.xml.namespace.QName port,
javax.xml.namespace.QName operation)
Creates an input/output message policy scope
PolicyMap where actual input/output message policy scope for given input message of a bound operation
can be retrieved. |
static PolicyMapKey |
createWsdlOperationScopeKey(javax.xml.namespace.QName service,
javax.xml.namespace.QName port,
javax.xml.namespace.QName operation)
Creates an operation policy scope
PolicyMap where actual operation policy scope for given bound operation can be retrieved. |
static PolicyMapKey |
createWsdlServiceScopeKey(javax.xml.namespace.QName service)
Creates a service policy scope
PolicyMap where actual service policy scope for given service can be retrieved. |
java.util.Collection<PolicyMapKey> |
getAllEndpointScopeKeys()
Returns all endpoint scope keys stored in this policy map
|
java.util.Collection<PolicyMapKey> |
getAllFaultMessageScopeKeys()
Returns all fault message scope keys stored in this policy map
|
java.util.Collection<PolicyMapKey> |
getAllInputMessageScopeKeys()
Returns all input message scope keys stored in this policy map
|
java.util.Collection<PolicyMapKey> |
getAllOperationScopeKeys()
Returns all operation scope keys stored in this policy map
|
java.util.Collection<PolicyMapKey> |
getAllOutputMessageScopeKeys()
Returns all output message scope keys stored in this policy map
|
java.util.Collection<PolicyMapKey> |
getAllServiceScopeKeys()
Returns all service scope keys stored in this policy map
|
Policy |
getEndpointEffectivePolicy(PolicyMapKey key) |
Policy |
getFaultMessageEffectivePolicy(PolicyMapKey key) |
Policy |
getInputMessageEffectivePolicy(PolicyMapKey key) |
Policy |
getOperationEffectivePolicy(PolicyMapKey key) |
Policy |
getOutputMessageEffectivePolicy(PolicyMapKey key) |
java.util.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) |
java.util.Iterator<Policy> |
iterator() |
(package private) void |
putSubject(PolicyMap.ScopeType scopeType,
PolicyMapKey key,
PolicySubject subject)
Places new subject into policy map under the scope identified by it's type and policy map key.
|
(package private) void |
setNewEffectivePolicyForScope(PolicyMap.ScopeType scopeType,
PolicyMapKey key,
Policy newEffectivePolicy)
Replaces current effective policy on given scope (identified by a
key parameter) with the new efective
policy provided as a second input parameter. |
java.lang.String |
toString() |
private static final PolicyLogger LOGGER
private static final PolicyMapKeyHandler serviceKeyHandler
private static final PolicyMapKeyHandler endpointKeyHandler
private static final PolicyMapKeyHandler operationAndInputOutputMessageKeyHandler
private static final PolicyMapKeyHandler faultMessageHandler
private static final PolicyMerger merger
private final PolicyMap.ScopeMap serviceMap
private final PolicyMap.ScopeMap endpointMap
private final PolicyMap.ScopeMap operationMap
private final PolicyMap.ScopeMap inputMessageMap
private final PolicyMap.ScopeMap outputMessageMap
private final PolicyMap.ScopeMap faultMessageMap
private PolicyMap()
public static PolicyMap createPolicyMap(java.util.Collection<? extends PolicyMapMutator> mutators)
mutators - collection of mutators that should be connected to the newly created map.public Policy getServiceEffectivePolicy(PolicyMapKey key) throws PolicyException
PolicyExceptionpublic Policy getEndpointEffectivePolicy(PolicyMapKey key) throws PolicyException
PolicyExceptionpublic Policy getOperationEffectivePolicy(PolicyMapKey key) throws PolicyException
PolicyExceptionpublic Policy getInputMessageEffectivePolicy(PolicyMapKey key) throws PolicyException
PolicyExceptionpublic Policy getOutputMessageEffectivePolicy(PolicyMapKey key) throws PolicyException
PolicyExceptionpublic Policy getFaultMessageEffectivePolicy(PolicyMapKey key) throws PolicyException
PolicyExceptionpublic java.util.Collection<PolicyMapKey> getAllServiceScopeKeys()
public java.util.Collection<PolicyMapKey> getAllEndpointScopeKeys()
public java.util.Collection<PolicyMapKey> getAllOperationScopeKeys()
public java.util.Collection<PolicyMapKey> getAllInputMessageScopeKeys()
public java.util.Collection<PolicyMapKey> getAllOutputMessageScopeKeys()
public java.util.Collection<PolicyMapKey> getAllFaultMessageScopeKeys()
void putSubject(PolicyMap.ScopeType scopeType, PolicyMapKey key, PolicySubject subject)
scopeType - the type of the scope the subject belongs tokey - a policy map key to be used to store the subjectsubject - actual policy subject to be stored in the policy mapvoid setNewEffectivePolicyForScope(PolicyMap.ScopeType scopeType, PolicyMapKey key, Policy newEffectivePolicy) throws java.lang.IllegalArgumentException
key parameter) with the new efective
policy provided as a second input parameter. If no policy was defined for the presented key, the new policy is simply
stored with the key.scopeType - the type of the scope the subject belongs to. Must not be null.key - identifier of the scope the effective policy should be replaced with the new one. Must not be null.newEffectivePolicy - the new policy to replace the old effective policy of the scope. Must not be null.java.lang.IllegalArgumentExceptionpublic java.util.Collection<PolicySubject> getPolicySubjects()
public boolean isInputMessageSubject(PolicySubject subject)
public boolean isOutputMessageSubject(PolicySubject subject)
public boolean isFaultMessageSubject(PolicySubject subject)
public boolean isEmpty()
private void addSubjects(java.util.Collection<PolicySubject> subjects, PolicyMap.ScopeMap scopeMap)
subjects - A collection that should hold subjects. The new subjects are added to the collection. Must not be null.scopeMap - A scope map that holds policy scopes. The subjects are retrieved from the scope objects.public static PolicyMapKey createWsdlServiceScopeKey(javax.xml.namespace.QName service) throws java.lang.IllegalArgumentException
PolicyMap where actual service policy scope for given service can be retrieved.service - qualified name of the service. Must not be null.java.lang.IllegalArgumentException - in case service, port or operation parameter is null.public static PolicyMapKey createWsdlEndpointScopeKey(javax.xml.namespace.QName service, javax.xml.namespace.QName port) throws java.lang.IllegalArgumentException
PolicyMap where actual endpoint policy scope for given endpoint can be retrieved.service - qualified name of the service. Must not be null.port - qualified name of the endpoint. Must not be null.java.lang.IllegalArgumentException - in case service, port or operation parameter is null.public static PolicyMapKey createWsdlOperationScopeKey(javax.xml.namespace.QName service, javax.xml.namespace.QName port, javax.xml.namespace.QName operation) throws java.lang.IllegalArgumentException
PolicyMap where actual operation policy scope for given bound operation can be retrieved.service - qualified name of the service. Must not be null.port - qualified name of the endpoint. Must not be null.operation - qualified name of the operation. Must not be null.java.lang.IllegalArgumentException - in case service, port or operation parameter is null.public static PolicyMapKey createWsdlMessageScopeKey(javax.xml.namespace.QName service, javax.xml.namespace.QName port, javax.xml.namespace.QName operation) throws java.lang.IllegalArgumentException
PolicyMap 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 service - qualified name of the service. Must not be null.port - qualified name of the endpoint. Must not be null.operation - qualified name of the operation. Must not be null.java.lang.IllegalArgumentException - in case service, port or operation parameter is null.public static PolicyMapKey createWsdlFaultMessageScopeKey(javax.xml.namespace.QName service, javax.xml.namespace.QName port, javax.xml.namespace.QName operation, javax.xml.namespace.QName fault) throws java.lang.IllegalArgumentException
PolicyMap 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 service - qualified name of the service. Must not be null.port - qualified name of the endpoint. Must not be null.operation - qualified name of the operation. Must not be null.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 be null.java.lang.IllegalArgumentException - in case service, port or operation parameter is null.private static PolicyMapKey createOperationOrInputOutputMessageKey(javax.xml.namespace.QName service, javax.xml.namespace.QName port, javax.xml.namespace.QName operation)
public java.lang.String toString()
toString in class java.lang.Object