com.cafesoft.cams.client
Interface CamsClient

All Superinterfaces:
ServiceFinder

public interface CamsClient
extends ServiceFinder

Defines a central interface for connecting to a Cams server and accessing services.

Since:
11/8/2002

Method Summary
 void addConnectionExceptionListener(ConnectionExceptionListener listener)
          Adds the specified listener to this CamsClient.
 void connect()
          Connect to the CamsServer.
 void destroy()
          Destroy the CamsClient.
 void disconnect()
          Disconnect from the CamsServer.
 String getServerUrl()
          Get the Cams Server URL
 void initialize(Config config)
          Initialize the CamsClient.
 boolean isConnected()
          Check to see if connected to the CamsServer.
 void removeConnectionExceptionListener(ConnectionExceptionListener listener)
          Removes the specified listener from this CamsClient.
 
Methods inherited from interface com.cafesoft.core.service.ServiceFinder
find, find, find
 

Method Detail

initialize

public void initialize(Config config)
                throws ConfigException
Initialize the CamsClient.

Parameters:
config - Configuration Properties.
ConfigException

getServerUrl

public String getServerUrl()
Get the Cams Server URL

Returns:
the URL of the Cams Server to which this Cams Client will connect or is connected.

connect

public void connect()
Connect to the CamsServer.

The underlying client implementation may create any number of network connections to support the configured Cams services. Connection creation can be "eager" or "lazy", but the underlying CamsClient implementation should at least establish that a CamsServer is located and listening at the configured URL. //@exception ConnectionException if the CamsClient fails to connect to the CamsServer. If the CamsClient attempts to create more than one Connection, then ConnectionException is thrown if any single Connection cannot be created. Any existing Connections should be cleaned up by invoking disconnect().


isConnected

public boolean isConnected()
Check to see if connected to the CamsServer.

Returns:
true if original connection request via method: connect() to the CamsServer was successful and all configured services have at least one active connection remaining.

disconnect

public void disconnect()
Disconnect from the CamsServer.

Any open connections to the CamsServer are gracefully disconnected and destroyed.


addConnectionExceptionListener

public void addConnectionExceptionListener(ConnectionExceptionListener listener)
Adds the specified listener to this CamsClient. NOTE: The client must be initialized.

Parameters:
listener - receives connection exceptions

removeConnectionExceptionListener

public void removeConnectionExceptionListener(ConnectionExceptionListener listener)
Removes the specified listener from this CamsClient. NOTE: The client must be initialized.

Parameters:
listener - receives connection exceptions

destroy

public void destroy()
Destroy the CamsClient. If connected, all connections are closed. The CamsClient is unrecoverably destroyed.



Generated on 10:40:31 AM September 10, 2003, © 1996-2003 Cafésoft LLC. All rights reserved.