org.sblim.cimclient.internal.http

Class AuthorizationInfo

public abstract class AuthorizationInfo extends Object

Abstract superclass for HTTP authorization information.

See Also: WwwAuthInfo PegasusLocalAuthInfo

Field Summary
protected StringiA1
protected StringiAddr
protected StringiAlgorithm
protected StringiCnonce
protected PasswordAuthenticationiCredentials
protected longiNc
protected StringiNonce
protected StringiOpaque
protected intiPort
protected StringiProtocol
protected StringiQop
protected StringiRealm
protected StringiResponse
protected StringiScheme
protected StringiUri
Method Summary
static AuthorizationInfocreateAuthorizationInfo(String pModule, Boolean pProxy, String pAddress, int pPort, String pProtocol, String pRealm, String pScheme)
Factory method for AuthorizationInfo objects.
static AuthorizationInfocreateAuthorizationInfo(String pModule)
Factory method for AuthorizationInfo objects.
StringgetA1()
Returns A1
StringgetAddr()
Returns the address
StringgetAlgorithm()
Returns algorithm
StringgetCnonce()
Returns cnonce
PasswordAuthenticationgetCredentials()
Returns the credentials
abstract StringgetHeaderFieldName()
Gets the HTTP header field name for this authentication information
longgetNc()
Returns nc
StringgetNonce()
Returns nonce
StringgetOpaque()
Returns opaque
intgetPort()
Returns the port
StringgetProtocol()
Returns the protocol
StringgetQop()
Returns Qop
StringgetRealm()
Returns the realm
StringgetResponse()
Returns response
StringgetScheme()
Returns the scheme
StringgetURI()
Returns URI
voidinit(Boolean pProxy, String pAddress, int pPort, String pProtocol, String pRealm, String pScheme)
Initialize
abstract booleanisKeptAlive()
Determines if the connection is kept alive after the "401 Unauthorized" response
abstract booleanisSentOnFirstRequest()
Determines if the authorization information is already sent on the very first http request or after the "401 Unauthorized" response
booleanmatch(Object obj)
Compares two authorization informations.
voidsetA1(String A1)
Sets A1
voidsetAlgorithm(String algorithm)
Set algorithm
voidsetCnonce(String cnonce)
Set cnonce
voidsetCredentials(PasswordAuthentication credentials)
Sets credentials
voidsetNc(long nc)
Sets nc
voidsetNonce(String nonce)
Sets nonce
voidsetOpaque(String opaque)
Sets opaque
voidsetQop(String qop)
Sets Qop
voidsetRealm(String realm)
Sets the realm
voidsetResponse(String response)
Sets response
voidsetScheme(String scheme)
Sets the scheme
voidsetURI(String uri)
Sets URI
abstract StringtoString()
abstract voidupdateAuthenticationInfo(Challenge challenge, String authenticate, URI url, String requestMethod)
Updates the authorization information acording to a received challenge.

Field Detail

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

Method Detail

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: getHttpAuthenticationModule WwwAuthInfo PegasusLocalAuthInfo

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

getA1

public String getA1()
Returns A1

Returns: A1

getAddr

public String getAddr()
Returns the address

Returns: The server address

getAlgorithm

public String getAlgorithm()
Returns algorithm

Returns: algorithm

getCnonce

public String getCnonce()
Returns cnonce

Returns: cnonce

getCredentials

public PasswordAuthentication getCredentials()
Returns the credentials

Returns: The credentials

getHeaderFieldName

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

Returns: The field name

getNc

public long getNc()
Returns nc

Returns: nc

getNonce

public String getNonce()
Returns nonce

Returns: nonce

getOpaque

public String getOpaque()
Returns opaque

Returns: Opaque

getPort

public int getPort()
Returns the port

Returns: The server port

getProtocol

public String getProtocol()
Returns the protocol

Returns: The protocol

getQop

public String getQop()
Returns Qop

Returns: Qop

getRealm

public String getRealm()
Returns the realm

Returns: The realm

getResponse

public String getResponse()
Returns response

Returns: New value

getScheme

public String getScheme()
Returns the scheme

Returns: The scheme

getURI

public String getURI()
Returns URI

Returns: URI

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

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)
Sets A1

Parameters: A1 New value

setAlgorithm

public void setAlgorithm(String algorithm)
Set algorithm

Parameters: algorithm New value

setCnonce

public void setCnonce(String cnonce)
Set cnonce

Parameters: cnonce New value

setCredentials

public void setCredentials(PasswordAuthentication credentials)
Sets credentials

Parameters: credentials New value

setNc

public void setNc(long nc)
Sets nc

Parameters: nc New value

setNonce

public void setNonce(String nonce)
Sets nonce

Parameters: nonce New Value

setOpaque

public void setOpaque(String opaque)
Sets opaque

Parameters: opaque new Value

setQop

public void setQop(String qop)
Sets Qop

Parameters: qop New value

setRealm

public void setRealm(String realm)
Sets the realm

Parameters: realm New value

setResponse

public void setResponse(String response)
Sets response

Parameters: response New value

setScheme

public void setScheme(String scheme)
Sets the scheme

Parameters: scheme New value

setURI

public void setURI(String uri)
Sets URI

Parameters: uri New value

toString

public abstract String toString()

updateAuthenticationInfo

public abstract void updateAuthenticationInfo(Challenge challenge, String authenticate, URI url, String requestMethod)
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

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