Methods Summary |
---|
void | attach(PolicySubject subject)
if (subject == null) {
throw LOGGER.logSevereException(new IllegalArgumentException(LocalizationMessages.WSP_0020_SUBJECT_PARAM_MUST_NOT_BE_NULL()));
}
subjects.add(subject);
|
void | dettachAllSubjects()
subjects.clear();
|
Policy | getEffectivePolicy(PolicyMerger merger)Returns all policies of the scope merged into one policy
final LinkedList<Policy> policies = new LinkedList<Policy>();
for (PolicySubject subject : subjects) {
policies.add(subject.getEffectivePolicy(merger));
}
return merger.merge(policies);
|
Policy | getEffectivePolicy(java.util.Collection namespaces, PolicyMerger merger)Returns policies of the scope merged into one policy.
Only policies with vocabulary containing the namespaces provided are merged into effective policy.
final LinkedList<Policy> policies = new LinkedList<Policy>();
for (PolicySubject subject: subjects) {
policies.add(subject.getEffectivePolicy(namespaces, merger));
}
return merger.merge(policies);
|
java.util.Collection | getPolicySubjects()Returns all subjects contained by this scope
return this.subjects;
|
public java.lang.String | toString()An {@code Object.toString()} method override.
return toString(0, new StringBuffer()).toString();
|
java.lang.StringBuffer | toString(int indentLevel, java.lang.StringBuffer buffer)A helper method that appends indented string representation of this instance to the input string buffer.
final String indent = PolicyUtils.Text.createIndent(indentLevel);
buffer.append(indent).append("policy scope {").append(PolicyUtils.Text.NEW_LINE);
for (PolicySubject policySubject : subjects) {
policySubject.toString(indentLevel + 1, buffer).append(PolicyUtils.Text.NEW_LINE);
}
buffer.append(indent).append('}");
return buffer;
|