org.jminor.framework.db.provider
Interface EntityConnectionProvider

All Known Implementing Classes:
AbstractEntityConnectionProvider, LocalEntityConnectionProvider, RemoteEntityConnectionProvider

public interface EntityConnectionProvider

Interface for a class responsible for providing EntityConnection objects.


Method Summary
 void disconnect()
          Logs out, disconnects and performs cleanup if required
 StateObserver getConnectedState()
           
 EntityConnection getConnection()
          Provides a EntityConnection object, is responsible for returning a healthy EntityConnection object, that is, it must reconnect an invalid connection whether remotely or locally
 String getDescription()
           
 User getUser()
           
 boolean isConnected()
           
 void setUser(User user)
          Sets the user for this db provider, this invalidates and disconnects the previous connection if any.
 

Method Detail

getConnection

EntityConnection getConnection()
Provides a EntityConnection object, is responsible for returning a healthy EntityConnection object, that is, it must reconnect an invalid connection whether remotely or locally

Returns:
a EntityConnection instance

getDescription

String getDescription()
Returns:
a short description of the database provider

isConnected

boolean isConnected()
Returns:
true if a connection has been established

getConnectedState

StateObserver getConnectedState()
Returns:
a state active when this provider is connected

disconnect

void disconnect()
Logs out, disconnects and performs cleanup if required


setUser

void setUser(User user)
Sets the user for this db provider, this invalidates and disconnects the previous connection if any.

Parameters:
user - the user

getUser

User getUser()
Returns:
the user used by this db provider