com.antelmann.timeregister
Class AbstractPunchDB
java.lang.Object
com.antelmann.timeregister.AbstractPunchDB
- All Implemented Interfaces:
- PunchDB
- Direct Known Subclasses:
- FilePunchDB, PunchDataAnalyzer, PunchDBClient, SQLPunchDB
public abstract class AbstractPunchDB
- extends Object
- implements PunchDB
implmenents the verification and the listening capabilities and leaves the rest to the subclass
- Author:
- Holger Antelmann
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
listeners
protected ArrayList<PunchListener> listeners
AbstractPunchDB
public AbstractPunchDB()
addPunchListener
public void addPunchListener(PunchListener listener)
- Description copied from interface:
PunchDB
- registers a listener for calls of
punch(PunchData)
- Specified by:
addPunchListener in interface PunchDB
- See Also:
PunchDB.punch(PunchData)
removeListener
public void removeListener(PunchListener listener)
getPunchListeners
public PunchListener[] getPunchListeners()
punch
public void punch(PunchData pd)
throws DatabaseException,
FormatException
- first verifies the PunchData, then stores it, and finally calls the listeners.
Normally, this method should not be overridden!
If you do, you may either call this super method, or handle verification, storing
and listener notification yourself.
- Specified by:
punch in interface PunchDB
- Throws:
FormatException - if the employee is already checked in/out,
or if there is a punch that occured thereafter,
or if the first punch for the user is a checkout.
DatabaseException- See Also:
PunchDataAnalyzer.verifyPunch(PunchDB, PunchData),
store(PunchData),
addPunchListener(PunchListener)
store
protected abstract void store(PunchData pd)
throws DatabaseException
- used by the final
punch(PunchData) method to delegate the database storing.
(Note that a PunchAdminDB makes this method public)
- Throws:
DatabaseException- See Also:
PunchDB.punch(PunchData)
(c) 2001-2006 Holger Antelmann - all rights reserved (contact: info@antelmann.com)
see www.antelmann.com/developer for further details and available downloads