public abstract class PSAddressable extends Object implements PSEntity
Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_HOST
The default host.
|
static int |
DEFAULT_PORT
The default port.
|
static String |
DEFAULT_SCHEME
The default scheme to use.
|
static int |
MAX_PORT_NUMBER
The maximum valid port number.
|
Modifier | Constructor and Description |
---|---|
protected |
PSAddressable(String url)
Instantiate a new addressable object from the specified url.
|
|
PSAddressable(String scheme,
String host,
int port,
String path)
Instantiate a new addressable object from the specified scheme, host, port and path.
|
Modifier and Type | Method and Description |
---|---|
String |
getHost() |
String |
getHostURL() |
String |
getPath() |
int |
getPort() |
String |
getScheme() |
String |
getURL() |
void |
setHost(String host) |
void |
setPath(String path) |
void |
setPort(int port) |
void |
setScheme(String scheme) |
String |
toURL() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
checkValid, getId, getIdentifier, getKey, isIdentifiable, isValid
public static final int MAX_PORT_NUMBER
public static final String DEFAULT_SCHEME
public static final String DEFAULT_HOST
public static final int DEFAULT_PORT
protected PSAddressable(String url)
The URL may omit the scheme or authority part, it which case it will default on the default values from the configuration.
url
- The url.IllegalArgumentException
- If the specified URL is invalidpublic PSAddressable(String scheme, String host, int port, String path)
scheme
- The scheme "http" or "https"host
- Where the resource is hosted.port
- The port (or negative to use the default port).path
- The path to the resource.public final String getScheme()
public final String getHost()
public final int getPort()
public final String getPath()
public final String getHostURL()
public final String getURL()
public final void setScheme(String scheme)
scheme
- the scheme to setpublic final void setHost(String host)
host
- the host to setpublic final void setPort(int port)
port
- the port to setIllegalArgumentException
- If the port number is too largepublic final void setPath(String path)
path
- the path to setpublic final String toURL()
Copyright © 2016 Allette Systems. All rights reserved.