CredentialsManager.java :  » Web-Framework » rife-1.6.1 » com » uwyn » rife » authentication » Java Open Source

Java Open Source » Web Framework » rife 1.6.1 
rife 1.6.1 » com » uwyn » rife » authentication » CredentialsManager.java
/*
 * Copyright 2001-2007 Geert Bevin <gbevin[remove] at uwyn dot com>
 * Distributed under the terms of either:
 * - the common development and distribution license (CDDL), v1.0; or
 * - the GNU Lesser General Public License, v2.1 or later
 * $Id: CredentialsManager.java 3643 2007-01-12 15:29:45Z gbevin $
 */
package com.uwyn.rife.authentication;

import com.uwyn.rife.authentication.exceptions.CredentialsManagerException;

/**
 * This interface defines the methods that classes with
 * {@code CredentialsManager} functionalities have to implement.
 * <p>A {@code CredentialsManager} is in charge of verifying
 * {@code Credentials} instances. Using the information that a
 * {@code CredentialsManager} provides, the authentication system is able
 * to take appropriate actions (ie. start a new session, provide informational
 * messages about a user's status, and so on).
 * 
 * @author Geert Bevin (gbevin[remove] at uwyn dot com)
 * @version $Revision: 3643 $
 * @see Credentials
 * @see SessionValidator
 * @since 1.0
 */
public interface CredentialsManager
{
  /**
   * Verifies the validity of the provided {@code Credentials}
   * instance.
   * 
   * @param credentials The {@code Credentials} instance that needs to
   * be verified.
   * @return A {@code long} that uniquely identifies the user that
   * corresponds to the validated credentials; or
   * <p>{@code -1} if the credentials are invalid.
   * @exception CredentialsManagerException An undefined number of
   * exceptional cases or error situations can occur when credentials are
   * verified. They are all indicated by throwing an instance of
   * {@code CredentialsManagerException}. It's up to the
   * implementations of this interface to give more specific meanings to
   * these exceptions.
   * @since 1.0
   */
  public long verifyCredentials(Credentials credentials) throws CredentialsManagerException;
}

java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.