Package com.sun.xml.ws.policy
Class PolicySubject
- java.lang.Object
-
- com.sun.xml.ws.policy.PolicySubject
-
public final class PolicySubject extends Object
A PolicySubject is an entity (e.g., a port, operation, binding, service) with which a policy can be associated.- Author:
- Fabian Ritzmann
-
-
Constructor Summary
Constructors Constructor Description PolicySubject(Object subject, Policy policy)Constructs a policy subject instance.PolicySubject(Object subject, Collection<Policy> policies)Constructs a policy subject instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidattach(Policy policy)Attaches another Policy instance to the policy subject.PolicygetEffectivePolicy(PolicyMerger merger)Returns the effective policy of the subject, i.e.ObjectgetSubject()A unique identifier of the subject Subjects may not always be uniquely identifiable.StringtoString()AnObject.toString()method override.
-
-
-
Constructor Detail
-
PolicySubject
public PolicySubject(Object subject, Policy policy) throws IllegalArgumentException
Constructs a policy subject instance.- Parameters:
subject- object to which the policies are attached. Must not benull.policy- first policy attached to the subject. Must not benull.- Throws:
IllegalArgumentException- in case any of the arguments isnull.
-
PolicySubject
public PolicySubject(Object subject, Collection<Policy> policies) throws IllegalArgumentException
Constructs a policy subject instance.- Parameters:
subject- object to which the policies are attached. Must not benull.policies- first policy attached to the subject. Must not benull.- Throws:
IllegalArgumentException- in case any of the arguments isnullor in casepoliciesargument represents empty collection.
-
-
Method Detail
-
attach
public void attach(Policy policy)
Attaches another Policy instance to the policy subject.- Parameters:
policy- new policy instance to be attached to this subject- Throws:
IllegalArgumentException- in casepolicyargument isnull.
-
getEffectivePolicy
public Policy getEffectivePolicy(PolicyMerger merger) throws PolicyException
Returns the effective policy of the subject, i.e. all policies of the subject merged together.- Returns:
- effective policy of the subject
- Throws:
PolicyException
-
getSubject
public Object getSubject()
A unique identifier of the subject Subjects may not always be uniquely identifiable. Also, once the subject is assigned to a scope, its identity may not matter anymore. Therefore this may be null.
-
-