org.restlet.engine.http.connector

## Class ConnectedRequest

- java.lang.Object
- - org.restlet.Message
  - - org.restlet.Request
    - - org.restlet.engine.http.connector.ConnectedRequest

    public class ConnectedRequest
    extends Request

Request wrapper for server HTTP calls.

Author:
  Jerome Louvel

### Constructor Summary

Constructors
Constructor and Description
`ConnectedRequest(ConnectedRequest request)` Copy constructor.
`ConnectedRequest(Context context, ServerConnection connection, Method method, java.lang.String resourceUri, java.lang.String version, Series<Parameter> headers, Representation entity, boolean confidential, java.security.Principal userPrincipal)` Constructor.

### Method Summary

Methods
`boolean` `abort()` Ask the connector to attempt to abort the related network connection, for example immediately closing the socket.
`static void` `addHeader(Request request, java.lang.String headerName, java.lang.String headerValue)` Adds a new header to the given request.
`void` `commit(Response response)` Asks the server connector to immediately commit the given response associated to this request, making it ready to be sent back to the client.
`java.util.List<CacheDirective>` `getCacheDirectives()` Returns the cache directives. Note that when used with HTTP connectors, this property maps to the "Cache-Control" header.
`ChallengeResponse` `getChallengeResponse()` Returns the authentication response sent by a client to an origin server.
`ClientInfo` `getClientInfo()` Returns the client-specific information.
`Conditions` `getConditions()` Returns the condition data applying to this call.
`protected ServerConnection` `getConnection()`
`Series<Cookie>` `getCookies()` Returns the cookies provided by the client.
`Series<Parameter>` `getHeaders()` Returns the HTTP headers.
`ChallengeResponse` `getProxyChallengeResponse()` Returns the authentication response sent by a client to a proxy.
`java.util.List<Range>` `getRanges()` Returns the ranges to return from the target resource's representation.
`java.util.List<RecipientInfo>` `getRecipientsInfo()` Returns the intermediary recipient information. Note that when used with HTTP connectors, this property maps to the "Via" headers.
`Reference` `getReferrerRef()` Returns the referrer reference if available.
`java.security.Principal` `getUserPrincipal()`
`java.util.List<Warning>` `getWarnings()` Returns the additional warnings information. Note that when used with HTTP connectors, this property maps to the "Warning" headers.
`void` `setChallengeResponse(ChallengeResponse response)` Sets the authentication response sent by a client to an origin server.
`void` `setProxyChallengeResponse(ChallengeResponse response)` Sets the authentication response sent by a client to a proxy.
`void` `setRecipientsInfo(java.util.List<RecipientInfo> recipientsInfo)` Sets the modifiable list of intermediary recipients.
`void` `setWarnings(java.util.List<Warning> warnings)` Sets the additional warnings information.

### Methods inherited from class org.restlet.Request

`getCurrent, getHostRef, getMaxForwards, getMethod, getOnResponse, getOriginalRef, getProtocol, getResourceRef, getRootRef, isConfidential, isEntityAvailable, isExpectingResponse, setClientInfo, setConditions, setCookies, setHostRef, setHostRef, setMaxForwards, setMethod, setOnResponse, setOriginalRef, setProtocol, setRanges, setReferrerRef, setReferrerRef, setResourceRef, setResourceRef, setRootRef, toString`

### Methods inherited from class org.restlet.Message

`getAttributes, getDate, getEntity, getEntityAsForm, getEntityAsText, getOnSent, release, setAttributes, setCacheDirectives, setDate, setEntity, setEntity, setOnSent`

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

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

### Constructor Detail

#### ConnectedRequest

    public ConnectedRequest(ConnectedRequest request)

Copy constructor.

Parameters:
  `request` - The request to copy.

#### ConnectedRequest

    public ConnectedRequest(Context context,
                    ServerConnection connection,
                    Method method,
                    java.lang.String resourceUri,
                    java.lang.String version,
                    Series<Parameter> headers,
                    Representation entity,
                    boolean confidential,
                    java.security.Principal userPrincipal)

Constructor.

Parameters:
  `context` - The context of the parent connector.
  `connection` - The associated network connection.
  `method` - The protocol method.
  `resourceUri` - The target resource URI.
  `version` - The protocol version.
  `headers` - The request headers.
  `entity` - The request entity.
  `confidential` - True if received confidentially.
  `userPrincipal` - The user principal.

### Method Detail

#### addHeader

    public static void addHeader(Request request,
                 java.lang.String headerName,
                 java.lang.String headerValue)

Adds a new header to the given request.

Parameters:
  `request` - The request to update.
  `headerName` - The header name to add.
  `headerValue` - The header value to add.

#### abort

    public boolean abort()

Description copied from class: `Request`
Ask the connector to attempt to abort the related network connection, for example immediately closing the socket.

Overrides:
  `abort` in class `Request`
Returns:
  True if the request was aborted.

#### commit

    public void commit(Response response)

Description copied from class: `Request`
Asks the server connector to immediately commit the given response associated to this request, making it ready to be sent back to the client. Note that all server connectors don't necessarily support this feature.

Overrides:
  `commit` in class `Request`

#### getCacheDirectives

    public java.util.List<CacheDirective> getCacheDirectives()

Description copied from class: `Message`
Returns the cache directives.
Note that when used with HTTP connectors, this property maps to the "Cache-Control" header.

Overrides:
  `getCacheDirectives` in class `Message`
Returns:
  The cache directives.

#### getChallengeResponse

    public ChallengeResponse getChallengeResponse()

Description copied from class: `Request`
Returns the authentication response sent by a client to an origin server. Note that when used with HTTP connectors, this property maps to the "Authorization" header.

Overrides:
  `getChallengeResponse` in class `Request`
Returns:
  The authentication response sent by a client to an origin server.

#### getClientInfo

    public ClientInfo getClientInfo()

Returns the client-specific information.

Overrides:
  `getClientInfo` in class `Request`
Returns:
  The client-specific information.

#### getConditions

    public Conditions getConditions()

Returns the condition data applying to this call.

Overrides:
  `getConditions` in class `Request`
Returns:
  The condition data applying to this call.

#### getConnection

    protected ServerConnection getConnection()

#### getCookies

    public Series<Cookie> getCookies()

Returns the cookies provided by the client.

Overrides:
  `getCookies` in class `Request`
Returns:
  The cookies provided by the client.

#### getHeaders

    public Series<Parameter> getHeaders()

Returns the HTTP headers.

Returns:
  The HTTP headers.

#### getProxyChallengeResponse

    public ChallengeResponse getProxyChallengeResponse()

Description copied from class: `Request`
Returns the authentication response sent by a client to a proxy. Note that when used with HTTP connectors, this property maps to the "Proxy-Authorization" header.

Overrides:
  `getProxyChallengeResponse` in class `Request`
Returns:
  The authentication response sent by a client to a proxy.

#### getRanges

    public java.util.List<Range> getRanges()

Description copied from class: `Request`
Returns the ranges to return from the target resource's representation. Note that when used with HTTP connectors, this property maps to the "Range" header.

Overrides:
  `getRanges` in class `Request`
Returns:
  The ranges to return.

#### getRecipientsInfo

    public java.util.List<RecipientInfo> getRecipientsInfo()

Description copied from class: `Message`
Returns the intermediary recipient information.
Note that when used with HTTP connectors, this property maps to the "Via" headers.

Overrides:
  `getRecipientsInfo` in class `Message`
Returns:
  The intermediary recipient information.

#### getReferrerRef

    public Reference getReferrerRef()

Returns the referrer reference if available.

Overrides:
  `getReferrerRef` in class `Request`
Returns:
  The referrer reference.

#### getUserPrincipal

    public java.security.Principal getUserPrincipal()

#### getWarnings

    public java.util.List<Warning> getWarnings()

Description copied from class: `Message`
Returns the additional warnings information.
Note that when used with HTTP connectors, this property maps to the "Warning" headers.

Overrides:
  `getWarnings` in class `Message`
Returns:
  The additional warnings information.

#### setChallengeResponse

    public void setChallengeResponse(ChallengeResponse response)

Description copied from class: `Request`
Sets the authentication response sent by a client to an origin server. Note that when used with HTTP connectors, this property maps to the "Authorization" header.

Overrides:
  `setChallengeResponse` in class `Request`
Parameters:
  `response` - The authentication response sent by a client to an origin server.

#### setProxyChallengeResponse

    public void setProxyChallengeResponse(ChallengeResponse response)

Description copied from class: `Request`
Sets the authentication response sent by a client to a proxy. Note that when used with HTTP connectors, this property maps to the "Proxy-Authorization" header.

Overrides:
  `setProxyChallengeResponse` in class `Request`
Parameters:
  `response` - The authentication response sent by a client to a proxy.

#### setRecipientsInfo

    public void setRecipientsInfo(java.util.List<RecipientInfo> recipientsInfo)

Description copied from class: `Message`
Sets the modifiable list of intermediary recipients. Note that when used with HTTP connectors, this property maps to the "Via" headers. This method clears the current list and adds all entries in the parameter list.

Overrides:
  `setRecipientsInfo` in class `Message`
Parameters:
  `recipientsInfo` - A list of intermediary recipients.

#### setWarnings

    public void setWarnings(java.util.List<Warning> warnings)

Description copied from class: `Message`
Sets the additional warnings information. Note that when used with HTTP connectors, this property maps to the "Warning" headers. This method clears the current list and adds all entries in the parameter list.

Overrides:
  `setWarnings` in class `Message`
Parameters:
  `warnings` - The warnings.