PolicySubjectpublic final class PolicySubject extends Object A PolicySubject is an entity (e.g., a port, operation, binding,
service) with which a policy can be associated. |
Fields Summary |
---|
private static final com.sun.xml.ws.policy.privateutil.PolicyLogger | LOGGER | private final List | policies | private final Object | subject |
Constructors Summary |
---|
public PolicySubject(Object subject, Policy policy)Constructs a policy subject instance.
if (subject == null || policy == null) {
throw LOGGER.logSevereException(new IllegalArgumentException(LocalizationMessages.WSP_0021_SUBJECT_AND_POLICY_PARAM_MUST_NOT_BE_NULL(subject, policy)));
}
this.subject = subject;
this.attach(policy);
| public PolicySubject(Object subject, Collection policies)Constructs a policy subject instance.
if (subject == null || policies == null) {
throw LOGGER.logSevereException(new IllegalArgumentException(LocalizationMessages.WSP_0062_INPUT_PARAMS_MUST_NOT_BE_NULL()));
}
if (policies.isEmpty()) {
throw LOGGER.logSevereException(new IllegalArgumentException(LocalizationMessages.WSP_0064_INITIAL_POLICY_COLLECTION_MUST_NOT_BE_EMPTY()));
}
this.subject = subject;
this.policies.addAll(policies);
|
Methods Summary |
---|
public void | attach(Policy policy)Attaches another Policy instance to the policy subject.
if (policy == null) {
throw LOGGER.logSevereException(new IllegalArgumentException(LocalizationMessages.WSP_0038_POLICY_TO_ATTACH_MUST_NOT_BE_NULL()));
}
this.policies.add(policy);
| public Policy | getEffectivePolicy(PolicyMerger merger)Returns the effective policy of the subject, i.e. all policies of the subject
merged together.
return merger.merge(policies);
| public Policy | getEffectivePolicy(java.util.Collection namespaces, PolicyMerger merger)Retrieve only the assertions of the effective policy that match the given set of
namespaces
final LinkedList<Policy> reducedPolicies = new LinkedList<Policy>();
for (Policy policy : policies) {
// Policy reducedPolicy = policy.reduce(namespaces);
// reducedPolicies.add(reducedPolicy);
}
return merger.merge(reducedPolicies);
| public java.lang.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.
return this.subject;
| 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);
final String innerIndent = PolicyUtils.Text.createIndent(indentLevel + 1);
buffer.append(indent).append("policy subject {").append(PolicyUtils.Text.NEW_LINE);
buffer.append(innerIndent).append("subject = '").append(subject).append('\'").append(PolicyUtils.Text.NEW_LINE);
for (Policy policy : policies) {
policy.toString(indentLevel + 1, buffer).append(PolicyUtils.Text.NEW_LINE);
}
buffer.append(indent).append('}");
return buffer;
|
|