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