org.sblim.wbem.http

Class AuthInfo

Known Direct Subclasses:
PegasusLocalAuthInfo, WwwAuthInfo

public abstract class AuthInfo
extends java.lang.Object

Abstract superclass for HTTP authorization information.
See Also:
WwwAuthInfo, PegasusLocalAuthInfo

Field Summary

protected String
iA1
protected String
iAddr
protected String
iAlgorithm
protected String
iCnonce
protected PasswordAuthentication
iCredentials
protected long
iNc
protected String
iNonce
protected String
iOpaque
protected int
iPort
protected String
iProtocol
protected String
iQop
protected String
iRealm
protected String
iResponse
protected String
iScheme
protected String
iUri

Constructor Summary

AuthInfo()

Method Summary

static AuthInfo
createAuthorizationInfo(String pModule)
Factory method for AuthInfo objects.
static AuthInfo
createAuthorizationInfo(String pModule, Boolean pProxy, String pAddress, int pPort, String pProtocol, String pRealm, String pScheme)
Factory method for AuthInfo objects.
String
getA1()
String
getAddr()
String
getAlgorith()
String
getCnonce()
PasswordAuthentication
getCredentials()
abstract String
getHeaderFieldName()
Gets the HTTP header field name for this authentication information
long
getNc()
String
getNonce()
String
getOpaque()
int
getPort()
String
getProtocol()
String
getQop()
String
getRealm()
String
getResponse()
String
getScheme()
String
getURI()
void
init(Boolean proxy, String addr, int port, String protocol, String realm, 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(Object obj)
Compares two authorization informations.
void
setA1(String A1)
void
setAlgorithm(String algorithm)
void
setCnonce(String cnonce)
void
setCredentials(PasswordAuthentication credentials)
void
setNc(long nc)
void
setNonce(String nonce)
void
setOpaque(String opaque)
void
setQop(String qop)
void
setRealm(String realm)
void
setResponse(String response)
void
setScheme(String scheme)
void
setURI(String uri)
abstract String
toString()
abstract void
updateAuthenticationInfo(Challenge challenge, String authenticate, URI url, String requestMethod)
Updates the authorization information acording to a received challenge.

Field Details

iA1

protected String iA1

iAddr

protected String iAddr

iAlgorithm

protected String iAlgorithm

iCnonce

protected String iCnonce

iCredentials

protected PasswordAuthentication iCredentials

iNc

protected long iNc

iNonce

protected String iNonce

iOpaque

protected String iOpaque

iPort

protected int iPort

iProtocol

protected String iProtocol

iQop

protected String iQop

iRealm

protected String iRealm

iResponse

protected String iResponse

iScheme

protected String iScheme

iUri

protected String iUri

Constructor Details

AuthInfo

protected AuthInfo()

Method Details

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

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

getA1

public String getA1()

getAddr

public String getAddr()

getAlgorith

public String getAlgorith()

getCnonce

public String getCnonce()

getCredentials

public PasswordAuthentication getCredentials()

getHeaderFieldName

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

getNc

public long getNc()

getNonce

public String getNonce()

getOpaque

public String getOpaque()

getPort

public int getPort()

getProtocol

public String getProtocol()

getQop

public String getQop()

getRealm

public String getRealm()

getResponse

public String getResponse()

getScheme

public String getScheme()

getURI

public String getURI()

init

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

isKeptAlive

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

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

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.

setA1

public void setA1(String A1)

setAlgorithm

public void setAlgorithm(String algorithm)

setCnonce

public void setCnonce(String cnonce)

setCredentials

public void setCredentials(PasswordAuthentication credentials)

setNc

public void setNc(long nc)

setNonce

public void setNonce(String nonce)

setOpaque

public void setOpaque(String opaque)

setQop

public void setQop(String qop)

setRealm

public void setRealm(String realm)

setResponse

public void setResponse(String response)

setScheme

public void setScheme(String scheme)

setURI

public void setURI(String uri)

toString

public abstract String toString()

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)

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