1 /* Copyright 2004, 2005, 2006 Acegi Technology Pty Limited 2 * 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 package org.springframework.security.acls.sid; 16 17 import java.io.Serializable; 18 19 /** 20 * A security identity recognised by the ACL system. 21 * 22 * <p> 23 * This interface provides indirection between actual security objects (eg 24 * principals, roles, groups etc) and what is stored inside an 25 * <code>Acl</code>. This is because an <code>Acl</code> will not store an 26 * entire security object, but only an abstraction of it. This interface 27 * therefore provides a simple way to compare these abstracted security 28 * identities with other security identities and actual security objects. 29 * </p> 30 * 31 * @author Ben Alex 32 * @version $Id: Sid.java 2864 2008-04-05 05:58:11Z benalex $ 33 */ 34 public interface Sid extends Serializable { 35 //~ Methods ======================================================================================================== 36 37 /** 38 * Refer to the <code>java.lang.Object</code> documentation for the interface contract. 39 * 40 * @param obj to be compared 41 * 42 * @return <code>true</code> if the objects are equal, <code>false</code> otherwise 43 */ 44 boolean equals(Object obj); 45 46 /** 47 * Refer to the <code>java.lang.Object</code> documentation for the interface contract. 48 * 49 * @return a hash code representation of this object 50 */ 51 int hashCode(); 52 }