Class AuthInfo
java.lang.Object
org.sblim.wbem.http.AuthInfo
- Direct Known Subclasses:
PegasusLocalAuthInfo, WwwAuthInfo
Abstract superclass for HTTP authorization information.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected String
protected String
protected String
protected String
protected PasswordAuthentication
protected long
protected String
protected String
protected int
protected String
protected String
protected String
protected String
protected String
protected String
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic 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.getA1()
getAddr()
abstract String
Gets the HTTP header field name for this authentication informationlong
getNc()
getNonce()
int
getPort()
getQop()
getRealm()
getURI()
void
abstract boolean
Determines if the connection is kept alive after the "401 Unauthorized" responseabstract boolean
Determines if the authorization information is already sent on the very first http request or after the "401 Unauthorized" responseboolean
Compares two authorization informations.void
void
setAlgorithm
(String algorithm) void
void
setCredentials
(PasswordAuthentication credentials) void
setNc
(long nc) void
void
void
void
void
setResponse
(String response) void
void
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
-
iAddr
-
iPort
protected int iPort -
iProtocol
-
iRealm
-
iScheme
-
iCredentials
-
iNc
protected long iNc -
iCnonce
-
iOpaque
-
iAlgorithm
-
iUri
-
iNonce
-
iQop
-
iA1
-
iResponse
-
-
Constructor Details
-
AuthInfo
protected AuthInfo()
-
-
Method Details
-
init
-
setOpaque
-
getOpaque
-
getQop
-
setQop
-
getNc
public long getNc() -
setNc
public void setNc(long nc) -
setNonce
-
getNonce
-
setCnonce
-
getCnonce
-
setAlgorithm
-
getAlgorith
-
getA1
-
setA1
-
setResponse
-
getResponse
-
getURI
-
setURI
-
setCredentials
-
getAddr
-
getPort
public int getPort() -
getProtocol
-
getRealm
-
setRealm
-
getScheme
-
setScheme
-
getCredentials
-
match
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, String authenticate, URI url, String requestMethod) throws NoSuchAlgorithmException Updates the authorization information acording to a received challenge.- Parameters:
challenge
- The received challengeauthenticate
- The authenticate header fieldurl
- The url of the CIM serverrequestMethod
- The HTTP request method (POST or MPOST)- Throws:
NoSuchAlgorithmException
-
toString
-
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
orfalse
-
isKeptAlive
public abstract boolean isKeptAlive()Determines if the connection is kept alive after the "401 Unauthorized" response- Returns:
true
orfalse
-
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 constructedpProxy
- Proxy authentication ?pAddress
- Server addresspPort
- Server portpProtocol
- Protocol (http/https)pRealm
- RealmpScheme
- Scheme (e.g. Basic, Digest)- Returns:
- An instance of a AuthInfo subclass or
null
- See Also:
-
createAuthorizationInfo
-