Holger's
Java API

com.antelmann.timeregister
Interface PunchAdminDB

All Superinterfaces:
PunchDB
All Known Implementing Classes:
OdbcPunchDB, PunchDBClient, SQLPunchDB

public interface PunchAdminDB
extends PunchDB

adds the ability to administrate a punch entry database

Author:
Holger Antelmann

Method Summary
 void delete(Holiday h)
           
 void delete(PunchData entry)
          deletes the given entry from the database without any consistency checking.
 void delete(WorkUnit unit)
           
 void delete(WorkUnitValidator schedule)
           
 void deleteUser(User user)
          use with caution: this also deletes all associated records of the given user
 HolidayCalendar getHolidays()
           
 List<WorkUnit> getWorkUnits(User user, WorkUnit.Type type, Date beginFrom, Date beginUntil, String activity)
          retrieves the relevant set of WorkUnit objects
 List<WorkUnit> getWorkUnitsFor(User user, Date time)
          returns all work units that enclose the given time based on the given user (or all users if user is null).
 Map<String,WorkUnitValidator> getWorkUnitValidators(Filter<WorkUnitValidator> filter)
          filter may be null, in which case no restrictions apply and all validators found will be returned
 void insert(Holiday h)
           
 void insert(WorkUnit unit)
          inserts the given unit into the database
 void insertUser(User user)
           
 void save(WorkUnitValidator schedule)
          if the schedule exists (based on equals(Object)), it will be updated; otherwise the entry will be created
 void store(PunchData entry)
          stores the given entry into the database without any consistency checking and without calling the listeners on punch(PunchData).
 void updateUser(User user)
           
 
Methods inherited from interface com.antelmann.timeregister.PunchDB
addPunchListener, getFirstPunch, getLastPunch, getPunchData, getUsers, punch, updatePassword
 

Method Detail

store

void store(PunchData entry)
           throws DatabaseException
stores the given entry into the database without any consistency checking and without calling the listeners on punch(PunchData). This method is for administrative tools to add missing data. This method should be used with caution since it may endanger consistency.

Throws:
DatabaseException
See Also:
PunchDB.punch(PunchData)

delete

void delete(PunchData entry)
            throws DatabaseException
deletes the given entry from the database without any consistency checking.

Throws:
DatabaseException

insertUser

void insertUser(User user)
                throws DatabaseException
Throws:
DatabaseException

updateUser

void updateUser(User user)
                throws DatabaseException
Throws:
DatabaseException

deleteUser

void deleteUser(User user)
                throws DatabaseException,
                       UnsupportedOperationException
use with caution: this also deletes all associated records of the given user

Throws:
DatabaseException
UnsupportedOperationException

insert

void insert(WorkUnit unit)
            throws DatabaseException
inserts the given unit into the database

Throws:
DatabaseException

delete

void delete(WorkUnit unit)
            throws DatabaseException
Throws:
DatabaseException

getWorkUnits

List<WorkUnit> getWorkUnits(User user,
                            WorkUnit.Type type,
                            Date beginFrom,
                            Date beginUntil,
                            String activity)
                            throws DatabaseException
retrieves the relevant set of WorkUnit objects

Parameters:
user - limits retrieval by employee; if null, this limit does not apply
beginFrom - limits retrieval by begin date no earlier than given; if null, this limit does not apply
beginUntil - limits retrieval by begin date no later than given; if null, this limit does not apply
type - limits retrieval by type; if null, this limit does not apply
activity - limits retrieval by activity; if null, this limit does not apply
Returns:
a set of PunchData objects
Throws:
DatabaseException
See Also:
PunchData

getWorkUnitsFor

List<WorkUnit> getWorkUnitsFor(User user,
                               Date time)
                               throws DatabaseException
returns all work units that enclose the given time based on the given user (or all users if user is null). There could be multiple WorkUnit objects even for a single user, as there is always the option of a conflicting unit.

Throws:
DatabaseException

getWorkUnitValidators

Map<String,WorkUnitValidator> getWorkUnitValidators(Filter<WorkUnitValidator> filter)
                                                    throws DatabaseException
filter may be null, in which case no restrictions apply and all validators found will be returned

Throws:
DatabaseException

save

void save(WorkUnitValidator schedule)
          throws DatabaseException
if the schedule exists (based on equals(Object)), it will be updated; otherwise the entry will be created

Throws:
DatabaseException

delete

void delete(WorkUnitValidator schedule)
            throws DatabaseException
Throws:
DatabaseException

insert

void insert(Holiday h)
            throws DatabaseException
Throws:
DatabaseException

delete

void delete(Holiday h)
            throws DatabaseException
Throws:
DatabaseException

getHolidays

HolidayCalendar getHolidays()
                            throws DatabaseException
Throws:
DatabaseException


(c) 2001-2006 Holger Antelmann - all rights reserved (contact: info@antelmann.com)
see www.antelmann.com/developer for further details and available downloads