anon.infoservice
Class DatabaseMessage

java.lang.Object
  extended by anon.util.AbstractMessage
      extended by anon.infoservice.DatabaseMessage

public class DatabaseMessage
extends AbstractMessage

This is the message implementation used for database-specific messages. It is used from the instances of the Database class to notify their observers about database events. The message code identifies the reason of the notification.


Field Summary
static int ALL_ENTRIES_REMOVED
          This message is sent, if the database is cleared (all entries are removed at once).
static int ENTRY_ADDED
          This message is sent after an entry was added to the database.
static int ENTRY_REMOVED
          This message is sent, if a single entry is removed from the database.
static int ENTRY_RENEWED
          This message is sent after an entry was renewed in the database.
static int INITIAL_OBSERVER_MESSAGE
          This message is sent, if an observer registers at the database.
 
Constructor Summary
DatabaseMessage(int a_messageCode)
          This creates a new DatabaseMessage.
DatabaseMessage(int a_messageCode, java.lang.Object a_messageData)
          This creates a new DatabaseMessage.
 
Method Summary
 
Methods inherited from class anon.util.AbstractMessage
getMessageCode, getMessageData
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ENTRY_ADDED

public static final int ENTRY_ADDED
This message is sent after an entry was added to the database. The appended object in this message will be the added entry.

See Also:
Constant Field Values

ENTRY_RENEWED

public static final int ENTRY_RENEWED
This message is sent after an entry was renewed in the database. The appended object in this message will be the entry after the update.

See Also:
Constant Field Values

ENTRY_REMOVED

public static final int ENTRY_REMOVED
This message is sent, if a single entry is removed from the database. The appended object will be the removed entry.

See Also:
Constant Field Values

ALL_ENTRIES_REMOVED

public static final int ALL_ENTRIES_REMOVED
This message is sent, if the database is cleared (all entries are removed at once). There will be no appended object in this case.

See Also:
Constant Field Values

INITIAL_OBSERVER_MESSAGE

public static final int INITIAL_OBSERVER_MESSAGE
This message is sent, if an observer registers at the database. The appended object will be a Vector of all database entries. This will be always the first message after the registration.

See Also:
Constant Field Values
Constructor Detail

DatabaseMessage

public DatabaseMessage(int a_messageCode)
This creates a new DatabaseMessage. The message data is set to null.

Parameters:
a_messageCode - The message code. See the constants in this class.

DatabaseMessage

public DatabaseMessage(int a_messageCode,
                       java.lang.Object a_messageData)
This creates a new DatabaseMessage.

Parameters:
a_messageCode - The message code. See the constants in this class.
a_messageData - The data to send with the message.