esmska.data
Class History

java.lang.Object
  extended by esmska.data.History

public class History
extends java.lang.Object

SMS history entity


Nested Class Summary
static class History.Record
          Single history record
 
Field Summary
static int ACTION_ADD_RECORD
          new record added
static int ACTION_CLEAR_RECORDS
          all records removed
static int ACTION_REMOVE_RECORD
          existing record removed
 
Method Summary
 void addActionListener(java.awt.event.ActionListener actionListener)
           
 void addRecord(History.Record record)
          add new record
 void addRecords(java.util.Collection<History.Record> records)
          add new records
 void clearRecords()
          delete all records
 History.Record findLastRecord(java.lang.String gatewayName)
          Find last (as in time) record sent to specified gateway.
static History getInstance()
          Get shared instance
 History.Record getRecord(int index)
          get record at index
 java.util.List<History.Record> getRecords()
          get all records in unmodifiable list
 void removeActionListener(java.awt.event.ActionListener actionListener)
           
 void removeRecord(History.Record record)
          remove existing record
 void removeRecords(java.util.Collection<History.Record> records)
          remove existing records
 void removeRecordsOlderThan(java.util.Date date)
          Remove all records older than limit time
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ACTION_ADD_RECORD

public static final int ACTION_ADD_RECORD
new record added

See Also:
Constant Field Values

ACTION_REMOVE_RECORD

public static final int ACTION_REMOVE_RECORD
existing record removed

See Also:
Constant Field Values

ACTION_CLEAR_RECORDS

public static final int ACTION_CLEAR_RECORDS
all records removed

See Also:
Constant Field Values
Method Detail

addActionListener

public void addActionListener(java.awt.event.ActionListener actionListener)

removeActionListener

public void removeActionListener(java.awt.event.ActionListener actionListener)

getInstance

public static History getInstance()
Get shared instance


getRecords

public java.util.List<History.Record> getRecords()
get all records in unmodifiable list


getRecord

public History.Record getRecord(int index)
get record at index


addRecord

public void addRecord(History.Record record)
add new record


addRecords

public void addRecords(java.util.Collection<History.Record> records)
add new records


removeRecord

public void removeRecord(History.Record record)
remove existing record


removeRecords

public void removeRecords(java.util.Collection<History.Record> records)
remove existing records


removeRecordsOlderThan

public void removeRecordsOlderThan(java.util.Date date)
Remove all records older than limit time

Parameters:
date - limit time which records to keep, older are removed; not null

clearRecords

public void clearRecords()
delete all records


findLastRecord

public History.Record findLastRecord(java.lang.String gatewayName)
Find last (as in time) record sent to specified gateway.

Parameters:
gatewayName - name of the gateway
Returns:
the last (the most recent) record sent to specified gateway. Null when none found.