public class TunnelService extends Service
| Property | Default name | Value type | Description |
|---|---|---|---|
| methodParameter | method | See values in Method |
For POST requests, let you specify the actual method to use (DELETE, PUT, MOVE, etc.). For GET requests, let you specify OPTIONS as the actual method to use. |
| characterSetParameter | charset | Use extension names defined in MetadataService or the full
character set name |
For GET requests, replaces the accepted character set by the given value. |
| encodingParameter | encoding | Use extension names defined in MetadataService or the full
encoding name |
For GET requests, replaces the accepted encoding by the given value. |
| languageParameter | language | Use extension names defined in MetadataService or the full
language name |
For GET requests, replaces the accepted language by the given value. |
| mediaTypeParameter | media | Use extension names defined in MetadataService or the full media
type name |
For GET requests, replaces the accepted media type set by the given value. |
| methodHeader | X-HTTP-Method-Override | Name of non-standard header. It is a good practice to prefix it with "X-". | For POST requests, let you specify the actual method to use (DELETE, PUT, MOVE, etc.). |
ClientInfo.getAgentAttributes() method. Check the
isUserAgentTunnel() method.agentName: firefox acceptOld: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,\*\/\*;q=0.5 acceptNew: application/xhtml+xml,text/html,text/xml;q=0.9,application/xml;q=0.9,text/plain;q=0.8,image/png,\*\/\*;q=0.5Each declared property is a condition that must be filled in order to update the client preferences. For example "agentName: firefox" expresses the fact this block concerns only "firefox" clients.
| Constructor and Description |
|---|
TunnelService(boolean methodTunnel,
boolean preferencesTunnel)
Constructor that enables the query tunnel and disables the extensions and
user agent tunnels.
|
TunnelService(boolean enabled,
boolean methodTunnel,
boolean preferencesTunnel)
Constructor that enables the query tunnel and disables the extensions and
user agent tunnels.
|
TunnelService(boolean enabled,
boolean methodTunnel,
boolean preferencesTunnel,
boolean queryTunnel,
boolean extensionsTunnel)
Constructor that disables the user agent tunnel.
|
TunnelService(boolean enabled,
boolean methodTunnel,
boolean preferencesTunnel,
boolean queryTunnel,
boolean extensionsTunnel,
boolean userAgentTunnel)
Constructor that enables the header tunneling.
|
TunnelService(boolean enabled,
boolean methodTunnel,
boolean preferencesTunnel,
boolean queryTunnel,
boolean extensionsTunnel,
boolean userAgentTunnel,
boolean headersTunnel)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
allowClient(ClientInfo client)
Indicates if the request from a given client can be tunneled.
|
Filter |
createInboundFilter(Context context)
Create the filter that should be invoked for incoming calls.
|
String |
getCharacterSetParameter()
Returns the character set parameter name.
|
String |
getEncodingParameter()
Returns the name of the parameter containing the accepted encoding.
|
String |
getLanguageParameter()
Returns the name of the parameter containing the accepted language.
|
String |
getMediaTypeParameter()
Returns the name of the parameter containing the accepted media type.
|
String |
getMethodHeader()
Returns the name of the header containing the method name.
|
String |
getMethodParameter()
Returns the method parameter name.
|
boolean |
isExtensionsTunnel()
Indicates if the client preferences can be tunneled via the extensions.
|
boolean |
isHeadersTunnel()
Indicates if the method can be tunneled via the header.
|
boolean |
isMethodTunnel()
Indicates if the method name can be tunneled.
|
boolean |
isPreferencesTunnel()
Indicates if the client preferences can be tunneled via the query parameters
or via file extensions.
|
boolean |
isQueryTunnel()
Indicates if the method and client preferences can be tunneled via query
parameters or file extensions.
|
boolean |
isUserAgentTunnel()
Indicates if the client preferences can be tunneled according to the user
agent.
|
void |
setCharacterSetParameter(String parameterName)
Sets the character set parameter name.
|
void |
setEncodingParameter(String parameterName)
Sets the name of the parameter containing the accepted encoding.
|
void |
setExtensionsTunnel(boolean extensionTunnel)
Indicates if the client preferences can be tunneled via the extensions.
|
void |
setHeadersTunnel(boolean headersTunnel)
Indicates if the method can be tunneled via the header.
|
void |
setLanguageParameter(String parameterName)
Sets the name of the parameter containing the accepted language.
|
void |
setMediaTypeParameter(String parameterName)
Sets the name of the parameter containing the accepted media type.
|
void |
setMethodHeader(String methodHeader)
Sets the name of the header containing the method name.
|
void |
setMethodParameter(String parameterName)
Sets the method parameter name.
|
void |
setMethodTunnel(boolean methodTunnel)
Indicates if the method name can be tunneled.
|
void |
setPreferencesTunnel(boolean preferencesTunnel)
Indicates if the client preferences can be tunneled via the query parameters.
|
void |
setQueryTunnel(boolean queryTunnel)
Indicates if the method and client preferences can be tunneled via query
parameters.
|
void |
setUserAgentTunnel(boolean userAgentTunnel)
Indicates if the client preferences can be tunneled according to the user
agent.
|
createOutboundFilter, getContext, isEnabled, isStarted, isStopped, setContext, setEnabled, start, stoppublic TunnelService(boolean methodTunnel,
boolean preferencesTunnel)
methodTunnel - Indicates if the method name can be tunneled.preferencesTunnel - Indicates if the client preferences can be tunneled
by query parameters or file-like extensions or user
agent string.public TunnelService(boolean enabled,
boolean methodTunnel,
boolean preferencesTunnel)
enabled - True if the service has been enabled.methodTunnel - Indicates if the method name can be tunneled.preferencesTunnel - Indicates if the client preferences can be tunneled
by query parameters or file-like extensions or user
agent string.public TunnelService(boolean enabled,
boolean methodTunnel,
boolean preferencesTunnel,
boolean queryTunnel,
boolean extensionsTunnel)
enabled - True if the service has been enabled.methodTunnel - Indicates if the method can be tunneled using a
query parameter.preferencesTunnel - Indicates if the client preferences can be tunneled
using query parameters or file-like extensions or
user agent string.queryTunnel - Indicates if tunneling can use query parameters.extensionsTunnel - Indicates if tunneling can use file-like extensions.public TunnelService(boolean enabled,
boolean methodTunnel,
boolean preferencesTunnel,
boolean queryTunnel,
boolean extensionsTunnel,
boolean userAgentTunnel)
enabled - True if the service has been enabled.methodTunnel - Indicates if the method can be tunneled using a
query parameter.preferencesTunnel - Indicates if the client preferences can be tunneled
using query parameters or file-like extensions or
user agent string.queryTunnel - Indicates if tunneling can use query parameters.extensionsTunnel - Indicates if tunneling can use file-like extensions.userAgentTunnel - Indicates if tunneling can use user agent string.public TunnelService(boolean enabled,
boolean methodTunnel,
boolean preferencesTunnel,
boolean queryTunnel,
boolean extensionsTunnel,
boolean userAgentTunnel,
boolean headersTunnel)
enabled - True if the service has been enabled.methodTunnel - Indicates if the method can be tunneled using a
query parameter.preferencesTunnel - Indicates if the client preferences can be tunneled
using query parameters or file-like extensions or
user agent string.queryTunnel - Indicates if tunneling can use query parameters.extensionsTunnel - Indicates if tunneling can use file-like extensions.userAgentTunnel - Indicates if tunneling can use user agent string.headersTunnel - Indicates if method can be tunneled via a specific
header.public boolean allowClient(ClientInfo client)
client - The client to test.public Filter createInboundFilter(Context context)
ServicecreateInboundFilter in class Servicecontext - The current context.public String getCharacterSetParameter()
public String getEncodingParameter()
public String getLanguageParameter()
public String getMediaTypeParameter()
public String getMethodHeader()
public String getMethodParameter()
public boolean isExtensionsTunnel()
Request.getOriginalRef()public boolean isHeadersTunnel()
public boolean isMethodTunnel()
public boolean isPreferencesTunnel()
public boolean isQueryTunnel()
public boolean isUserAgentTunnel()
public void setCharacterSetParameter(String parameterName)
parameterName - The character set parameter name.public void setEncodingParameter(String parameterName)
parameterName - The name of the parameter containing the accepted
encoding.public void setExtensionsTunnel(boolean extensionTunnel)
extensionTunnel - True if the client preferences can be tunneled via the
extensions.Request.getOriginalRef()public void setHeadersTunnel(boolean headersTunnel)
headersTunnel - True if the method can be tunneled via the header.public void setLanguageParameter(String parameterName)
parameterName - The name of the parameter containing the accepted
language.public void setMediaTypeParameter(String parameterName)
parameterName - The name of the parameter containing the accepted media
type.public void setMethodHeader(String methodHeader)
methodHeader - The name of the header containing the method name.public void setMethodParameter(String parameterName)
parameterName - The method parameter name.public void setMethodTunnel(boolean methodTunnel)
methodTunnel - True if the method name can be tunneled.public void setPreferencesTunnel(boolean preferencesTunnel)
preferencesTunnel - True if the client preferences can be tunneled via
the query parameters.public void setQueryTunnel(boolean queryTunnel)
queryTunnel - True if the method and client preferences can be tunneled
via query parameters.public void setUserAgentTunnel(boolean userAgentTunnel)
userAgentTunnel - True if the client preferences can be tunneled
according to the user agent.Copyright © 2005–2025. All rights reserved.