| java.lang.Object org.restlet.Uniform org.restlet.Restlet org.restlet.Router org.restlet.VirtualHost
VirtualHost | public class VirtualHost extends Router (Code) | | Router of calls from Server connectors to Restlets. The attached Restlets are
typically Applications.
A virtual host is defined along three properties:
- request's
Request.getHostRef : the URI of the host that
received the request. Note that the same IP address can correspond to
multiple domain names and therefore receive request with different "hostRef"
URIs.
- request's
Request.getResourceRef : the URI of the target
resource of the request. If this reference is relative, then it is based on
the "hostRef", otherwise it is maintained as received. This difference is
useful for resources identified by URNs or for Web proxies or Web caches.
- response's
Response.getServerInfo : the information about the
server connector receiving the requests such as it IP address and port
number.
When creating a new instance, you can define Java regular expressions (
java.util.regex.Pattern )
that must match the domain name, port, scheme for references or IP address
and port number for server information. The default values match everything.
See Also: java.util.regex.Pattern See Also: Wikipedia -
* Virtual Hosting See Also: Apache - Virtual
* Hosting author: Jerome Louvel (contact@noelios.com) |
VirtualHost | public VirtualHost()(Code) | | Constructor. Note that usage of this constructor is not recommended as
the Router won't have a proper context set. In general you will prefer to
use the other constructor and pass it the parent component's context.
|
VirtualHost | public VirtualHost(Context context)(Code) | | Constructor. Accepts all incoming requests by default, use the set
methods to restrict the matchable patterns.
Parameters: context - The context. |
VirtualHost | public VirtualHost(Context context, String hostDomain, String hostPort, String hostScheme, String resourceDomain, String resourcePort, String resourceScheme, String serverAddress, String serverPort)(Code) | | Constructor.
Parameters: context - The context. Parameters: hostDomain - The hostRef host domain pattern to match. Parameters: hostPort - The hostRef host port pattern to match. Parameters: hostScheme - The hostRef scheme protocol pattern to match. Parameters: resourceDomain - The resourceRef host domain pattern to match. Parameters: resourcePort - The resourceRef host port pattern to match. Parameters: resourceScheme - The resourceRef scheme protocol pattern to match. Parameters: serverAddress - The listening server address pattern to match. Parameters: serverPort - The listening server port pattern to match. |
getHostDomain | public String getHostDomain()(Code) | | Returns the hostRef host domain to match. Uses patterns in
java.util.regex.
The hostRef host domain to match. |
getHostPort | public String getHostPort()(Code) | | Returns the hostRef host port to match. Uses patterns in java.util.regex.
The hostRef host port to match. |
getHostScheme | public String getHostScheme()(Code) | | Returns the hostRef scheme to match. Uses patterns in java.util.regex.
The hostRef scheme to match. |
getIpAddress | public static String getIpAddress(String domain)(Code) | | Returns the IP address of a given domain name.
Parameters: domain - The domain name. The IP address. |
getLocalHostAddress | public static String getLocalHostAddress()(Code) | | Returns the local host IP address.
The local host IP address. |
getLocalHostName | public static String getLocalHostName()(Code) | | Returns the local host name.
The local host name. |
getName | public String getName()(Code) | | Returns the display name.
The display name. |
getResourceDomain | public String getResourceDomain()(Code) | | Returns the resourceRef host domain to match. Uses patterns in
java.util.regex.
The resourceRef host domain to match. |
getResourcePort | public String getResourcePort()(Code) | | Returns the resourceRef host port to match. Uses patterns in
java.util.regex.
The resourceRef host port to match. |
getResourceScheme | public String getResourceScheme()(Code) | | Returns the resourceRef scheme to match. Uses patterns in
java.util.regex.
The resourceRef scheme to match. |
getServerAddress | public String getServerAddress()(Code) | | Returns the listening server address. Uses patterns in java.util.regex.
The listening server address. |
getServerPort | public String getServerPort()(Code) | | Returns the listening server port. Uses patterns in java.util.regex.
The listening server port. |
setHostDomain | public void setHostDomain(String hostDomain)(Code) | | Sets the hostRef host domain to match. Uses patterns in java.util.regex.
Parameters: hostDomain - The hostRef host domain to match. |
setHostPort | public void setHostPort(String hostPort)(Code) | | Sets the hostRef host port to match. Uses patterns in java.util.regex.
Parameters: hostPort - The hostRef host port to match. |
setHostScheme | public void setHostScheme(String hostScheme)(Code) | | Sets the hostRef scheme to match. Uses patterns in java.util.regex.
Parameters: hostScheme - The hostRef scheme to match. |
setName | public void setName(String name)(Code) | | Sets the display name.
Parameters: name - The display name. |
setResourceDomain | public void setResourceDomain(String resourceDomain)(Code) | | Sets the resourceRef host domain to match. Uses patterns in
java.util.regex.
Parameters: resourceDomain - The resourceRef host domain to match. |
setResourcePort | public void setResourcePort(String resourcePort)(Code) | | Sets the resourceRef host port to match. Uses patterns in
java.util.regex.
Parameters: resourcePort - The resourceRef host port to match. |
setResourceScheme | public void setResourceScheme(String resourceScheme)(Code) | | Sets the resourceRef scheme to match. Uses patterns in java.util.regex.
Parameters: resourceScheme - The resourceRef scheme to match. |
setServerAddress | public void setServerAddress(String serverAddress)(Code) | | Sets the listening server address. Uses patterns in java.util.regex.
Parameters: serverAddress - The listening server address. |
setServerPort | public void setServerPort(String serverPort)(Code) | | Sets the listening server port. Uses patterns in java.util.regex.
Parameters: serverPort - The listening server port. |
|
|