|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.restlet.service.Service
org.restlet.service.TunnelService
public class TunnelService
Service tunneling request method or client preferences. The tunneling can use
query parameters and file-like extensions. This is particularly useful for
browser-based applications that can't fully control the HTTP requests sent.
Here is the list of the default parameter names supported:
| 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 |
For GET requests, replaces the accepted character set by the given value. | |
| encodingParameter | encoding | Use extension names defined in MetadataService |
For GET requests, replaces the accepted encoding by the given value. | |
| languageParameter | language | Use extension names defined in MetadataService |
For GET requests, replaces the accepted language by the given value. | |
| mediaTypeParameter | media | Use extension names defined in MetadataService |
For GET requests, replaces the accepted media type set by the given value. |
MetadataService.ClientInfo.getAgentAttributes() 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 Summary | |
|---|---|
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. |
|
| Method Summary | |
|---|---|
boolean |
allowClient(ClientInfo client)
Indicates if the request from a given client can be tunnelled. |
String |
getCharacterSetAttribute()
Deprecated. Use getCharacterSetParameter instead. |
String |
getCharacterSetParameter()
Returns the character set parameter name. |
String |
getEncodingAttribute()
Deprecated. Use getEncodingParameter instead. |
String |
getEncodingParameter()
Returns the name of the parameter containing the accepted encoding. |
String |
getLanguageAttribute()
Deprecated. Use getLanguageParameter instead. |
String |
getLanguageParameter()
Returns the name of the parameter containing the accepted language. |
String |
getMediaTypeAttribute()
Deprecated. Use getMediaTypeParameter instead. |
String |
getMediaTypeParameter()
Returns the name of the parameter containing the accepted media type. |
String |
getMethodParameter()
Returns the method parameter name. |
boolean |
isExtensionsTunnel()
Indicates if the client preferences can be tunnelled via the extensions. |
boolean |
isMethodTunnel()
Indicates if the method name can be tunnelled. |
boolean |
isPreferencesTunnel()
Indicates if the client preferences can be tunnelled via the query parameters or file extensions. |
boolean |
isQueryTunnel()
Indicates if the method and client preferences can be tunnelled via query parameters or file extensions. |
boolean |
isUserAgentTunnel()
Indicates if the client preferences can be tunnelled according to the user agent. |
void |
setCharacterSetAttribute(String parameterName)
Deprecated. Use setCharacterSetParameter instead. |
void |
setCharacterSetParameter(String parameterName)
Sets the character set parameter name. |
void |
setEncodingAttribute(String parameterName)
Deprecated. Use setEncodingParameter instead. |
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 tunnelled via the extensions. |
void |
setLanguageAttribute(String parameterName)
Deprecated. Use setLanguageParameter instead. |
void |
setLanguageParameter(String parameterName)
Sets the name of the parameter containing the accepted language. |
void |
setMediaTypeAttribute(String parameterName)
Deprecated. Use setMediaTypeParameter instead. |
void |
setMediaTypeParameter(String parameterName)
Sets the name of the parameter containing the accepted media type. |
void |
setMethodParameter(String parameterName)
Sets the method parameter name. |
void |
setMethodTunnel(boolean methodTunnel)
Indicates if the method name can be tunnelled. |
void |
setPreferencesTunnel(boolean preferencesTunnel)
Indicates if the client preferences can be tunnelled via the query parameters. |
void |
setQueryTunnel(boolean queryTunnel)
Indicates if the method and client preferences can be tunnelled via query parameters. |
void |
setUserAgentTunnel(boolean userAgentTunnel)
Indicates if the client preferences can be tunnelled according to the user agent. |
| Methods inherited from class org.restlet.service.Service |
|---|
isEnabled, isStarted, isStopped, setEnabled, start, stop |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public TunnelService(boolean methodTunnel,
boolean preferencesTunnel)
methodTunnel - Indicates if the method name can be tunnelled.preferencesTunnel - Indicates if the client preferences can be tunnelled 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 tunnelled.preferencesTunnel - Indicates if the client preferences can be tunnelled 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 tunnelled using a query
parameter.preferencesTunnel - Indicates if the client preferences can be tunnelled 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 tunnelled using a query
parameter.preferencesTunnel - Indicates if the client preferences can be tunnelled 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.| Method Detail |
|---|
public boolean allowClient(ClientInfo client)
client - The client to test.
@Deprecated public String getCharacterSetAttribute()
public String getCharacterSetParameter()
@Deprecated public String getEncodingAttribute()
public String getEncodingParameter()
@Deprecated public String getLanguageAttribute()
public String getLanguageParameter()
@Deprecated public String getMediaTypeAttribute()
public String getMediaTypeParameter()
public String getMethodParameter()
public boolean isExtensionsTunnel()
Request.getOriginalRef()public boolean isMethodTunnel()
public boolean isPreferencesTunnel()
public boolean isQueryTunnel()
public boolean isUserAgentTunnel()
@Deprecated public void setCharacterSetAttribute(String parameterName)
parameterName - The character set parameter name.public void setCharacterSetParameter(String parameterName)
parameterName - The character set parameter name.@Deprecated public void setEncodingAttribute(String parameterName)
parameterName - The name of the parameter containing the accepted encoding.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 tunnelled via the
extensions.Request.getOriginalRef()@Deprecated public void setLanguageAttribute(String parameterName)
parameterName - The name of the parameter containing the accepted language.public void setLanguageParameter(String parameterName)
parameterName - The name of the parameter containing the accepted language.@Deprecated public void setMediaTypeAttribute(String parameterName)
parameterName - The name of the parameter containing the accepted media type.public void setMediaTypeParameter(String parameterName)
parameterName - The name of the parameter containing the accepted media type.public void setMethodParameter(String parameterName)
parameterName - The method parameter name.public void setMethodTunnel(boolean methodTunnel)
methodTunnel - True if the method name can be tunnelled.public void setPreferencesTunnel(boolean preferencesTunnel)
preferencesTunnel - True if the client preferences can be tunnelled via the query
parameters.public void setQueryTunnel(boolean queryTunnel)
queryTunnel - True if the method and client preferences can be tunnelled via
query parameters.public void setUserAgentTunnel(boolean userAgentTunnel)
userAgentTunnel - True if the client preferences can be tunnelled according to
the user agent.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||