Class AuthorizationInfo
java.lang.Object
org.sblim.cimclient.internal.http.AuthorizationInfo
- Direct Known Subclasses:
PegasusLocalAuthInfo, WwwAuthInfo
Abstract superclass for HTTP authorization information.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Stringprotected Stringprotected Stringprotected Stringprotected PasswordAuthenticationprotected longprotected Stringprotected Stringprotected intprotected Stringprotected Stringprotected Stringprotected Stringprotected Stringprotected String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic AuthorizationInfocreateAuthorizationInfo(String pModule) Factory method for AuthorizationInfo objects.static AuthorizationInfocreateAuthorizationInfo(String pModule, Boolean pProxy, String pAddress, int pPort, String pProtocol, String pRealm, String pScheme) Factory method for AuthorizationInfo objects.getA1()Returns A1getAddr()Returns the addressReturns algorithmReturns cnonceReturns the credentialsabstract StringGets the HTTP header field name for this authentication informationlonggetNc()Returns ncgetNonce()Returns nonceReturns opaqueintgetPort()Returns the portReturns the protocolgetQop()Returns QopgetRealm()Returns the realmReturns responseReturns the schemegetURI()Returns URIvoidInitializeabstract booleanDetermines if the connection is kept alive after the "401 Unauthorized" responseabstract booleanDetermines if the authorization information is already sent on the very first http request or after the "401 Unauthorized" responsebooleanCompares two authorization informations.voidSets A1voidsetAlgorithm(String algorithm) Set algorithmvoidSet cnoncevoidsetCredentials(PasswordAuthentication credentials) Sets credentialsvoidsetNc(long nc) Sets ncvoidSets noncevoidSets opaquevoidSets QopvoidSets the realmvoidsetResponse(String response) Sets responsevoidSets the schemevoidSets URIabstract StringtoString()abstract voidupdateAuthenticationInfo(Challenge challenge, String authenticate, URI url, String requestMethod) Updates the authorization information according 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
-
AuthorizationInfo
public AuthorizationInfo()
-
-
Method Details
-
init
-
setOpaque
-
getOpaque
-
getQop
-
setQop
-
getNc
public long getNc()Returns nc- Returns:
- nc
-
setNc
public void setNc(long nc) Sets nc- Parameters:
nc- New value
-
setNonce
-
getNonce
-
setCnonce
-
getCnonce
-
setAlgorithm
-
getAlgorithm
-
getA1
-
setA1
-
setResponse
-
getResponse
-
getURI
-
setURI
-
setCredentials
Sets credentials- Parameters:
credentials- New value
-
getAddr
-
getPort
public int getPort()Returns the port- Returns:
- The server port
-
getProtocol
-
getRealm
-
setRealm
-
getScheme
-
setScheme
-
getCredentials
-
match
Compares two authorization informations.- Parameters:
obj- The other authorization information- Returns:
trueif type, realm, scheme, address, protocol and port of both authorization informations are equal,falseotherwise.
-
updateAuthenticationInfo
public abstract void updateAuthenticationInfo(Challenge challenge, String authenticate, URI url, String requestMethod) throws NoSuchAlgorithmException Updates the authorization information according 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:
trueorfalse
-
isKeptAlive
public abstract boolean isKeptAlive()Determines if the connection is kept alive after the "401 Unauthorized" response- Returns:
trueorfalse
-
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 constructedpProxy- Proxy authentication ?pAddress- Server addresspPort- Server portpProtocol- Protocol (http/https)pRealm- RealmpScheme- Scheme (e.g. Basic, Digest)- Returns:
- An instance of a AuthorizationInfo subclass or
null - See Also:
-
createAuthorizationInfo
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
-