createAuthorizationInfo
public static AuthInfo createAuthorizationInfo(String pModule)
Factory method for AuthInfo objects. Returns an instance of a subclass
according to the requested type.
pModule
- The authorization info type to be constructed
- 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.
pModule
- The authorization info type to be constructedpProxy
- Proxy authentication ?pAddress
- Server addresspPort
- Server portpProtocol
- Protocol (http/https)pRealm
- RealmpScheme
- Scheme (e.g. Basic, Digest)
- 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
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
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
match
public boolean match(Object obj)
Compares two authorization informations.
obj
- The other authorization information
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.
challenge
- The received challengeauthenticate
- The authenticate header fieldurl
- The url of the CIM serverrequestMethod
- The HTTP request method (POST or MPOST)