goldengate.common.file.filesystembased
Class FilesystemBasedAuthImpl

java.lang.Object
  extended by goldengate.common.file.filesystembased.FilesystemBasedAuthImpl
All Implemented Interfaces:
AuthInterface
Direct Known Subclasses:
PassthroughBasedAuthImpl

public abstract class FilesystemBasedAuthImpl
extends Object
implements AuthInterface

Authentication implementation for Filesystem Based

Author:
Frederic Bregier

Field Summary
protected  boolean isIdentified
          Is Identified
protected  String password
          Password
protected  String rootFromAuth
          Relative Path after Authentication
protected  SessionInterface session
          SessionInterface
protected  String user
          User name
 
Constructor Summary
FilesystemBasedAuthImpl(SessionInterface session)
           
 
Method Summary
protected abstract  void businessClean()
          Business implementation of clean
 void clear()
          Clean object
 String getAbsolutePath(String path)
          Return the full path as a String (with mount point).
 String getBusinessPath()
          Return the relative path for this account according to the Business (without true root of mount).
 String getRelativePath(String file)
          Return the relative path from a file (without mount point)
 SessionInterface getSession()
           
 String getUser()
           
 boolean isIdentified()
          Is the current Authentication OK for full identification.
protected abstract  NextCommandReply setBusinessPassword(String password)
          Set the password according to any implementation and could set the rootFromAuth.
protected abstract  String setBusinessRootFromAuth()
           
protected abstract  NextCommandReply setBusinessUser(String user)
          Set the user according to any implementation and could set the rootFromAuth.
protected  void setIsIdentified(boolean isIdentified)
          Set the Authentication to Identified or Not
 NextCommandReply setPassword(String password)
           
 NextCommandReply setUser(String user)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface goldengate.common.file.AuthInterface
getBaseDirectory, isAdmin, isBusinessPathValid
 

Field Detail

user

protected String user
User name


password

protected String password
Password


isIdentified

protected boolean isIdentified
Is Identified


session

protected final SessionInterface session
SessionInterface


rootFromAuth

protected String rootFromAuth
Relative Path after Authentication

Constructor Detail

FilesystemBasedAuthImpl

public FilesystemBasedAuthImpl(SessionInterface session)
Parameters:
session -
Method Detail

getSession

public SessionInterface getSession()
Specified by:
getSession in interface AuthInterface
Returns:
the session

setBusinessUser

protected abstract NextCommandReply setBusinessUser(String user)
                                             throws Reply421Exception,
                                                    Reply530Exception
Set the user according to any implementation and could set the rootFromAuth. If NOOP is returned, isIdentifed must be TRUE.

Parameters:
user -
Returns:
(NOOP,230) if the user is OK, else return the following command that must follow (usually PASS) and the associated reply
Throws:
Reply421Exception - if there is a problem during the authentication
Reply530Exception - if there is a problem during the authentication

setUser

public NextCommandReply setUser(String user)
                         throws Reply421Exception,
                                Reply530Exception
Specified by:
setUser in interface AuthInterface
Parameters:
user - the user to set
Returns:
(NOOP,230) if the user is OK, else return the following command that must follow (usually PASS) and the associated reply
Throws:
Reply421Exception - if there is a problem during the authentication
Reply530Exception - if there is a problem during the authentication

getUser

public String getUser()
Specified by:
getUser in interface AuthInterface
Returns:
the user

setBusinessPassword

protected abstract NextCommandReply setBusinessPassword(String password)
                                                 throws Reply421Exception,
                                                        Reply530Exception
Set the password according to any implementation and could set the rootFromAuth. If NOOP is returned, isIdentifed must be TRUE.

Parameters:
password -
Returns:
(NOOP,230) if the Password is OK, else return the following command that must follow (usually ACCT) and the associated reply
Throws:
Reply421Exception - if there is a problem during the authentication
Reply530Exception - if there is a problem during the authentication

setPassword

public NextCommandReply setPassword(String password)
                             throws Reply421Exception,
                                    Reply530Exception
Specified by:
setPassword in interface AuthInterface
Parameters:
password - the password to set
Returns:
(NOOP,230) if the Password is OK, else return the following command that must follow (usually ACCT) and the associated reply
Throws:
Reply421Exception - if there is a problem during the authentication
Reply530Exception - if there is a problem during the authentication

setIsIdentified

protected void setIsIdentified(boolean isIdentified)
Set the Authentication to Identified or Not

Parameters:
isIdentified -

isIdentified

public boolean isIdentified()
Is the current Authentication OK for full identification. It must be true after a correct sequence of identification: At most, it is true when setAccount is OK. It could be positive before (user name only, user+password only).
In the current implementation, as USER+PASS+ACCT are needed, it will be true only after a correct ACCT.

Specified by:
isIdentified in interface AuthInterface
Returns:
True if the user has a positive login, else False

setBusinessRootFromAuth

protected abstract String setBusinessRootFromAuth()
                                           throws Reply421Exception
Returns:
the root relative path from authentication if any or null if the default is used (default is /user or /user/account)
Throws:
Reply421Exception - if the business root is not available

getBusinessPath

public String getBusinessPath()
Description copied from interface: AuthInterface
Return the relative path for this account according to the Business (without true root of mount).

Specified by:
getBusinessPath in interface AuthInterface
Returns:
Return the relative path for this account

businessClean

protected abstract void businessClean()
Business implementation of clean


clear

public void clear()
Clean object

Specified by:
clear in interface AuthInterface

getAbsolutePath

public String getAbsolutePath(String path)
Return the full path as a String (with mount point).

Parameters:
path - relative path including business one (may be null or empty)
Returns:
the full path as a String

getRelativePath

public String getRelativePath(String file)
Return the relative path from a file (without mount point)

Specified by:
getRelativePath in interface AuthInterface
Parameters:
file - (full path with mount point)
Returns:
the relative path from a file


Copyright © 2009-2012 Frederic Bregier. All Rights Reserved.