org.sblim.wbem.http
Class AuthInfo

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

public abstract class AuthInfo
extends java.lang.Object

Abstract superclass for HTTP authorization information.

See Also:
WwwAuthInfo, PegasusLocalAuthInfo

Field Summary
protected  java.lang.String iA1
           
protected  java.lang.String iAddr
           
protected  java.lang.String iAlgorithm
           
protected  java.lang.String iCnonce
           
protected  java.net.PasswordAuthentication iCredentials
           
protected  long iNc
           
protected  java.lang.String iNonce
           
protected  java.lang.String iOpaque
           
protected  int iPort
           
protected  java.lang.String iProtocol
           
protected  java.lang.String iQop
           
protected  java.lang.String iRealm
           
protected  java.lang.String iResponse
           
protected  java.lang.String iScheme
           
protected  java.lang.String iUri
           
 
Constructor Summary
protected AuthInfo()
           
 
Method Summary
static AuthInfo createAuthorizationInfo(java.lang.String pModule)
          Factory method for AuthInfo objects.
static AuthInfo createAuthorizationInfo(java.lang.String pModule, java.lang.Boolean pProxy, java.lang.String pAddress, int pPort, java.lang.String pProtocol, java.lang.String pRealm, java.lang.String pScheme)
          Factory method for AuthInfo objects.
 java.lang.String getA1()
           
 java.lang.String getAddr()
           
 java.lang.String getAlgorith()
           
 java.lang.String getCnonce()
           
 java.net.PasswordAuthentication getCredentials()
           
abstract  java.lang.String getHeaderFieldName()
          Gets the HTTP header field name for this authentication information
 long getNc()
           
 java.lang.String getNonce()
           
 java.lang.String getOpaque()
           
 int getPort()
           
 java.lang.String getProtocol()
           
 java.lang.String getQop()
           
 java.lang.String getRealm()
           
 java.lang.String getResponse()
           
 java.lang.String getScheme()
           
 java.lang.String getURI()
           
 void init(java.lang.Boolean proxy, java.lang.String addr, int port, java.lang.String protocol, java.lang.String realm, java.lang.String scheme)
           
abstract  boolean isKeptAlive()
          Determines if the connection is kept alive after the "401 Unauthorized" response
abstract  boolean isSentOnFirstRequest()
          Determines if the authorization information is already sent on the very first http request or after the "401 Unauthorized" response
 boolean match(java.lang.Object obj)
          Compares two authorization informations.
 void setA1(java.lang.String A1)
           
 void setAlgorithm(java.lang.String algorithm)
           
 void setCnonce(java.lang.String cnonce)
           
 void setCredentials(java.net.PasswordAuthentication credentials)
           
 void setNc(long nc)
           
 void setNonce(java.lang.String nonce)
           
 void setOpaque(java.lang.String opaque)
           
 void setQop(java.lang.String qop)
           
 void setRealm(java.lang.String realm)
           
 void setResponse(java.lang.String response)
           
 void setScheme(java.lang.String scheme)
           
 void setURI(java.lang.String uri)
           
abstract  java.lang.String toString()
           
abstract  void updateAuthenticationInfo(Challenge challenge, java.lang.String authenticate, java.net.URI url, java.lang.String requestMethod)
          Updates the authorization information acording to a received challenge.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

iAddr

protected java.lang.String iAddr

iPort

protected int iPort

iProtocol

protected java.lang.String iProtocol

iRealm

protected java.lang.String iRealm

iScheme

protected java.lang.String iScheme

iCredentials

protected java.net.PasswordAuthentication iCredentials

iNc

protected long iNc

iCnonce

protected java.lang.String iCnonce

iOpaque

protected java.lang.String iOpaque

iAlgorithm

protected java.lang.String iAlgorithm

iUri

protected java.lang.String iUri

iNonce

protected java.lang.String iNonce

iQop

protected java.lang.String iQop

iA1

protected java.lang.String iA1

iResponse

protected java.lang.String iResponse
Constructor Detail

AuthInfo

protected AuthInfo()
Method Detail

init

public void init(java.lang.Boolean proxy,
                 java.lang.String addr,
                 int port,
                 java.lang.String protocol,
                 java.lang.String realm,
                 java.lang.String scheme)

setOpaque

public void setOpaque(java.lang.String opaque)

getOpaque

public java.lang.String getOpaque()

getQop

public java.lang.String getQop()

setQop

public void setQop(java.lang.String qop)

getNc

public long getNc()

setNc

public void setNc(long nc)

setNonce

public void setNonce(java.lang.String nonce)

getNonce

public java.lang.String getNonce()

setCnonce

public void setCnonce(java.lang.String cnonce)

getCnonce

public java.lang.String getCnonce()

setAlgorithm

public void setAlgorithm(java.lang.String algorithm)

getAlgorith

public java.lang.String getAlgorith()

getA1

public java.lang.String getA1()

setA1

public void setA1(java.lang.String A1)

setResponse

public void setResponse(java.lang.String response)

getResponse

public java.lang.String getResponse()

getURI

public java.lang.String getURI()

setURI

public void setURI(java.lang.String uri)

setCredentials

public void setCredentials(java.net.PasswordAuthentication credentials)

getAddr

public java.lang.String getAddr()

getPort

public int getPort()

getProtocol

public java.lang.String getProtocol()

getRealm

public java.lang.String getRealm()

setRealm

public void setRealm(java.lang.String realm)

getScheme

public java.lang.String getScheme()

setScheme

public void setScheme(java.lang.String scheme)

getCredentials

public java.net.PasswordAuthentication getCredentials()

match

public boolean match(java.lang.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,
                                              java.lang.String authenticate,
                                              java.net.URI url,
                                              java.lang.String requestMethod)
                                       throws java.security.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:
java.security.NoSuchAlgorithmException

toString

public abstract java.lang.String toString()

getHeaderFieldName

public abstract java.lang.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(java.lang.String pModule,
                                               java.lang.Boolean pProxy,
                                               java.lang.String pAddress,
                                               int pPort,
                                               java.lang.String pProtocol,
                                               java.lang.String pRealm,
                                               java.lang.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:
SessionProperties.WWW_AUTHENTICATION, SessionProperties.PEGASUS_LOCAL_AUTHENTICATION

createAuthorizationInfo

public static AuthInfo createAuthorizationInfo(java.lang.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:
SessionProperties.WWW_AUTHENTICATION, SessionProperties.PEGASUS_LOCAL_AUTHENTICATION


Copyright © 2005, 2010 IBM Corporation. All Rights Reserved.