Package javax.security.auth.message
Class MessagePolicy.TargetPolicy
java.lang.Object
javax.security.auth.message.MessagePolicy.TargetPolicy
- Enclosing class:
- MessagePolicy
This class defines the message protection policies for specific Targets.
This class is used to associate a message protection policy with targets within a message. Message targets are represented using an implementation of the Target interface matched to the message types in MessageInfo. The message protection policy is identified by an implementation of the ProtectionPolicy interface.
- See Also:
-
Constructor Summary
ConstructorDescriptionTargetPolicy
(MessagePolicy.Target[] targets, MessagePolicy.ProtectionPolicy protectionPolicy) Create a TargetPolicy instance with an array of Targets and with a ProtectionPolicy. -
Method Summary
Modifier and TypeMethodDescriptionGet the ProtectionPolicy that applies to the targets.Get the array of layer-specific target descriptors that identify the one or more message parts to which the specified message protection policy applies.
-
Constructor Details
-
TargetPolicy
public TargetPolicy(MessagePolicy.Target[] targets, MessagePolicy.ProtectionPolicy protectionPolicy) Create a TargetPolicy instance with an array of Targets and with a ProtectionPolicy.- Parameters:
targets
- An array of Targets. This argument may be null.protectionPolicy
- The object that describes the message authentication policy that applies to the targets.- Throws:
IllegalArgumentException
- if the specified targets or protectionPolicy is null.
-
-
Method Details
-
getTargets
Get the array of layer-specific target descriptors that identify the one or more message parts to which the specified message protection policy applies.- Returns:
- An array of Target that identify targets within a message. This method returns null when the specified policy applies to the whole message (excluding any metadata added to the message to satisfy the policy). This method never returns a zero-length array.
-
getProtectionPolicy
Get the ProtectionPolicy that applies to the targets.- Returns:
- A ProtectionPolicy object that identifies the message authentication requirements that apply to the targets.
-