public class WebSocketURI
extends java.lang.Object
Limitations of this implementation:
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_NOT_SECURE_PORT
The default port for a ws:// URI as defined in RFC6455 (see section 3).
|
static int |
DEFAULT_SECURE_PORT
The default port for a wss:// URI.
|
Constructor and Description |
---|
WebSocketURI(java.lang.String host)
Create a new (not secure) websocket URI.
|
WebSocketURI(java.lang.String host,
int port)
Create a new (not secure) websocket URI.
|
WebSocketURI(java.lang.String host,
int port,
java.lang.String resourceName)
Create a new (not secure) websocket URI.
|
WebSocketURI(java.lang.String host,
int port,
java.lang.String resourceName,
boolean isSecure)
Create a new websocket URI.
|
WebSocketURI(java.lang.String host,
java.lang.String resourceName)
Create a new (not secure) websocket URI.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getHost()
Get the host (hostname or IP address).
|
int |
getPort()
Get the port of the host.
|
java.lang.String |
getResourceName()
Get the resource name, that is the name of the remote websocket endpoint.
|
boolean |
isSecure()
Tell if the websocket is secured or not.
|
java.lang.String |
toString() |
public static final int DEFAULT_NOT_SECURE_PORT
public static final int DEFAULT_SECURE_PORT
public WebSocketURI(java.lang.String host, int port, java.lang.String resourceName, boolean isSecure) throws java.lang.IllegalArgumentException
host
- hostname or IP address of the remote hostport
- port of the remote hostresourceName
- identifier for the service provided by the serverisSecure
- flag indicating if the websocket is secure (wss) or notjava.lang.IllegalArgumentException
- if host is null or empty; if port is 0 (zero); if
resourceName is nullpublic WebSocketURI(java.lang.String host, int port, java.lang.String resourceName) throws java.lang.IllegalArgumentException
host
- hostname or IP address of the remote hostport
- port of the remote hostresourceName
- identifier for the service provided by the serverjava.lang.IllegalArgumentException
- if host is null or empty; if port is 0 (zero); if
resourceName is nullpublic WebSocketURI(java.lang.String host, java.lang.String resourceName) throws java.lang.IllegalArgumentException
DEFAULT_NOT_SECURE_PORT
) is used.host
- hostname or IP address of the remote hostresourceName
- identifier for the service provided by the serverjava.lang.IllegalArgumentException
- if resourceName is nullpublic WebSocketURI(java.lang.String host, int port) throws java.lang.IllegalArgumentException
host
- hostname or IP address of the remote hostport
- port of the remote hostjava.lang.IllegalArgumentException
- if resourceName is nullpublic WebSocketURI(java.lang.String host) throws java.lang.IllegalArgumentException
DEFAULT_NOT_SECURE_PORT
) is used.host
- hostname or IP address of the remote hostjava.lang.IllegalArgumentException
- if resourceName is nullpublic java.lang.String getHost()
public int getPort()
public java.lang.String getResourceName()
public boolean isSecure()
public java.lang.String toString()
toString
in class java.lang.Object