Class MirrorAuthenticator

All Implemented Interfaces:
Closeable, AutoCloseable, Authenticator

public class MirrorAuthenticator extends MultiAuthenticator
An Authenticator used to mirror data from one authenticator to another. When a user is sucessfully authenticated by the first ("source") Authenticator, the directory name and password are written into the second ("destination") Authenticator.
Since:
1.0
Version:
11.1
Author:
Luke
  • Constructor Details

    • MirrorAuthenticator

      public MirrorAuthenticator()
      Creates the Authenticator.
  • Method Details

    • init

      public void init(String propsFile) throws SecurityException
      Initializes the Authenticator.
      Specified by:
      init in interface Authenticator
      Overrides:
      init in class SQLAuthenticator
      Parameters:
      propsFile - the name of the proeprties file to load
      Throws:
      SecurityException - if an error occurs
    • authenticate

      public void authenticate(Person usr, String pwd) throws SecurityException
      Authenticates the user against the source authenticator. This then synchronizes credentials information with the destination authenticator.
      Parameters:
      usr - the User bean
      pwd - the user's supplied password
      Throws:
      SecurityException - if authentication fails
      See Also:
    • contains

      public boolean contains(Person usr) throws SecurityException
      Returns if the source and destination authenticators contain a particular directory name.
      Parameters:
      usr - the user bean
      Returns:
      TRUE if the source authenticator contains the user, otherwise FALSE
      Throws:
      SecurityException - if an error occurs
      See Also:
    • updatePassword

      public void updatePassword(Person usr, String pwd) throws SecurityException
      Updates the user's password in all authenticators. If this operation fails, no guarantee of transaction atomicity is given.
      Parameters:
      usr - the user bean
      pwd - the user's new password
      Throws:
      SecurityException - if either update operation fails
    • add

      public void add(Person usr, String pwd) throws SecurityException
      Adds the user to all authenticators. If this operation fails, no guarantee of transaction atomicity is given.
      Parameters:
      usr - the User bean
      pwd - the user's password
      Throws:
      SecurityException - if either add operation fails
    • rename

      public void rename(Person usr, String newName) throws SecurityException
      Renames the user in all authenticators. If this operation fails, no guarantee of transaction atomicity is given.
      Parameters:
      usr - the user bean
      newName - the new directory name
      Throws:
      SecurityException - if an error occurs
    • disable

      public void disable(Person usr) throws SecurityException
      Disables a User's account in all authenticators. If this operation fails, no guarantee of transaction atomicity is given.
      Parameters:
      usr - the user bean
      Throws:
      SecurityException - if an error occurs
    • remove

      public void remove(Person usr) throws SecurityException
      Removes the user from all authenticators. If this operation fails, no guarantee of transaction atomicity is given.
      Parameters:
      usr - the user bean
      Throws:
      SecurityException - if an error occurs