JMXServiceURL (Java SE 15 & JDK 15) (original) (raw)

All Implemented Interfaces:

[Serializable](../../../../java.base/java/io/Serializable.html "interface in java.io")


public class JMXServiceURL extends Object implements Serializable

The address of a JMX API connector server. Instances of this class are immutable.

The address is an Abstract Service URL for SLP, as defined in RFC 2609 and amended by RFC 3111. It must look like this:

service:jmx:_protocol_:_sap_

Here, _protocol_ is the transport protocol to be used to connect to the connector server. It is a string of one or more ASCII characters, each of which is a letter, a digit, or one of the characters + or-. The first character must be a letter. Uppercase letters are converted into lowercase ones.

_sap_ is the address at which the connector server is found. This address uses a subset of the syntax defined by RFC 2609 for IP-based protocols. It is a subset because theuser@host syntax is not supported.

The other syntaxes defined by RFC 2609 are not currently supported by this class.

The supported syntax is:

//_[host[_:_port]][url-path]_

Square brackets [] indicate optional parts of the address. Not all protocols will recognize all optional parts.

The _host_ is a host name, an IPv4 numeric host address, or an IPv6 numeric address enclosed in square brackets.

The _port_ is a decimal port number. 0 means a default or anonymous port, depending on the protocol.

The _host_ and _port_ can be omitted. The _port_ cannot be supplied without a _host_.

The _url-path_, if any, begins with a slash (/) or a semicolon (;) and continues to the end of the address. It can contain attributes using the semicolon syntax specified in RFC 2609. Those attributes are not parsed by this class and incorrect attribute syntax is not detected.

Although it is legal according to RFC 2609 to have a_url-path_ that begins with a semicolon, not all implementations of SLP allow it, so it is recommended to avoid that syntax.

Case is not significant in the initialservice:jmx:_protocol_ string or in the host part of the address. Depending on the protocol, case can be significant in the _url-path_.

Since:

1.5

See Also:

RFC 2609, "Service Templates and Service: Schemes", RFC 3111, "Service Location Protocol Modifications for IPv6", Serialized Form

Constructors

Constructor Description
JMXServiceURL​(String serviceURL) Constructs a JMXServiceURL by parsing a Service URL string.
JMXServiceURL​(String protocol,String host, int port) Constructs a JMXServiceURL with the given protocol, host, and port.
JMXServiceURL​(String protocol,String host, int port,String urlPath) Constructs a JMXServiceURL with the given parts.
Modifier and Type Method Description
boolean equals​(Object obj) Indicates whether some other object is equal to this one.
String getHost() The host part of the Service URL.
int getPort() The port of the Service URL.
String getProtocol() The protocol part of the Service URL.
String getURLPath() The URL Path part of the Service URL.
String toString() The string representation of this Service URL.