001/**
002 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
003 *
004 * Copyright (c) 2005 Sun Microsystems Inc. All Rights Reserved
005 *
006 * The contents of this file are subject to the terms
007 * of the Common Development and Distribution License
008 * (the License). You may not use this file except in
009 * compliance with the License.
010 *
011 * You can obtain a copy of the License at
012 * https://opensso.dev.java.net/public/CDDLv1.0.html or
013 * opensso/legal/CDDLv1.0.txt
014 * See the License for the specific language governing
015 * permission and limitations under the License.
016 *
017 * When distributing Covered Code, include this CDDL
018 * Header Notice in each file and include the License file
019 * at opensso/legal/CDDLv1.0.txt.
020 * If applicable, add the following below the CDDL Header,
021 * with the fields enclosed by brackets [] replaced by
022 * your own identifying information:
023 * "Portions Copyrighted [year] [name of copyright owner]"
024 *
025 * $Id: SSOTokenID.java,v 1.3 2008/08/15 01:05:20 veiming Exp $
026 *
027 */
028
029package com.iplanet.sso;
030
031/**
032 * The <code>SSOTokenID</code> is an interface that is used to identify a single
033 * sign on token object. It contains a random string and the name of the server.
034 * The random string in the <code>SSOTokenID</code> is unique on a given server.
035 * 
036 * @see com.iplanet.sso.SSOToken
037 * @supported.all.api
038 */
039public interface SSOTokenID {
040    /**
041     * Returns the encrypted Single Sign On token string.
042     * 
043     * @return An encrypted Single Sign On token string
044     */
045    String toString();
046
047    /**
048     * Returns <code>true</code> if current object is equals to
049     * <code>object</code>. This are the conditions
050     * <ul>
051     * <li><code>object</code> is not null</li>
052     * <li>this instance and <code>object</code> have the same random string.
053     * <li>this instance and <code>object</code> have the same server name.
054     * </ul>
055     * 
056     * @param object Object for comparison.
057     * @return <code>true</code> if current object is equals to
058     *         <code>object</code>.
059     */
060    boolean equals(Object object);
061
062    /**
063     * Returns a hash code for this object.
064     * 
065     * @return a hash code value for this object.
066     */
067    int hashCode();
068
069}