001 package com.croftsoft.core.security;
002
003 import com.croftsoft.core.lang.NullArgumentException;
004
005 /*********************************************************************
006 * Identifier in which the Authentication has been pre-fetched.
007 *
008 * <p />
009 *
010 * @version
011 * 2001-07-30
012 * @since
013 * 2001-07-30
014 * @author
015 * <a href="https://www.croftsoft.com/">David Wallace Croft</a>
016 *********************************************************************/
017
018 public final class PreIdentifier
019 implements Identifier
020 //////////////////////////////////////////////////////////////////////
021 //////////////////////////////////////////////////////////////////////
022 {
023
024 private final Authentication authentication;
025
026 //////////////////////////////////////////////////////////////////////
027 //////////////////////////////////////////////////////////////////////
028
029 public PreIdentifier ( Authentication authentication )
030 //////////////////////////////////////////////////////////////////////
031 {
032 NullArgumentException.check (
033 this.authentication = authentication );
034 }
035
036 public PreIdentifier (
037 String username,
038 String password )
039 //////////////////////////////////////////////////////////////////////
040 {
041 this ( new Authentication ( username, password ) );
042 }
043
044 //////////////////////////////////////////////////////////////////////
045 //////////////////////////////////////////////////////////////////////
046
047 public Authentication getAuthentication ( )
048 //////////////////////////////////////////////////////////////////////
049 {
050 return authentication;
051 }
052
053 //////////////////////////////////////////////////////////////////////
054 //////////////////////////////////////////////////////////////////////
055 }