ice.net
Class Authentication

java.lang.Object
  extended byice.net.Authentication
All Implemented Interfaces:
Serializable

public class Authentication
extends Object
implements Serializable

For more complete information about HTTP authentication, please read the following:

Author:
Jack van Ooststroom
See Also:
AuthenticationManager, AuthenticationListener, AuthenticationEvent, Serialized Form

Field Summary
static int BASIC
           
static int DIGEST
           
static int NTLM
           
 
Constructor Summary
Authentication(URL requestUri)
          Instantiates an Authentication with the specified requestUri.
 
Method Summary
 String getAuthString()
           
 String getLocation()
          Actually gets the string representation of the request-URI of this Authentication.
 String getMethod()
          Gets the method of this Authentication.
 String getNonce()
          Gets the nonce of this Authentication.
 String getPassword()
          Gets the password of this Authentication.
 String getRealm()
          Gets the realm of this Authentication.
 String getType()
          Gets the type of this Authentication.
 URL getUrl()
          Actually gets the URI representation of the request-URI of this Authentication.
 String getUserName()
          Gets the user name of this Authentication.
 boolean giveUp()
          Indicates if this Authentcation has been given up.
 boolean inProgress()
          Indicates if this Authentication is "in progress".
 boolean isConfirmed()
          Indicates if this Authentication is confirmed.
 boolean isProxyAuth()
          Indicates if this Authentication is a proxy authentication.
 boolean isVolatile()
          Determines if this Authentication is volatile.
 void setConfirmed(boolean confirmed)
           
 void setGiveUp(boolean giveUp)
           
 void setIsProxyAuth(boolean isProxyAuthentication)
           
 void setMethod(String method)
          Sets the method of this Authentication to the specified method.
 void setNonce(String nonce)
          Sets the nonce of this Authentication to the specified nonce.
 void setPassword(String password)
          Sets the password of this Authentication to the specified password.
 void setRealm(String realm)
          Sets the realm of this Authentication to the specified realm.
 void setType(int type)
          Sets the type of this Authentication to the specified type.
 void setUserName(String userName)
          Sets the user name of this Authentication to the specified userName.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

BASIC

public static final int BASIC
See Also:
Constant Field Values

DIGEST

public static final int DIGEST
See Also:
Constant Field Values

NTLM

public static final int NTLM
See Also:
Constant Field Values
Constructor Detail

Authentication

public Authentication(URL requestUri)

Instantiates an Authentication with the specified requestUri.

Parameters:
requestUri - the request-URI of the Authentication to be created.
Method Detail

getAuthString

public String getAuthString()

getLocation

public String getLocation()

Actually gets the string representation of the request-URI of this Authentication.

Returns:
the location.

getMethod

public String getMethod()

Gets the method of this Authentication.

That is, the method is the HTTP request method which is part of the checksum contained in the response.

Returns:
the method.
See Also:
setMethod(String)

getNonce

public String getNonce()

Gets the nonce of this Authentication.

That is, a nonce is a server-specified data string which should be uniquely generated each time a 401 response is made. It is recommended that this string be Base64 or hexadecimal data. Specifically, since the string is passed in the header lines as a quoted string, the double-quote character is not allowed.

The nonce is opaque to the client.

Returns:
the nonce.
See Also:
setNonce(String)

getPassword

public String getPassword()

Gets the password of this Authentication.

Returns:
the password.
See Also:
setPassword(String)

getRealm

public String getRealm()

Gets the realm of this Authentication.

That is, a realm is a string to be displayed to users so they know which user name and password to use. This string should contain at least the name of the host performing the authentication and might additionally indicate the collection of users who might have access.

Examples might be "WallyWorld" and "registerd_users@gotham.news.com".

Returns:
the realm.
See Also:
setRealm(String)

getType

public String getType()

Gets the type of this Authentication.

Returns:
the type.
See Also:
setType(int)

getUrl

public URL getUrl()

Actually gets the URI representation of the request-URI of this Authentication.

Returns:
the URL.

getUserName

public String getUserName()

Gets the user name of this Authentication.

That is, the user name is the user's name in the specified realm.

Returns:
the user name.
See Also:
setUserName(String)

giveUp

public boolean giveUp()

Indicates if this Authentcation has been given up.

Returns:
true if this Authentication has been given up, false if not.
See Also:
setGiveUp(boolean)

inProgress

public boolean inProgress()

Indicates if this Authentication is "in progress".

Returns:
true if this Authentication is "in progress", false if not.

isConfirmed

public boolean isConfirmed()

Indicates if this Authentication is confirmed.

Returns:
true if this Authentication is confirmed, false if not.
See Also:
setConfirmed(boolean)

isProxyAuth

public boolean isProxyAuth()

Indicates if this Authentication is a proxy authentication.

Returns:
true if this Authentication is a proxy authentication, false if not.
See Also:
setIsProxyAuth(boolean)

isVolatile

public boolean isVolatile()

Determines if this Authentication is volatile.

Returns:
true if this Authentication is volatile, false if not.

setConfirmed

public void setConfirmed(boolean confirmed)
Parameters:
confirmed -

setGiveUp

public void setGiveUp(boolean giveUp)
Parameters:
giveUp -

setIsProxyAuth

public void setIsProxyAuth(boolean isProxyAuthentication)
Parameters:
isProxyAuthentication -

setMethod

public void setMethod(String method)

Sets the method of this Authentication to the specified method.

Parameters:
method - the new method.
See Also:
getMethod()

setNonce

public void setNonce(String nonce)

Sets the nonce of this Authentication to the specified nonce.

Parameters:
nonce - the new nonce.
See Also:
getNonce()

setPassword

public void setPassword(String password)

Sets the password of this Authentication to the specified password.

Parameters:
password - the new password.
See Also:
getPassword()

setRealm

public void setRealm(String realm)

Sets the realm of this Authentication to the specified realm.

Parameters:
realm - the new realm.
See Also:
getRealm()

setType

public void setType(int type)

Sets the type of this Authentication to the specified type. If an unknown authentication type is submitted, it defaults to BASIC.

Parameters:
type - the new type.
See Also:
getType()

setUserName

public void setUserName(String userName)

Sets the user name of this Authentication to the specified userName.

Parameters:
userName - the new user name.
See Also:
getUserName()

toString

public String toString()