Class AbstractAuthenticator

java.lang.Object
esendex.sdk.java.service.auth.AbstractAuthenticator
All Implemented Interfaces:
Authenticator
Direct Known Subclasses:
BasicAuthenticator, SessionAuthenticator

public abstract class AbstractAuthenticator extends Object implements Authenticator
An AbstractAuthenticator is a base class for Authenticators. It provides encryption facility and writes out the header.
  • Constructor Details

    • AbstractAuthenticator

      public AbstractAuthenticator(UserPassword userPassword)
  • Method Details

    • getUserPassword

      protected UserPassword getUserPassword()
    • getScheme

      protected String getScheme()
      Gets the scheme which is BASIC.
      Returns:
      the scheme
    • encode

      protected String encode()
      Encode the credentials.
      Returns:
      encoded credentials
    • getCredentials

      public abstract String getCredentials()
      Gets the non encoded credentials.
      Returns:
      the credentials
    • createHeader

      public void createHeader(URLConnection urlCon)
      Creates the header.
      Specified by:
      createHeader in interface Authenticator
      Parameters:
      urlCon - the url con the URLConnection
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object