org.restlet.engine.application

## Class TunnelFilter

- java.lang.Object
- - org.restlet.Restlet
  - - org.restlet.routing.Filter
    - - org.restlet.engine.application.TunnelFilter

All Implemented Interfaces:
  Uniform

    public class TunnelFilter
    extends Filter

Filter tunneling browser calls into full REST calls. The request method can be changed (via POST requests only) as well as the accepted media types, languages, encodings and character sets. Concurrency note: instances of this class or its subclasses can be invoked by several threads at the same time and therefore must be thread-safe. You should be especially careful when storing state in member variables.

Author:
  Jerome Louvel

### Field Summary

### Fields inherited from class org.restlet.routing.Filter

`CONTINUE, SKIP, STOP`

### Constructor Summary

Constructors
Constructor and Description
`TunnelFilter(Context context)` Constructor.

### Method Summary

Methods
`int` `beforeHandle(Request request, Response response)` Allows filtering before processing by the next Restlet.
`MetadataService` `getMetadataService()` Returns the metadata service of the parent application.
`TunnelService` `getTunnelService()` Returns the tunnel service of the parent application.

### Methods inherited from class org.restlet.routing.Filter

`afterHandle, doHandle, getNext, handle, hasNext, setNext, setNext, start, stop`

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

`finalize, getApplication, getAuthor, getContext, getDescription, getLogger, getName, getOwner, isStarted, isStopped, setAuthor, setContext, setDescription, setName, setOwner`

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

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

### Constructor Detail

#### TunnelFilter

    public TunnelFilter(Context context)

Constructor.

Parameters:
  `context` - The parent context.

### Method Detail

#### beforeHandle

    public int beforeHandle(Request request,
                   Response response)

Description copied from class: `Filter`
Allows filtering before processing by the next Restlet. Returns `Filter.CONTINUE` by default.

Overrides:
  `beforeHandle` in class `Filter`
Parameters:
  `request` - The request to handle.
  `response` - The response to update.
Returns:
  The continuation status. Either `Filter.CONTINUE` or `Filter.SKIP` or `Filter.STOP`.

#### getMetadataService

    public MetadataService getMetadataService()

Returns the metadata service of the parent application.

Returns:
  The metadata service of the parent application.

#### getTunnelService

    public TunnelService getTunnelService()

Returns the tunnel service of the parent application.

Returns:
  The tunnel service of the parent application.