public final class PolicySubject extends Object
| Constructor | Description |
|---|---|
PolicySubject(Object subject,
Policy policy) |
Constructs a policy subject instance.
|
PolicySubject(Object subject,
Collection<Policy> policies) |
Constructs a policy subject instance.
|
| Modifier and Type | Method | Description |
|---|---|---|
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. |
public PolicySubject(Object subject, Policy policy) throws IllegalArgumentException
subject - object to which the policies are attached. Must not be null.policy - first policy attached to the subject. Must not be null.IllegalArgumentException - in case any of the arguments is null.public PolicySubject(Object subject, Collection<Policy> policies) throws IllegalArgumentException
subject - object to which the policies are attached. Must not be null.policies - first policy attached to the subject. Must not be null.IllegalArgumentException - in case any of the arguments is null or
in case policies argument represents empty collection.public void attach(Policy policy)
policy - new policy instance to be attached to this subjectIllegalArgumentException - in case policy argument is null.public Policy getEffectivePolicy(PolicyMerger merger) throws PolicyException
PolicyExceptionpublic Object getSubject()
Copyright © 2006–2018 Oracle Corporation. All rights reserved.