org.sblim.cimclient.internal.http
Class AuthorizationInfo

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

public abstract class AuthorizationInfo
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
AuthorizationInfo()
           
 
Method Summary
static AuthorizationInfo createAuthorizationInfo(java.lang.String pModule)
          Factory method for AuthorizationInfo objects.
static AuthorizationInfo 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 AuthorizationInfo objects.
 java.lang.String getA1()
          Returns A1
 java.lang.String getAddr()
          Returns the address
 java.lang.String getAlgorithm()
          Returns algorithm
 java.lang.String getCnonce()
          Returns cnonce
 java.net.PasswordAuthentication getCredentials()
          Returns the credentials
abstract  java.lang.String getHeaderFieldName()
          Gets the HTTP header field name for this authentication information
 long getNc()
          Returns nc
 java.lang.String getNonce()
          Returns nonce
 java.lang.String getOpaque()
          Returns opaque
 int getPort()
          Returns the port
 java.lang.String getProtocol()
          Returns the protocol
 java.lang.String getQop()
          Returns Qop
 java.lang.String getRealm()
          Returns the realm
 java.lang.String getResponse()
          Returns response
 java.lang.String getScheme()
          Returns the scheme
 java.lang.String getURI()
          Returns URI
 void init(java.lang.Boolean pProxy, java.lang.String pAddress, int pPort, java.lang.String pProtocol, java.lang.String pRealm, java.lang.String pScheme)
          Initialize
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)
          Sets A1
 void setAlgorithm(java.lang.String algorithm)
          Set algorithm
 void setCnonce(java.lang.String cnonce)
          Set cnonce
 void setCredentials(java.net.PasswordAuthentication credentials)
          Sets credentials
 void setNc(long nc)
          Sets nc
 void setNonce(java.lang.String nonce)
          Sets nonce
 void setOpaque(java.lang.String opaque)
          Sets opaque
 void setQop(java.lang.String qop)
          Sets Qop
 void setRealm(java.lang.String realm)
          Sets the realm
 void setResponse(java.lang.String response)
          Sets response
 void setScheme(java.lang.String scheme)
          Sets the scheme
 void setURI(java.lang.String uri)
          Sets 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 according 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

AuthorizationInfo

public AuthorizationInfo()
Method Detail

init

public void init(java.lang.Boolean pProxy,
                 java.lang.String pAddress,
                 int pPort,
                 java.lang.String pProtocol,
                 java.lang.String pRealm,
                 java.lang.String pScheme)
Initialize

Parameters:
pProxy - Proxy authentication ?
pAddress - Server address
pPort - Server port
pProtocol - Protocol
pRealm - Realm
pScheme - Scheme

setOpaque

public void setOpaque(java.lang.String opaque)
Sets opaque

Parameters:
opaque - new Value

getOpaque

public java.lang.String getOpaque()
Returns opaque

Returns:
Opaque

getQop

public java.lang.String getQop()
Returns Qop

Returns:
Qop

setQop

public void setQop(java.lang.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(java.lang.String nonce)
Sets nonce

Parameters:
nonce - New Value

getNonce

public java.lang.String getNonce()
Returns nonce

Returns:
nonce

setCnonce

public void setCnonce(java.lang.String cnonce)
Set cnonce

Parameters:
cnonce - New value

getCnonce

public java.lang.String getCnonce()
Returns cnonce

Returns:
cnonce

setAlgorithm

public void setAlgorithm(java.lang.String algorithm)
Set algorithm

Parameters:
algorithm - New value

getAlgorithm

public java.lang.String getAlgorithm()
Returns algorithm

Returns:
algorithm

getA1

public java.lang.String getA1()
Returns A1

Returns:
A1

setA1

public void setA1(java.lang.String A1)
Sets A1

Parameters:
A1 - New value

setResponse

public void setResponse(java.lang.String response)
Sets response

Parameters:
response - New value

getResponse

public java.lang.String getResponse()
Returns response

Returns:
New value

getURI

public java.lang.String getURI()
Returns URI

Returns:
URI

setURI

public void setURI(java.lang.String uri)
Sets URI

Parameters:
uri - New value

setCredentials

public void setCredentials(java.net.PasswordAuthentication credentials)
Sets credentials

Parameters:
credentials - New value

getAddr

public java.lang.String getAddr()
Returns the address

Returns:
The server address

getPort

public int getPort()
Returns the port

Returns:
The server port

getProtocol

public java.lang.String getProtocol()
Returns the protocol

Returns:
The protocol

getRealm

public java.lang.String getRealm()
Returns the realm

Returns:
The realm

setRealm

public void setRealm(java.lang.String realm)
Sets the realm

Parameters:
realm - New value

getScheme

public java.lang.String getScheme()
Returns the scheme

Returns:
The scheme

setScheme

public void setScheme(java.lang.String scheme)
Sets the scheme

Parameters:
scheme - New value

getCredentials

public java.net.PasswordAuthentication getCredentials()
Returns the credentials

Returns:
The credentials

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 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:
java.security.NoSuchAlgorithmException

toString

public abstract java.lang.String toString()
Overrides:
toString in class java.lang.Object

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 AuthorizationInfo 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 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:
WBEMConfiguration.getHttpAuthenticationModule(), WwwAuthInfo, PegasusLocalAuthInfo

createAuthorizationInfo

public static AuthorizationInfo createAuthorizationInfo(java.lang.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


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