|
Holger's Java API |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.antelmann.timeregister.AbstractPunchDB
com.antelmann.timeregister.PunchDBClient
public class PunchDBClient
uses a NetConnection to communicate to a PunchDBServer that handles requests. Punch requests are verified and stored on the server (including the server's notification of its listeners). The listeners here are maintaned locally and have no association w/ the server; the are called in addition to any listeners on the server side.
PunchDBServer| Field Summary |
|---|
| Fields inherited from class com.antelmann.timeregister.AbstractPunchDB |
|---|
listeners |
| Constructor Summary | |
|---|---|
PunchDBClient(NetConnection connection)
Deprecated. |
|
PunchDBClient(String server)
uses the standard port |
|
PunchDBClient(String server,
int port)
|
|
| Method Summary | |
|---|---|
void |
close()
|
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 |
PunchData |
getFirstPunch(User user)
if user is null, the first punch of all is returned. |
HolidayCalendar |
getHolidays()
|
PunchData |
getLastPunch(User user)
if user is null, the last punch of all is returned. |
NetConnection |
getNetConnection()
|
PunchDataAnalyzer |
getPunchData(User user,
Date from,
Date until,
String location,
String activity)
retrieves the relevant set of Punchdata objects in a PunchDataAnalyzer |
Map<Object,TimeUser> |
getUsers()
returns an unmodifiable view of the users, mapping the id to a TimeUser |
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 date)
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 |
ping()
simply checks connectivity |
void |
punch(PunchData entry)
first verifies the PunchData, then stores it, and finally calls the listeners. |
void |
reconnect(String serverName,
int port)
allows to reconnect to a server; closes the exising connection if applicable |
void |
save(WorkUnitValidator schedule)
if the schedule exists (based on equals(Object)), it will be updated; otherwise the entry will be created |
void |
setNetConnection(NetConnection connection)
|
void |
store(PunchData entry)
used by the final punch(PunchData) method to delegate the database storing. |
void |
updatePassword(User user)
updates the permanent storage with the password that is now present in the user |
void |
updateUser(User user)
|
| Methods inherited from class com.antelmann.timeregister.AbstractPunchDB |
|---|
addPunchListener, getPunchListeners, removeListener |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface com.antelmann.timeregister.PunchDB |
|---|
addPunchListener |
| Constructor Detail |
|---|
public PunchDBClient(String server)
throws IOException
IOExceptionPunchServerFrame.getStandardPort()
public PunchDBClient(String server,
int port)
throws IOException
IOException@Deprecated public PunchDBClient(NetConnection connection)
| Method Detail |
|---|
public NetConnection getNetConnection()
public void setNetConnection(NetConnection connection)
public void close()
throws IOException
IOException
public void reconnect(String serverName,
int port)
throws IOException
IOException
public void punch(PunchData entry)
throws DatabaseException,
FormatException
AbstractPunchDB
punch in interface PunchDBpunch in class AbstractPunchDBFormatException - 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.
DatabaseExceptionPunchDataAnalyzer.verifyPunch(PunchDB, PunchData),
AbstractPunchDB.store(PunchData),
AbstractPunchDB.addPunchListener(PunchListener)
public void store(PunchData entry)
throws DatabaseException
AbstractPunchDBpunch(PunchData) method to delegate the database storing.
(Note that a PunchAdminDB makes this method public)
store in interface PunchAdminDBstore in class AbstractPunchDBDatabaseExceptionPunchDB.punch(PunchData)
public void delete(PunchData entry)
throws DatabaseException,
UnsupportedOperationException
PunchAdminDB
delete in interface PunchAdminDBDatabaseException
UnsupportedOperationException
public PunchDataAnalyzer getPunchData(User user,
Date from,
Date until,
String location,
String activity)
throws DatabaseException
PunchDB
getPunchData in interface PunchDBuser - limits retrieval by employee; if null, this limit does not applyfrom - limits retrieval by begin date; if null, this limit does not applyuntil - limits retrieval by end date; if null, this limit does not apply
DatabaseExceptionPunchData
public PunchData getLastPunch(User user)
throws DatabaseException
PunchDB
getLastPunch in interface PunchDBDatabaseException
public PunchData getFirstPunch(User user)
throws DatabaseException
PunchDB
getFirstPunch in interface PunchDBDatabaseException
public Map<Object,TimeUser> getUsers()
throws DatabaseException
PunchDB
getUsers in interface PunchDBDatabaseException
public void updatePassword(User user)
throws DatabaseException
PunchDB
updatePassword in interface PunchDBDatabaseExceptionUserImpl.setPassword(char[]),
UserImpl.getPasswordHash()
public void deleteUser(User user)
throws DatabaseException
PunchAdminDB
deleteUser in interface PunchAdminDBDatabaseException
public void updateUser(User user)
throws DatabaseException
updateUser in interface PunchAdminDBDatabaseException
public void insertUser(User user)
throws DatabaseException
insertUser in interface PunchAdminDBDatabaseException
public void insert(WorkUnit unit)
throws DatabaseException
PunchAdminDB
insert in interface PunchAdminDBDatabaseException
public void delete(WorkUnit unit)
throws DatabaseException
delete in interface PunchAdminDBDatabaseException
public List<WorkUnit> getWorkUnits(User user,
WorkUnit.Type type,
Date beginFrom,
Date beginUntil,
String activity)
throws DatabaseException
PunchAdminDB
getWorkUnits in interface PunchAdminDBuser - limits retrieval by employee; if null, this limit does not applytype - limits retrieval by type; if null, this limit does not applybeginFrom - limits retrieval by begin date no earlier than given; if null, this limit does not applybeginUntil - limits retrieval by begin date no later than given; if null, this limit does not applyactivity - limits retrieval by activity; if null, this limit does not apply
DatabaseExceptionPunchData
public List<WorkUnit> getWorkUnitsFor(User user,
Date date)
throws DatabaseException
PunchAdminDB
getWorkUnitsFor in interface PunchAdminDBDatabaseException
public Map<String,WorkUnitValidator> getWorkUnitValidators(Filter<WorkUnitValidator> filter)
throws DatabaseException
PunchAdminDB
getWorkUnitValidators in interface PunchAdminDBDatabaseException
public void save(WorkUnitValidator schedule)
throws DatabaseException
PunchAdminDBequals(Object)), it will be updated; otherwise the entry will be created
save in interface PunchAdminDBDatabaseException
public void delete(WorkUnitValidator schedule)
throws DatabaseException
delete in interface PunchAdminDBDatabaseException
public HolidayCalendar getHolidays()
throws DatabaseException
getHolidays in interface PunchAdminDBDatabaseException
public void insert(Holiday h)
throws DatabaseException
insert in interface PunchAdminDBDatabaseException
public void delete(Holiday h)
throws DatabaseException
delete in interface PunchAdminDBDatabaseException
public void ping()
throws DatabaseException
DatabaseException
|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||