com.sun.xml.ws.policy
Class PolicySubject

java.lang.Object
  extended by 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
PolicySubject(Object subject, Collection<Policy> policies)
          Constructs a policy subject instance.
PolicySubject(Object subject, Policy policy)
          Constructs a policy subject instance.
 
Method Summary
 void attach(Policy policy)
          Attaches another Policy instance to the policy subject.
 Policy getEffectivePolicy(PolicyMerger merger)
          Returns the effective policy of the subject, i.e.
 Object getSubject()
          A unique identifier of the subject Subjects may not always be uniquely identifiable.
 String toString()
          An Object.toString() method override.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

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 be null.
policy - first policy attached to the subject. Must not be null.
Throws:
IllegalArgumentException - in case any of the arguments is null.

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 be null.
policies - first policy attached to the subject. Must not be null.
Throws:
IllegalArgumentException - in case any of the arguments is null or in case policies argument 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 case policy argument is null.

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.


toString

public String toString()
An Object.toString() method override.

Overrides:
toString in class Object


Copyright © 2005-2015 Oracle Corporation. All Rights Reserved.