org.restlet.data

## Class ChallengeMessage

- java.lang.Object
- - org.restlet.data.ChallengeMessage

Direct Known Subclasses:
  ChallengeRequest, ChallengeResponse

    public abstract class ChallengeMessage
    extends java.lang.Object

Base authentication challenge message exchanged between an origin server and a client.

Author:
  Jerome Louvel

### Field Summary

Fields
`static java.lang.String` `QUALITY_AUTHENTICATION` Authentication quality.
`static java.lang.String` `QUALITY_AUTHENTICATION_INTEGRITY` Authentication and integrity.

### Constructor Summary

Constructors
Constructor and Description
`ChallengeMessage(ChallengeScheme scheme)` Constructor.
`ChallengeMessage(ChallengeScheme scheme, Series<Parameter> parameters)` Constructor.
`ChallengeMessage(ChallengeScheme scheme, java.lang.String realm)` Constructor.
`ChallengeMessage(ChallengeScheme scheme, java.lang.String realm, Series<Parameter> parameters)` Constructor.

### Method Summary

Methods
`java.lang.String` `getDigestAlgorithm()` Returns the digest algorithm.
`java.lang.String` `getOpaque()` Returns an opaque string of data which should be returned by the client unchanged.
`Series<Parameter>` `getParameters()` Returns the modifiable series of scheme parameters.
`java.lang.String` `getRawValue()` Returns the raw challenge value.
`java.lang.String` `getRealm()` Returns the realm name.
`ChallengeScheme` `getScheme()` Returns the scheme used.
`java.lang.String` `getServerNonce()` Returns the server nonce.
`int` `hashCode()`
`void` `setDigestAlgorithm(java.lang.String digestAlgorithm)` Sets the digest algorithm.
`void` `setOpaque(java.lang.String opaque)` Sets an opaque string of data which should be returned by the client unchanged.
`void` `setParameters(Series<Parameter> parameters)` Sets the parameters.
`void` `setRawValue(java.lang.String rawValue)` Sets the raw value.
`void` `setRealm(java.lang.String realm)` Sets the realm name.
`void` `setScheme(ChallengeScheme scheme)` Sets the scheme used.
`void` `setServerNonce(java.lang.String serverNonce)` Sets the server nonce.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, notify, notifyAll, toString, wait, wait, wait`

### Field Detail

#### QUALITY_AUTHENTICATION

    public static final java.lang.String QUALITY_AUTHENTICATION

Authentication quality.

See Also:
  Constant Field Values

#### QUALITY_AUTHENTICATION_INTEGRITY

    public static final java.lang.String QUALITY_AUTHENTICATION_INTEGRITY

Authentication and integrity.

See Also:
  Constant Field Values

### Constructor Detail

#### ChallengeMessage

    public ChallengeMessage(ChallengeScheme scheme)

Constructor.

Parameters:
  `scheme` - The challenge scheme.

#### ChallengeMessage

    public ChallengeMessage(ChallengeScheme scheme,
                    Series<Parameter> parameters)

Constructor.

Parameters:
  `scheme` - The challenge scheme.
  `parameters` - The additional scheme parameters.

#### ChallengeMessage

    public ChallengeMessage(ChallengeScheme scheme,
                    java.lang.String realm)

Constructor.

Parameters:
  `scheme` - The challenge scheme.
  `realm` - The authentication realm.

#### ChallengeMessage

    public ChallengeMessage(ChallengeScheme scheme,
                    java.lang.String realm,
                    Series<Parameter> parameters)

Constructor.

Parameters:
  `scheme` - The challenge scheme.
  `realm` - The authentication realm.
  `parameters` - The additional scheme parameters.

### Method Detail

#### getDigestAlgorithm

    public java.lang.String getDigestAlgorithm()

Returns the digest algorithm. See `Digest` class for DIGEST_* constants. Default value is `Digest.ALGORITHM_MD5`.

Returns:
  The digest algorithm.

#### getOpaque

    public java.lang.String getOpaque()

Returns an opaque string of data which should be returned by the client unchanged.

Returns:
  An opaque string of data.

#### getParameters

    public Series<Parameter> getParameters()

Returns the modifiable series of scheme parameters. Creates a new instance if no one has been set.

Returns:
  The modifiable series of scheme parameters.

#### getRawValue

    public java.lang.String getRawValue()

Returns the raw challenge value.

Returns:
  The raw challenge value.

#### getRealm

    public java.lang.String getRealm()

Returns the realm name.

Returns:
  The realm name.

#### getScheme

    public ChallengeScheme getScheme()

Returns the scheme used.

Returns:
  The scheme used.

#### getServerNonce

    public java.lang.String getServerNonce()

Returns the server nonce.

Returns:
  The server nonce.

#### hashCode

    public int hashCode()

Overrides:
  `hashCode` in class `java.lang.Object`

#### setDigestAlgorithm

    public void setDigestAlgorithm(java.lang.String digestAlgorithm)

Sets the digest algorithm. See `Digest` class for ALGORITHM_* constants. Default value is `Digest.ALGORITHM_MD5`.

Parameters:
  `digestAlgorithm` - The digest algorithm.

#### setOpaque

    public void setOpaque(java.lang.String opaque)

Sets an opaque string of data which should be returned by the client unchanged.

Parameters:
  `opaque` - An opaque string of data.

#### setParameters

    public void setParameters(Series<Parameter> parameters)

Sets the parameters.

Parameters:
  `parameters` - The parameters.

#### setRawValue

    public void setRawValue(java.lang.String rawValue)

Sets the raw value.

Parameters:
  `rawValue` - The raw value.

#### setRealm

    public void setRealm(java.lang.String realm)

Sets the realm name.

Parameters:
  `realm` - The realm name.

#### setScheme

    public void setScheme(ChallengeScheme scheme)

Sets the scheme used.

Parameters:
  `scheme` - The scheme used.

#### setServerNonce

    public void setServerNonce(java.lang.String serverNonce)

Sets the server nonce.

Parameters:
  `serverNonce` - The server nonce.