1. /*
  2. * @(#)PrincipalComparator.java 1.9 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 com.sun.security.auth;
  8. /**
  9. * An object that implements the <code>java.security.Principal</code>
  10. * interface typically also implements this interface to provide
  11. * a means for comparing that object to a specified <code>Subject</code>.
  12. *
  13. * <p> The comparison is achieved via the <code>implies</code> method.
  14. * The implementation of the <code>implies</code> method determines
  15. * whether this object "implies" the specified <code>Subject</code>.
  16. * One example application of this method may be for
  17. * a "group" object to imply a particular <code>Subject</code>
  18. * if that <code>Subject</code> belongs to the group.
  19. * Another example application of this method would be for
  20. * "role" object to imply a particular <code>Subject</code>
  21. * if that <code>Subject</code> is currently acting in that role.
  22. *
  23. * <p> Although classes that implement this interface typically
  24. * also implement the <code>java.security.Principal</code> interface,
  25. * it is not required. In other words, classes may implement the
  26. * <code>java.security.Principal</code> interface by itself,
  27. * the <code>PrincipalComparator</code> interface by itself,
  28. * or both at the same time.
  29. *
  30. * @version 1.9, 01/23/03
  31. * @see java.security.Principal
  32. * @see javax.security.auth.Subject
  33. */
  34. public interface PrincipalComparator {
  35. /**
  36. * Check if the specified <code>Subject</code> is implied by
  37. * this object.
  38. *
  39. * <p>
  40. *
  41. * @return true if the specified <code>Subject</code> is implied by
  42. * this object, or false otherwise.
  43. */
  44. boolean implies(javax.security.auth.Subject subject);
  45. }