com.cafesoft.cams.client
Interface CamsClient

All Superinterfaces:
ServiceFinder

public interface CamsClient
extends ServiceFinder

Defines a central interface for connecting to a Cams policy 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 CamsPolicyServer.
 void destroy()
          Destroy the CamsClient.
 void disconnect()
          Disconnect from the CamsPolicyServer.
 void initialize(Config config)
          Initialize the CamsClient.
 boolean isConnected()
          Check to see if connected to the CamsPolicyServer.
 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

connect

public void connect()
Connect to the CamsPolicyServer.

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 CamsPolicyServer is located and listening at the configured URL. //@exception ConnectionException if the CamsClient fails to connect to the CamsPolicyServer. 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 CamsPolicyServer.

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

disconnect

public void disconnect()
Disconnect from the CamsPolicyServer.

Any open connections to the CamsPolicyServer 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 8:41:50 AM June 06, 2005, © 1996-2005 Cafésoft LLC. All rights reserved.