jain.protocol.ip.sip
Class Credentials

java.lang.Object
  |
  +--jain.protocol.ip.sip.Credentials
Direct Known Subclasses:
BasicCredentials, DigestCredentials

public class Credentials
extends java.lang.Object

This class represents generic credentials for an authentication scheme. A user agent that wishes to authenticate itself with a user agent server--usually, but not necessarily, after receiving an UNAUTHORIZED ResponseMessage - may do so by including an AuthorizationHeader with the RequestMessage. A client that wishes to authenticate itself with a proxy--usually, but not necessarily, after receiving a PROXY_AUTHENTICATION_REQUIRED ResponseMessage - may do so by including a ProxyAuthorizationHeader with the RequestMessage. Both the AuthorizationHeader and the ProxyAuthorizationHeader values consist of credentials containing the authentication information of the client for the realm of the resource being requested. The user agent must choose to use one of the Challenges with the strongest Scheme it understands and request Credentials from the user based upon that Challenge.

Version:
0.6
See Also:
ResponseMessage, AuthorizationHeader, ProxyAuthorizationHeader

Constructor Summary
Credentials(java.lang.String scheme)
          Creates Credentials based on given authentication scheme
 
Method Summary
 java.lang.Object clone()
          Creates and returns a copy of Credentials
 boolean equals(Credentials credentials)
          Indicates whether some other Credentials is "equal to" this one
 java.lang.String getExtension(java.lang.String extension)
          Gets the value of specified parameter in Credentials
 java.lang.String[] getExtensions()
          Gets an array of Credentials's parameter names
 java.lang.String getScheme()
          Method used to get the scheme
 boolean hasExtension(java.lang.String extension)
          Gets boolean value to indicate if the Credentials has specified extension parameter
 boolean hasExtensions()
          Gets boolean value to indicate if the Credentials has extension parameters
 void removeExtension(java.lang.String extension)
          Removes specified extension parameter from Credentials
 void removeExtensions()
          Removes all extension parameters from Credentials
 void setExtension(java.lang.String extension, java.lang.String value)
          Sets value of parameter to value in Credentials
 void setScheme(java.lang.String scheme)
          Method used to set the scheme
 java.lang.String toString()
          Gets string representation of Credentials
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Credentials

public Credentials(java.lang.String scheme)
            throws java.lang.IllegalArgumentException
Creates Credentials based on given authentication scheme
Parameters:
scheme - authentication scheme
Throws:
java.lang.IllegalArgumentException - if scheme is null or zero-length
Method Detail

setScheme

public void setScheme(java.lang.String scheme)
               throws java.lang.IllegalArgumentException
Method used to set the scheme
Parameters:
String - the scheme

getScheme

public java.lang.String getScheme()
Method used to get the scheme
Returns:
the scheme

removeExtension

public void removeExtension(java.lang.String extension)
Removes specified extension parameter from Credentials
Parameters:
extension - extension parameter to remove from Credentials

removeExtensions

public void removeExtensions()
Removes all extension parameters from Credentials

getExtension

public java.lang.String getExtension(java.lang.String extension)
                              throws ParameterNotSetException
Gets the value of specified parameter in Credentials
Parameters:
parameter - parameter to retrieve
Returns:
the value of specified parameter in Credentials
Throws:
ParameterNotSetException - if the extension does not exist

getExtensions

public java.lang.String[] getExtensions()
                                 throws ParameterNotSetException
Gets an array of Credentials's parameter names
Returns:
an array of Credentials's parameter names
Throws:
ParameterNotSetException - if no extensions exist

hasExtensions

public boolean hasExtensions()
Gets boolean value to indicate if the Credentials has extension parameters
Returns:
boolean value to indicate if the Credentials has parameters

hasExtension

public boolean hasExtension(java.lang.String extension)
Gets boolean value to indicate if the Credentials has specified extension parameter
Returns:
boolean value to indicate if the Credentials has specified extension parameter

setExtension

public void setExtension(java.lang.String extension,
                         java.lang.String value)
Sets value of parameter to value in Credentials
Parameters:
parameter - name of parameter
value - value of parameter
Throws:
java.lang.IllegalArgumentException - if parameter or value are null or zero-length

toString

public java.lang.String toString()
Gets string representation of Credentials
Overrides:
toString in class java.lang.Object
Returns:
string representation of Credentials

clone

public java.lang.Object clone()
Creates and returns a copy of Credentials
Returns:
copy of Credentials

equals

public boolean equals(Credentials credentials)
Indicates whether some other Credentials is "equal to" this one
Parameters:
credentials - the Credentials with which to compare


If you have any comments or queries, please mail them to JAIN-SIP-interest@sun.com


Copyright - 2000 Sun Microsystems