|
Jvmstat | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectsun.jvmstat.monitor.HostIdentifier
public class HostIdentifier
An abstraction that identifies a target host and communications
protocol. The HostIdentifier, or hostid, provides a convenient string
representation of the information needed to locate and communicate with
a target host. The string, based on a 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 Query component may contain an access mode specifier ?mode= specifying "r" or "rw" access (write access currently ignored). 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"
localhost - transformed into "//localhost"
hostname - transformed into "//hostname"
hostname:port - transformed into "//hostname:port"
proto:hostname - transformed into "proto://hostname"
proto:hostname:port - transformed into "proto://hostname:port"
proto://hostname:port
URI
,
VmIdentifier
Constructor Summary | |
---|---|
HostIdentifier(String uriString)
Create a HostIdentifier instance from a string value. |
|
HostIdentifier(String scheme,
String authority,
String path,
String query,
String fragment)
Create a HostIdentifier instance from component parts of a URI. |
|
HostIdentifier(VmIdentifier vmid)
Create a HostIdentifier instance from a VmIdentifier. |
Method Summary | |
---|---|
boolean |
equals(Object object)
Test for quality with other objects. |
String |
getFragment()
Return the Fragment part of this HostIdentifier. |
String |
getHost()
Return the Host part of this HostIdentifier. |
String |
getMode()
Return the mode indicated in this HostIdentifier. |
String |
getPath()
Return the Path part of this HostIdentifier. |
int |
getPort()
Return the Port for of this HostIdentifier. |
String |
getQuery()
Return the Query part of this HostIdentifier. |
String |
getScheme()
Return the Scheme, or protocol, portion of this HostIdentifier. |
String |
getSchemeSpecificPart()
Return the Scheme Specific Part of this HostIdentifier. |
URI |
getURI()
Return the URI associated with the HostIdentifier. |
String |
getUserInfo()
Return the User Info part of this HostIdentifier. |
int |
hashCode()
Return the hash code for this HostIdentifier. |
VmIdentifier |
resolve(VmIdentifier vmid)
Resolve a VmIdentifier with this HostIdentifier. |
String |
toString()
Convert to a string representation. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public HostIdentifier(String uriString) throws URISyntaxException
uriString
- a string representing a target host. The syntax of
the string must conform to the rules specified in the
class documentation.
URISyntaxException
- Thrown when the uriString or its canonical
form is poorly formed. This exception may
get encapsulated into a MonitorException in
a future version.public HostIdentifier(String scheme, String authority, String path, String query, String fragment) throws URISyntaxException
scheme
- the URI.getScheme()
component of a URI.authority
- the URI.getAuthority()
component of a URI.path
- the URI.getPath()
component of a URI.query
- the URI.getQuery()
component of a URI.fragment
- the URI.getFragment()
component of a URI.
URISyntaxException
- Thrown when the uriString or its canonical
form is poorly formed. This exception may
get encapsulated into a MonitorException in
a future version.URI
public HostIdentifier(VmIdentifier vmid)
vmid
- the VmIdentifier use to construct the HostIdentifier.Method Detail |
---|
public VmIdentifier resolve(VmIdentifier vmid) throws URISyntaxException, MonitorException
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.
vmid
- the unresolved VmIdentifier.
URISyntaxException
MonitorException
public String getScheme()
URI.getScheme()
public String getSchemeSpecificPart()
URI.getSchemeSpecificPart()
public String getUserInfo()
URI.getUserInfo()
public String getHost()
URI.getUserInfo()
public int getPort()
URI.getPort()
public String getPath()
URI.getPath()
public String getQuery()
URI.getQuery()
public String getFragment()
URI.getFragment()
public String getMode()
public URI getURI()
URI
public int hashCode()
hashCode
in class Object
URI.hashCode()
public boolean equals(Object object)
equals
in class Object
object
- the object to be test for equality.
URI.equals(Object)
public String toString()
toString
in class Object
URI.toString()
|
Jvmstat | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |