1. /*
  2. * @(#)SubjectDelegationPermission.java 1.9 03/12/19
  3. *
  4. * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
  5. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
  6. */
  7. package javax.management.remote;
  8. import java.security.BasicPermission;
  9. /**
  10. * <p>Permission required by an authentication identity to perform
  11. * operations on behalf of an authorization identity.</p>
  12. *
  13. * <p>A SubjectDelegationPermission contains a name (also referred
  14. * to as a "target name") but no actions list; you either have the
  15. * named permission or you don't.</p>
  16. *
  17. * <p>The target name is the name of the authorization principal
  18. * classname followed by a period and the authorization principal
  19. * name, that is
  20. * <code>"<em>PrincipalClassName</em>.<em>PrincipalName</em>"</code>.</p>
  21. *
  22. * <p>An asterisk may appear by itself, or if immediately preceded
  23. * by a "." may appear at the end of the target name, to signify a
  24. * wildcard match.</p>
  25. *
  26. * <p>For example, "*", "javax.management.remote.JMXPrincipal.*" and
  27. * "javax.management.remote.JMXPrincipal.delegate" are valid target
  28. * names. The first one denotes any principal name from any principal
  29. * class, the second one denotes any principal name of the concrete
  30. * principal class <code>javax.management.remote.JMXPrincipal</code>
  31. * and the third one denotes a concrete principal name
  32. * <code>delegate</code> of the concrete principal class
  33. * <code>javax.management.remote.JMXPrincipal</code>.</p>
  34. *
  35. * @since 1.5
  36. * @since.unbundled 1.0
  37. */
  38. public final class SubjectDelegationPermission extends BasicPermission {
  39. private static final long serialVersionUID = 1481618113008682343L;
  40. /**
  41. * Creates a new SubjectDelegationPermission with the specified name.
  42. * The name is the symbolic name of the SubjectDelegationPermission.
  43. *
  44. * @param name the name of the SubjectDelegationPermission
  45. *
  46. * @throws NullPointerException if <code>name</code> is
  47. * <code>null</code>.
  48. * @throws IllegalArgumentException if <code>name</code> is empty.
  49. */
  50. public SubjectDelegationPermission(String name) {
  51. super(name);
  52. }
  53. /**
  54. * Creates a new SubjectDelegationPermission object with the
  55. * specified name. The name is the symbolic name of the
  56. * SubjectDelegationPermission, and the actions String is
  57. * currently unused and must be null.
  58. *
  59. * @param name the name of the SubjectDelegationPermission
  60. * @param actions must be null.
  61. *
  62. * @throws NullPointerException if <code>name</code> is
  63. * <code>null</code>.
  64. * @throws IllegalArgumentException if <code>name</code> is empty
  65. * or <code>actions</code> is not null.
  66. */
  67. public SubjectDelegationPermission(String name, String actions) {
  68. super(name, actions);
  69. if (actions != null)
  70. throw new IllegalArgumentException("Non-null actions");
  71. }
  72. }