Class AuthInfo

java.lang.Object
org.sblim.wbem.http.AuthInfo
Direct Known Subclasses:
PegasusLocalAuthInfo, WwwAuthInfo

public abstract class AuthInfo 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

    • AuthInfo

      protected AuthInfo()
  • Method Details

    • init

      public void init(Boolean proxy, String addr, int port, String protocol, String realm, String scheme)
    • setOpaque

      public void setOpaque(String opaque)
    • getOpaque

      public String getOpaque()
    • getQop

      public String getQop()
    • setQop

      public void setQop(String qop)
    • getNc

      public long getNc()
    • setNc

      public void setNc(long nc)
    • setNonce

      public void setNonce(String nonce)
    • getNonce

      public String getNonce()
    • setCnonce

      public void setCnonce(String cnonce)
    • getCnonce

      public String getCnonce()
    • setAlgorithm

      public void setAlgorithm(String algorithm)
    • getAlgorith

      public String getAlgorith()
    • getA1

      public String getA1()
    • setA1

      public void setA1(String A1)
    • setResponse

      public void setResponse(String response)
    • getResponse

      public String getResponse()
    • getURI

      public String getURI()
    • setURI

      public void setURI(String uri)
    • setCredentials

      public void setCredentials(PasswordAuthentication credentials)
    • getAddr

      public String getAddr()
    • getPort

      public int getPort()
    • getProtocol

      public String getProtocol()
    • getRealm

      public String getRealm()
    • setRealm

      public void setRealm(String realm)
    • getScheme

      public String getScheme()
    • setScheme

      public void setScheme(String scheme)
    • getCredentials

      public PasswordAuthentication getCredentials()
    • 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 acording 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 AuthInfo createAuthorizationInfo(String pModule, Boolean pProxy, String pAddress, int pPort, String pProtocol, String pRealm, String pScheme)
      Factory method for AuthInfo 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 AuthInfo subclass or null
      See Also:
    • createAuthorizationInfo

      public static AuthInfo createAuthorizationInfo(String pModule)
      Factory method for AuthInfo 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 AuthInfo subclass or null
      See Also: