1. /*
  2. * @(#)LoggingPermission.java 1.7 03/01/23
  3. *
  4. * Copyright 2003 Sun Microsystems, Inc. All rights reserved.
  5. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
  6. */
  7. package java.util.logging;
  8. import java.security.*;
  9. /**
  10. * The permission which the SecurityManager will check when code
  11. * that is running with a SecurityManager calls one of the logging
  12. * control methods (such as Logger.setLevel).
  13. * <p>
  14. * Currently there is only one named LoggingPermission. This is "control"
  15. * and it grants the ability to control the logging configuration, for
  16. * example by adding or removing Handlers, by adding or removing Filters,
  17. * or by changing logging levels.
  18. * <p>
  19. * Programmers do not normally create LoggingPermission objects directly.
  20. * Instead they are created by the security policy code based on reading
  21. * the security policy file.
  22. *
  23. *
  24. * @version 1.7, 01/23/03
  25. * @since 1.4
  26. * @see java.security.BasicPermission
  27. * @see java.security.Permission
  28. * @see java.security.Permissions
  29. * @see java.security.PermissionCollection
  30. * @see java.lang.SecurityManager
  31. *
  32. */
  33. public final class LoggingPermission extends java.security.BasicPermission {
  34. /**
  35. * Creates a new LoggingPermission object.
  36. *
  37. * @param name Permission name. Must be "control".
  38. * @param actions Must be either null or the empty string.
  39. * @throws IllegalArgumentException if arguments are invalid
  40. */
  41. public LoggingPermission(String name, String actions) throws IllegalArgumentException {
  42. super(name);
  43. if (!name.equals("control")) {
  44. throw new IllegalArgumentException("name: " + name);
  45. }
  46. if (actions != null && actions.length() > 0) {
  47. throw new IllegalArgumentException("actions: " + actions);
  48. }
  49. }
  50. }