Class MessagePolicy.TargetPolicy

java.lang.Object
jakarta.security.auth.message.MessagePolicy.TargetPolicy
Enclosing class:
MessagePolicy

public static class MessagePolicy.TargetPolicy extends Object
Associates a set of targets with a protection policy. A TargetPolicy defines the protection requirements for messages that match the specified targets.
  • Constructor Details

    • TargetPolicy

      public TargetPolicy(MessagePolicy.Target[] targets, MessagePolicy.ProtectionPolicy protectionPolicy)
      Creates a new TargetPolicy with the specified targets and protection policy.
      Parameters:
      targets - the array of Target objects, or null if not applicable
      protectionPolicy - the ProtectionPolicy to apply; must not be null
      Throws:
      IllegalArgumentException - if protectionPolicy is null
  • Method Details

    • getTargets

      public MessagePolicy.Target[] getTargets()
      Returns the targets associated with this target policy.
      Returns:
      an array of Target objects, or null if no targets are defined
    • getProtectionPolicy

      public MessagePolicy.ProtectionPolicy getProtectionPolicy()
      Returns the protection policy associated with this target policy.
      Returns:
      the ProtectionPolicy for this target policy