public abstract class YConnection
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected java.lang.String |
_handle |
protected java.net.URL |
_url |
Modifier | Constructor and Description |
---|---|
protected |
YConnection() |
protected |
YConnection(java.lang.String urlStr) |
protected |
YConnection(java.net.URL url) |
Modifier and Type | Method and Description |
---|---|
protected boolean |
connect(Interface_Client client)
Attempts to connect to a YAWL instance via an API client.
|
void |
disconnect()
Drop the current connection - if any
|
protected void |
disconnect(Interface_Client client) |
protected abstract Interface_Client |
getClient() |
java.lang.String |
getHost() |
int |
getPort() |
java.net.URL |
getURL()
Gets the current URL for this connection object.
|
protected abstract java.lang.String |
getURLFilePath() |
protected abstract void |
init() |
boolean |
isConnected(Interface_Client client)
Checks that the client currently has a valid connection to a running YAWL
instance, and if not attempts to establish a connection.
|
void |
setPassword(java.lang.String pw)
Sets the password for the connection.
|
void |
setURL(java.lang.String urlStr)
Sets the URL for this connection object
|
void |
setURL(java.lang.String host,
int port) |
void |
setURL(java.net.URL url)
Sets the URL for this connection object
|
void |
setUserID(java.lang.String id)
Sets the user id for the connection.
|
boolean |
testConnection(java.lang.String user,
java.lang.String password) |
protected YConnection()
protected YConnection(java.lang.String urlStr)
protected YConnection(java.net.URL url)
protected abstract void init()
protected abstract java.lang.String getURLFilePath()
protected abstract Interface_Client getClient()
public void setURL(java.lang.String urlStr) throws java.net.MalformedURLException
urlStr
- a String representation of the URL to connect to.java.net.MalformedURLException
- if the String is an malformed URL.public void setURL(java.net.URL url)
url
- the URL to connect to.public void setURL(java.lang.String host, int port) throws java.net.MalformedURLException
java.net.MalformedURLException
public java.net.URL getURL()
public java.lang.String getHost()
public int getPort()
public void setUserID(java.lang.String id)
id
- the user id (cannot be null).public void setPassword(java.lang.String pw)
pw
- the password (cannot be null).public void disconnect()
protected void disconnect(Interface_Client client) throws java.io.IOException
java.io.IOException
protected boolean connect(Interface_Client client) throws java.io.IOException
client
- the client object to connectjava.io.IOException
- if the client or URL is null, if the URL is not reachable,
or if there is some problem connecting to a YAWL instance at the given URLpublic boolean isConnected(Interface_Client client)
client
- the client object to check and/or connectpublic boolean testConnection(java.lang.String user, java.lang.String password)