de.janrufmonitor.repository
Class AbstractDatabaseCallerManager

java.lang.Object
  extended by de.janrufmonitor.repository.AbstractConfigurableCallerManager
      extended by de.janrufmonitor.repository.AbstractReadWriteCallerManager
          extended by de.janrufmonitor.repository.AbstractDatabaseCallerManager
All Implemented Interfaces:
IConfigurable, IManager, IRepositoryManager, ICallerManager, IIdentifyCallerRepository, IReadCallerRepository, IWriteCallerRepository

public abstract class AbstractDatabaseCallerManager
extends AbstractReadWriteCallerManager


Field Summary
protected  ICallerDatabaseHandler m_dbh
           
 
Fields inherited from class de.janrufmonitor.repository.AbstractConfigurableCallerManager
CFG_ENABLED, CFG_PRIO, m_configuration, m_externalID, m_logger
 
Constructor Summary
AbstractDatabaseCallerManager()
           
 
Method Summary
 ICaller getCaller(IPhonenumber number)
          Gets a caller object from a repository by the specified phone number object.
 ICallerList getCallers(IFilter filter)
          Gets a list with all callers of a repository filtered by the specified filter implementation.
 ICallerList getCallers(IFilter[] filters)
          Gets a list with all callers of a repository filtered by the specified filter array.
protected abstract  ICallerDatabaseHandler getDatabaseHandler()
          Creates a new instance of a specific database handler.
 boolean isSupported(Class c)
          Returns wether a repository type (de.janrufmonitor.repository.types.*) is suppored by a repository manager implementation.
 void removeCaller(ICaller caller)
          Removes a certain caller from a repository.
 void removeCaller(ICallerList callerList)
          Removes a list of caller objects from a repository.
 void setCaller(ICaller caller)
          Sets a caller object to a repository.
 void setCaller(ICallerList callerList)
          Sets a list of caller objects to a repository.
 void shutdown()
          This method is called on shutdown time by the runtime object.
 void updateCaller(ICaller caller)
          Updates a caller with the new data.
 
Methods inherited from class de.janrufmonitor.repository.AbstractReadWriteCallerManager
addCreationAttributes, addSystemAttributes
 
Methods inherited from class de.janrufmonitor.repository.AbstractConfigurableCallerManager
getConfigurableID, getID, getManagerID, getNamespace, getPriority, getRuntime, isActive, isInternalNumber, restart, setConfiguration, setManagerID, startup, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

m_dbh

protected ICallerDatabaseHandler m_dbh
Constructor Detail

AbstractDatabaseCallerManager

public AbstractDatabaseCallerManager()
Method Detail

isSupported

public boolean isSupported(Class c)
Description copied from interface: IRepositoryManager
Returns wether a repository type (de.janrufmonitor.repository.types.*) is suppored by a repository manager implementation.

Specified by:
isSupported in interface IRepositoryManager
Overrides:
isSupported in class AbstractReadWriteCallerManager
Parameters:
c - Interface to be supported.
Returns:
true is interface is supported, otherwise false.

shutdown

public void shutdown()
Description copied from interface: IManager
This method is called on shutdown time by the runtime object.

Specified by:
shutdown in interface IManager
Overrides:
shutdown in class AbstractConfigurableCallerManager

getCallers

public ICallerList getCallers(IFilter[] filters)
Description copied from interface: IReadCallerRepository
Gets a list with all callers of a repository filtered by the specified filter array. The order of the filtering is done by the order of the array object.

Specified by:
getCallers in interface IReadCallerRepository
Overrides:
getCallers in class AbstractReadWriteCallerManager
Returns:
list with calls

getCaller

public ICaller getCaller(IPhonenumber number)
                  throws CallerNotFoundException
Description copied from interface: IIdentifyCallerRepository
Gets a caller object from a repository by the specified phone number object.

Parameters:
number - number of the requested caller object.
Returns:
caller object from a repository
Throws:
CallerNotFoundException - is thrown if a caller with specified phone number is not found.

removeCaller

public void removeCaller(ICallerList callerList)
Description copied from interface: IWriteCallerRepository
Removes a list of caller objects from a repository.

Specified by:
removeCaller in interface IWriteCallerRepository
Overrides:
removeCaller in class AbstractReadWriteCallerManager
Parameters:
callerList - list of callers to be removed.

setCaller

public void setCaller(ICallerList callerList)
Description copied from interface: IWriteCallerRepository
Sets a list of caller objects to a repository.

Specified by:
setCaller in interface IWriteCallerRepository
Overrides:
setCaller in class AbstractReadWriteCallerManager
Parameters:
callerList - list of caller objects

updateCaller

public void updateCaller(ICaller caller)
Description copied from class: AbstractReadWriteCallerManager
Updates a caller with the new data. The caller to be updated has to be detremined through its UUID. In this abstract implementation the updateCaller() method calls the setCaller() method.

Specified by:
updateCaller in interface IWriteCallerRepository
Overrides:
updateCaller in class AbstractReadWriteCallerManager
Parameters:
caller - caller to be updated

getCallers

public ICallerList getCallers(IFilter filter)
Description copied from interface: IReadCallerRepository
Gets a list with all callers of a repository filtered by the specified filter implementation.

Returns:
list with calls

removeCaller

public void removeCaller(ICaller caller)
Description copied from interface: IWriteCallerRepository
Removes a certain caller from a repository.

Parameters:
caller - caller to be removed

setCaller

public void setCaller(ICaller caller)
Description copied from interface: IWriteCallerRepository
Sets a caller object to a repository.

Parameters:
caller - caller to be set

getDatabaseHandler

protected abstract ICallerDatabaseHandler getDatabaseHandler()
Creates a new instance of a specific database handler.

Returns:
a valid database handler, must not be null.


Copyright © 2010 by Thilo Brandt. All Rights Reserved.