Service tunnelling method names or client preferences via query parameters.
Clients applications such as browsers can easily override the default values
of their client connector by specifying additional query parameters. Here is
the list of the default parameter names supported:
Property
Default name
Value type
Description
methodParameter
method
See values in org.restlet.data.Method
For POST requests, specify the actual method to use (DELETE, PUT, etc.).
characterSetParameter
charset
Use extension names defined in org.restlet.service.MetadataService
For GET requests, replaces the accepted character set by the given
value.
encodingParameter
encoding
Use extension names defined in org.restlet.service.MetadataService
For GET requests, replaces the accepted encoding by the given value.
languageParameter
language
Use extension names defined in org.restlet.service.MetadataService
For GET requests, replaces the accepted language by the given value.
mediaTypeParameter
media
Use extension names defined in org.restlet.service.MetadataService
For GET requests, replaces the accepted media type set by the given
value.
setMethodTunnel(boolean methodTunnel) Indicates if the method name can be tunneled.
public void
setPreferencesTunnel(boolean preferencesTunnel) Indicates if the client preferences can be tunneled.
Constructor Detail
TunnelService
public TunnelService(boolean enabled, boolean methodTunnel, boolean preferencesTunnel)(Code)
Constructor.
Parameters: enabled - True if the service has been enabled. Parameters: methodTunnel - Indicates if the method name can be tunneled. Parameters: preferencesTunnel - Indicates if the client preferences can be tunneled.
Indicates if the request from a given client can be tunnelled. The
default implementation always return true. This could be customize to
restrict the usage of the tunnel service.
Parameters: client - The client to test. True if the request from a given client can be tunnelled.
Indicates if the service should be enabled.
Parameters: enabled - True if the service should be enabled.
setEncodingAttribute
public void setEncodingAttribute(String parameterName)(Code)
Sets the name of the parameter containing the accepted encoding.
Parameters: parameterName - The name of the parameter containing the accepted encoding.
setLanguageAttribute
public void setLanguageAttribute(String parameterName)(Code)
Sets the name of the parameter containing the accepted language.
Parameters: parameterName - The name of the parameter containing the accepted language.
setMediaTypeAttribute
public void setMediaTypeAttribute(String parameterName)(Code)
Sets the name of the parameter containing the accepted media type.
Parameters: parameterName - The name of the parameter containing the accepted media type.
setMethodParameter
public void setMethodParameter(String parameterName)(Code)
Sets the method parameter name.
Parameters: parameterName - The method parameter name.
setMethodTunnel
public void setMethodTunnel(boolean methodTunnel)(Code)
Indicates if the method name can be tunneled.
Parameters: methodTunnel - True if the method name can be tunneled.
setPreferencesTunnel
public void setPreferencesTunnel(boolean preferencesTunnel)(Code)
Indicates if the client preferences can be tunneled.
Parameters: preferencesTunnel - True if the client preferences can be tunneled.