URI, may specify the
the communications protocol, host name, and protocol specific information
for a target host. The format for a HostIdentifier string is:
[protocol:][[//]hostname][:port][/servername]
There are actually no required components of this string, as a null string
is interpreted to mean a local connection to the local host and is equivalent
to the string local://localhost. The components of the
HostIdentifier are:
protocol - The communications protocol. If omitted,
and a hostname is not specified, then default local protocol,
local:, is assumed. If the protocol is omitted and a
hostname is specified then the default remote protocol,
rmi: is assumed.
hostname - The hostname. If omitted, then
localhost is assumed. If the protocol is also omitted,
then default local protocol local: is also assumed.
If the hostname is not omitted but the protocol is omitted,
then the default remote protocol, rmi: is assumed.
port - The port for the communications protocol.
Treatment of the port parameter is implementation
(protocol) specific. It is unused by the default local protocol,
local:. For the default remote protocol, rmi:,
port indicates the port number of the rmiregistry
on the target host and defaults to port 1099.
servername - The treatment of the Path, Query, and
Fragment components of the HostIdentifier are implementation
(protocol) dependent. These components are ignored by the
default local protocol, local:. For the default remote
protocol, rmi, the Path component is interpreted as
the name of the RMI remote object. The Fragment part is ignored.
All HostIdentifier objects are represented as absolute, hierarchical URIs. The constructors accept relative URIs, but these will generally be transformed into an absolute URI specifying a default protocol. A HostIdentifier differs from a URI in that certain contractions and illicit syntactical constructions are allowed. The following are all valid HostIdentifier strings:
<null> - transformed into "//localhost"URI, VmIdentifier
| Access | Constructor and Description |
|---|---|
| public | HostIdentifier(String
a string representing a target host. The syntax of
the string must conform to the rules specified in the
class documentation. uriString)Create a HostIdentifier instance from a string value. |
| public | HostIdentifier(String
the scheme, String URI#getScheme component of a URI.the authority, String URI#getAuthority component of a URI.the path, String URI#getPath component of a URI.the query, String URI#getQuery component of a URI.the fragment)URI#getFragment component of a URI.Create a HostIdentifier instance from component parts of a URI. |
| public | HostIdentifier(VmIdentifier
the VmIdentifier use to construct the HostIdentifier. vmid)Create a HostIdentifier instance from a VmIdentifier. |
| Modifier and Type | Method and Description |
|---|---|
| private URI | |
| public boolean | Returns: boolean - returns true if the given object is of type HostIdentifier and its URI field is equal to this object's URI field. Otherwise, returns false.the object to be test for equality. object)Overrides java. Test for quality with other objects. |
| public String | Returns: String - the fragment part for this HostIdentifier.Return the Fragment part of this HostIdentifier. |
| public String | Returns: String - the host part for this HostIdentifier, or "localhost" if the URI.getHost() returns null.Return the Host part of this HostIdentifier. |
| public String | Returns: String - the path part for this HostIdentifier.Return the Path part of this HostIdentifier. |
| public int | Returns: String - the port for this HostIdentifierReturn the Port for of this HostIdentifier. |
| public String | Returns: String - the query part for this HostIdentifier.Return the Query part of this HostIdentifier. |
| public String | Returns: String - the scheme for this HostIdentifier.Return the Scheme, or protocol, portion of this HostIdentifier. |
| public String | Returns: String - the scheme specific part for this HostIdentifier.Return the Scheme Specific Part of this HostIdentifier. |
| public URI | |
| public String | Returns: String - the user info part for this HostIdentifier.Return the User Info part of this HostIdentifier. |
| public int | Returns: int - the hashcode.Overrides java. Return the hash code for this HostIdentifier. |
| public VmIdentifier | Returns: VmIdentifier - the resolved VmIdentifier. If vmid was resolved on entry to this method, then the returned VmIdentifier will be equal, but not identical, to vmid.the unresolved VmIdentifier. vmid)Resolve a VmIdentifier with this HostIdentifier. |
| public String | Returns: String - a String representation of the HostIdentifier.Overrides java. Convert to a string representation. |
| uri | back to summary |
|---|---|
| private URI uri | |
| HostIdentifier | back to summary |
|---|---|
| public HostIdentifier(String uriString) throws URISyntaxException Create a HostIdentifier instance from a string value.
| |
| HostIdentifier | back to summary |
|---|---|
| public HostIdentifier(String scheme, String authority, String path, String query, String fragment) throws URISyntaxException Create a HostIdentifier instance from component parts of a URI.
| |
| HostIdentifier | back to summary |
|---|---|
| public HostIdentifier(VmIdentifier vmid) Create a HostIdentifier instance from a VmIdentifier. The necessary components of the VmIdentifier are extracted and reassembled into a HostIdentifier. If a "file:" scheme (protocol) is specified, the returned HostIdentifier will always be equivalent to HostIdentifier("file://localhost").
| |
| canonicalize | back to summary |
|---|---|
| private URI canonicalize(String uriString) throws URISyntaxException creates a canonical representation of the uriString. This method performs certain translations depending on the type of URI generated by the string. | |
| equals | back to summary |
|---|---|
| public boolean equals(Object object) Overrides java. Test for quality with other objects.
| |
| getFragment | back to summary |
|---|---|
| public String getFragment() Return the Fragment part of this HostIdentifier.
| |
| getHost | back to summary |
|---|---|
| public String getHost() Return the Host part of this HostIdentifier.
| |
| getPath | back to summary |
|---|---|
| public String getPath() Return the Path part of this HostIdentifier.
| |
| getPort | back to summary |
|---|---|
| public int getPort() Return the Port for of this HostIdentifier.
| |
| getQuery | back to summary |
|---|---|
| public String getQuery() Return the Query part of this HostIdentifier.
| |
| getScheme | back to summary |
|---|---|
| public String getScheme() Return the Scheme, or protocol, portion of this HostIdentifier.
| |
| getSchemeSpecificPart | back to summary |
|---|---|
| public String getSchemeSpecificPart() Return the Scheme Specific Part of this HostIdentifier.
| |
| getURI | back to summary |
|---|---|
| public URI getURI() Return the URI associated with the HostIdentifier. | |
| getUserInfo | back to summary |
|---|---|
| public String getUserInfo() Return the User Info part of this HostIdentifier.
| |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Return the hash code for this HostIdentifier. The hash code is identical to the hash code for the contained URI.
| |
| resolve | back to summary |
|---|---|
| public VmIdentifier resolve(VmIdentifier vmid) throws URISyntaxException, MonitorException Resolve a VmIdentifier with this HostIdentifier. A VmIdentifier, such as 1234 or 1234@hostname or any other string that omits certain components of the URI string may be valid, but is certainly incomplete. They are missing critical information for identifying the the communications protocol, target host, or other parameters. A VmIdentifier of this form is considered unresolved. This method uses components of the HostIdentifier to resolve the missing components of the VmIdentifier. Specified components of the unresolved VmIdentifier take precedence over their HostIdentifier counterparts. For example, if the VmIdentifier indicates 1234@hostname:2099 and the HostIdentifier indicates rmi://hostname:1099/, then the resolved VmIdentifier will be rmi://1234@hostname:2099. Any component not explicitly specified or assumed by the HostIdentifier, will remain unresolved in resolved VmIdentifier. A VmIdentifier specifying a file: scheme (protocol), is not changed in any way by this method.
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Convert to a string representation. Conversion is identical to calling getURI().toString(). This may change in a future release.
| |