Class AuthorizationInfo

java.lang.Object
org.sblim.cimclient.internal.http.AuthorizationInfo
Direct Known Subclasses:
PegasusLocalAuthInfo, WwwAuthInfo

public abstract class AuthorizationInfo extends Object
Abstract superclass for HTTP authorization information.
See Also:
  • Field Details

    • iAddr

      protected String iAddr
    • iPort

      protected int iPort
    • iProtocol

      protected String iProtocol
    • iRealm

      protected String iRealm
    • iScheme

      protected String iScheme
    • iCredentials

      protected PasswordAuthentication iCredentials
    • iNc

      protected long iNc
    • iCnonce

      protected String iCnonce
    • iOpaque

      protected String iOpaque
    • iAlgorithm

      protected String iAlgorithm
    • iUri

      protected String iUri
    • iNonce

      protected String iNonce
    • iQop

      protected String iQop
    • iA1

      protected String iA1
    • iResponse

      protected String iResponse
  • Constructor Details

    • AuthorizationInfo

      public AuthorizationInfo()
  • Method Details

    • init

      public void init(Boolean pProxy, String pAddress, int pPort, String pProtocol, String pRealm, String pScheme)
      Initialize
      Parameters:
      pProxy - Proxy authentication ?
      pAddress - Server address
      pPort - Server port
      pProtocol - Protocol
      pRealm - Realm
      pScheme - Scheme
    • setOpaque

      public void setOpaque(String opaque)
      Sets opaque
      Parameters:
      opaque - new Value
    • getOpaque

      public String getOpaque()
      Returns opaque
      Returns:
      Opaque
    • getQop

      public String getQop()
      Returns Qop
      Returns:
      Qop
    • setQop

      public void setQop(String qop)
      Sets Qop
      Parameters:
      qop - New value
    • getNc

      public long getNc()
      Returns nc
      Returns:
      nc
    • setNc

      public void setNc(long nc)
      Sets nc
      Parameters:
      nc - New value
    • setNonce

      public void setNonce(String nonce)
      Sets nonce
      Parameters:
      nonce - New Value
    • getNonce

      public String getNonce()
      Returns nonce
      Returns:
      nonce
    • setCnonce

      public void setCnonce(String cnonce)
      Set cnonce
      Parameters:
      cnonce - New value
    • getCnonce

      public String getCnonce()
      Returns cnonce
      Returns:
      cnonce
    • setAlgorithm

      public void setAlgorithm(String algorithm)
      Set algorithm
      Parameters:
      algorithm - New value
    • getAlgorithm

      public String getAlgorithm()
      Returns algorithm
      Returns:
      algorithm
    • getA1

      public String getA1()
      Returns A1
      Returns:
      A1
    • setA1

      public void setA1(String A1)
      Sets A1
      Parameters:
      A1 - New value
    • setResponse

      public void setResponse(String response)
      Sets response
      Parameters:
      response - New value
    • getResponse

      public String getResponse()
      Returns response
      Returns:
      New value
    • getURI

      public String getURI()
      Returns URI
      Returns:
      URI
    • setURI

      public void setURI(String uri)
      Sets URI
      Parameters:
      uri - New value
    • setCredentials

      public void setCredentials(PasswordAuthentication credentials)
      Sets credentials
      Parameters:
      credentials - New value
    • getAddr

      public String getAddr()
      Returns the address
      Returns:
      The server address
    • getPort

      public int getPort()
      Returns the port
      Returns:
      The server port
    • getProtocol

      public String getProtocol()
      Returns the protocol
      Returns:
      The protocol
    • getRealm

      public String getRealm()
      Returns the realm
      Returns:
      The realm
    • setRealm

      public void setRealm(String realm)
      Sets the realm
      Parameters:
      realm - New value
    • getScheme

      public String getScheme()
      Returns the scheme
      Returns:
      The scheme
    • setScheme

      public void setScheme(String scheme)
      Sets the scheme
      Parameters:
      scheme - New value
    • getCredentials

      public PasswordAuthentication getCredentials()
      Returns the credentials
      Returns:
      The credentials
    • match

      public boolean match(Object obj)
      Compares two authorization informations.
      Parameters:
      obj - The other authorization information
      Returns:
      true if type, realm, scheme, address, protocol and port of both authorization informations are equal, false otherwise.
    • updateAuthenticationInfo

      public abstract void updateAuthenticationInfo(Challenge challenge, String authenticate, URI url, String requestMethod) throws NoSuchAlgorithmException
      Updates the authorization information according to a received challenge.
      Parameters:
      challenge - The received challenge
      authenticate - The authenticate header field
      url - The url of the CIM server
      requestMethod - The HTTP request method (POST or MPOST)
      Throws:
      NoSuchAlgorithmException
    • toString

      public abstract String toString()
      Overrides:
      toString in class Object
    • getHeaderFieldName

      public abstract String getHeaderFieldName()
      Gets the HTTP header field name for this authentication information
      Returns:
      The field name
    • isSentOnFirstRequest

      public abstract boolean isSentOnFirstRequest()
      Determines if the authorization information is already sent on the very first http request or after the "401 Unauthorized" response
      Returns:
      true or false
    • isKeptAlive

      public abstract boolean isKeptAlive()
      Determines if the connection is kept alive after the "401 Unauthorized" response
      Returns:
      true or false
    • createAuthorizationInfo

      public static AuthorizationInfo createAuthorizationInfo(String pModule, Boolean pProxy, String pAddress, int pPort, String pProtocol, String pRealm, String pScheme)
      Factory method for AuthorizationInfo objects. Returns an instance of a subclass according to the requested type.
      Parameters:
      pModule - The authorization info type to be constructed
      pProxy - Proxy authentication ?
      pAddress - Server address
      pPort - Server port
      pProtocol - Protocol (http/https)
      pRealm - Realm
      pScheme - Scheme (e.g. Basic, Digest)
      Returns:
      An instance of a AuthorizationInfo subclass or null
      See Also:
    • createAuthorizationInfo

      public static AuthorizationInfo createAuthorizationInfo(String pModule)
      Factory method for AuthorizationInfo objects. Returns an instance of a subclass according to the requested type.
      Parameters:
      pModule - The authorization info type to be constructed
      Returns:
      An instance of a AuthorizationInfo subclass or null