Class NativeAuthenticationProvider

java.lang.Object
ecmwf.common.ecaccess.NativeAuthenticationProvider
Direct Known Subclasses:
MasterProvider, MoverProvider

public abstract class NativeAuthenticationProvider extends Object
The Class NativeAuthenticationProvider.
  • Constructor Details

    • NativeAuthenticationProvider

      public NativeAuthenticationProvider()
  • Method Details

    • newActivity

      public Activity newActivity(String user, String plugin, String host, String agent, String action, String comment, boolean error)
      New activity.
      Parameters:
      user - the user
      plugin - the plugin
      host - the host
      agent - the agent
      action - the action
      comment - the comment
      error - the error
      Returns:
      the activity
    • newEvent

      public Event newEvent(Activity activity, String action, String comment, boolean error)
      New event.
      Parameters:
      activity - the activity
      action - the action
      comment - the comment
      error - the error
      Returns:
      the event
    • getECUser

      public ECUser getECUser(String name)
      Gets the ECuser.
      Parameters:
      name - the name
      Returns:
      the EC user
    • getRoot

      public abstract String getRoot() throws Exception
      Gets the root.
      Returns:
      the root
      Throws:
      Exception - the exception
    • connected

      public boolean connected()
      Connected.
      Returns:
      true, if successful
    • getNewCertificate

      public byte[] getNewCertificate(String user, String passcode, String profile, String remoteHost) throws Exception
      Gets the new certificate.
      Parameters:
      user - the user
      passcode - the passcode
      profile - the profile
      remoteHost - the remote host
      Returns:
      the new certificate
      Throws:
      Exception - the exception
    • getNewToken

      public String[] getNewToken(byte[] certificate, String profile, String remoteHost) throws Exception
      Gets the new token.
      Parameters:
      certificate - the certificate
      profile - the profile
      remoteHost - the remote host
      Returns:
      the new token
      Throws:
      Exception - the exception
    • getNewToken

      public String[] getNewToken(String user, String passcode, String profile, String remoteHost) throws Exception
      Gets the new token.
      Parameters:
      user - the user
      passcode - the passcode
      profile - the profile
      remoteHost - the remote host
      Returns:
      the new token
      Throws:
      Exception - the exception
    • isRegistredUser

      public abstract boolean isRegistredUser(String user) throws Exception
      Checks if it is a registred user.
      Parameters:
      user - the user
      Returns:
      true, if is registred user
      Throws:
      Exception - the exception
    • isPassword

      public boolean isPassword(String user, String passwordOrTicket)
      Allow differentiating tickets and passwords. Depending of the result the session will be created with one getUserSession or the other.
      Parameters:
      user - the user
      passwordOrTicket - the password or ticket
      Returns:
      true, if it is a password
    • supportTickets

      public boolean supportTickets()
      If tickets are supported then the isPassword method will be called to differentiate the passwords and the tickets.
      Returns:
      true, if it does support tickets.
    • getUserSession

      public abstract UserSession getUserSession(String host, String ticket, String profile, Closeable closeable) throws Exception
      Called if we have a ticket.
      Parameters:
      host - the host
      ticket - the ticket
      profile - the profile
      closeable - the closeable
      Returns:
      the user session
      Throws:
      Exception - the exception
    • getUserSession

      public abstract UserSession getUserSession(String host, String user, String password, String profile, Closeable closeable) throws Exception
      Called if we have a password.
      Parameters:
      host - the host
      user - the user
      password - the password
      profile - the profile
      closeable - the closeable
      Returns:
      the user session
      Throws:
      Exception - the exception
    • getUserSession

      public abstract UserSession getUserSession(String host, String user, ECauthToken token, String profile, Closeable closeable) throws Exception
      Gets the user session.
      Parameters:
      host - the host
      user - the user
      token - the token
      profile - the profile
      closeable - the closeable
      Returns:
      the user session
      Throws:
      Exception - the exception
    • setProvider

      public static void setProvider(Class<?> cls)
      Sets the provider.
      Parameters:
      cls - the new provider
    • getInstance

      public static NativeAuthenticationProvider getInstance() throws IOException
      Gets the single instance of NativeAuthenticationProvider.
      Returns:
      single instance of NativeAuthenticationProvider
      Throws:
      IOException - Signals that an I/O exception has occurred.