|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.ifeth.sehr.client.api.driver.ConnectionDriver
Driver object that builds and handles a TCP/IP connection to a SEHR host.
This is the abstract driver class which becomes a concrete class by
implementing your prefered driver for the client/server. The concrete class
is used by SEHRConnectionDriver#SEHRConnectionDriver()
.
Because all physical drivers like LAN, RAS/DUN need their own connection technology this is a "wrapper" class acting in a tier between a concrete driver object and the SEHR system. The methods below don't contain any special code for starting a physical connection like dial up. It's upon you to implement a class of your choice to be used.
Nested Class Summary | |
class |
ConnectionDriver.StatusNotification
|
Field Summary | |
static java.util.logging.Logger |
Log
|
Constructor Summary | |
ConnectionDriver()
|
Method Summary | |
int |
connect()
Connect to SEHR host and track information about layer #0 in SEHRConnection object |
boolean |
discardConnectionLayer(int idx)
Removes (disconnects) a transport layer on level idx |
boolean |
disconnect()
Disconnects completely from SEHR host |
ConnectionInfo |
getConnectionInfo(int idx)
Get connection info of layer x |
SEHRConnection |
getConnectionLayer(int idx)
|
java.util.Vector |
getConnectionLayers()
(Vector-)List of SEHRConnection objects |
int |
getConnections()
|
double |
getLastConTime()
|
ConnectionDriver.StatusNotification |
getNotifiation()
|
double |
getTotalConTime()
|
int |
getTypeOfDriver()
|
void |
initialize()
Method to initialize the driver for monitoring its connections Note: If overriding this method don't forget to add super.initialize in your driver.
|
int |
newConnection(SEHRConnection c)
Called by driver objects when a new connection is made. |
void |
notifyListeners(SEHRConnection c,
int status)
Notifies all listeners that a connection is open or closed. |
void |
registerConnectionListener(ConnectionListener listener)
Registers the given ConnectionListener When a connection is created or removed, all registered listeners will be notified. |
abstract void |
run()
To be implemented by driver objects to create a monitoring thread. |
void |
setRASEntry(java.lang.String entry)
Set the RAS entry to dial |
void |
setRASPassword(java.lang.String pw)
Set the user's password to login at SEHR host |
void |
setRASUsername(java.lang.String username)
Set the user to login at SEHR host, e.g. for a RAS connection |
void |
start()
Starts listening for connections in a new thread. |
void |
stop()
Stops the driver listening for new connections, and closes all existing Connections. |
double |
switchConnectionStatus(int cidx,
int status)
|
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static java.util.logging.Logger Log
Constructor Detail |
public ConnectionDriver()
Method Detail |
public int connect()
SEHRConnection
object
public void initialize()
Note: If overriding this method don't forget to add
super.initialize
in your driver.
public void registerConnectionListener(ConnectionListener listener)
When a connection is created or removed, all registered listeners will be notified.
public void notifyListeners(SEHRConnection c, int status)
public void setRASEntry(java.lang.String entry)
public void setRASUsername(java.lang.String username)
public void setRASPassword(java.lang.String pw)
public int newConnection(SEHRConnection c)
public SEHRConnection getConnectionLayer(int idx)
public ConnectionInfo getConnectionInfo(int idx)
public boolean discardConnectionLayer(int idx)
public boolean disconnect()
public int getConnections()
public java.util.Vector getConnectionLayers()
public double switchConnectionStatus(int cidx, int status)
public ConnectionDriver.StatusNotification getNotifiation()
public int getTypeOfDriver()
public double getLastConTime()
public double getTotalConTime()
public abstract void run()
Driver must stop running when keepRunning()
returns false
and clean up all resources before exiting.
run
in interface java.lang.Runnable
public void start() throws java.io.IOException
stop()
is called.
java.io.IOException
public void stop()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |