Class MessagePolicy.TargetPolicy
java.lang.Object
jakarta.security.auth.message.MessagePolicy.TargetPolicy
- Enclosing class:
MessagePolicy
Associates a set of targets with a protection policy. A
TargetPolicy defines the protection requirements for
messages that match the specified targets.-
Constructor Summary
ConstructorsConstructorDescriptionTargetPolicy(MessagePolicy.Target[] targets, MessagePolicy.ProtectionPolicy protectionPolicy) Creates a newTargetPolicywith the specified targets and protection policy. -
Method Summary
Modifier and TypeMethodDescriptionReturns the protection policy associated with this target policy.Returns the targets associated with this target policy.
-
Constructor Details
-
TargetPolicy
public TargetPolicy(MessagePolicy.Target[] targets, MessagePolicy.ProtectionPolicy protectionPolicy) Creates a newTargetPolicywith the specified targets and protection policy.- Parameters:
targets- the array ofTargetobjects, ornullif not applicableprotectionPolicy- theProtectionPolicyto apply; must not benull- Throws:
IllegalArgumentException- ifprotectionPolicyisnull
-
-
Method Details
-
getTargets
Returns the targets associated with this target policy.- Returns:
- an array of
Targetobjects, ornullif no targets are defined
-
getProtectionPolicy
Returns the protection policy associated with this target policy.- Returns:
- the
ProtectionPolicyfor this target policy
-