mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-12 10:49:06 +01:00
Listeners for subscription changes.
This commit is contained in:
@@ -48,11 +48,11 @@ public interface DatabaseComponent {
|
||||
/** Waits for any open transactions to finish and closes the database. */
|
||||
void close() throws DbException;
|
||||
|
||||
/** Adds a listener to be notified when new messages are available. */
|
||||
void addListener(MessageListener m);
|
||||
/** Adds a listener to be notified when database events occur. */
|
||||
void addListener(DatabaseListener d);
|
||||
|
||||
/** Removes a listener. */
|
||||
void removeListener(MessageListener m);
|
||||
void removeListener(DatabaseListener d);
|
||||
|
||||
/**
|
||||
* Adds a new contact to the database with the given transport details and
|
||||
|
||||
13
api/net/sf/briar/api/db/DatabaseListener.java
Normal file
13
api/net/sf/briar/api/db/DatabaseListener.java
Normal file
@@ -0,0 +1,13 @@
|
||||
package net.sf.briar.api.db;
|
||||
|
||||
/** An interface for receiving notifications when database events occur. */
|
||||
public interface DatabaseListener {
|
||||
|
||||
static enum Event {
|
||||
MESSAGES_ADDED,
|
||||
SUBSCRIPTIONS_UPDATED,
|
||||
TRANSPORTS_UPDATED
|
||||
};
|
||||
|
||||
void eventOccurred(Event e);
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
package net.sf.briar.api.db;
|
||||
|
||||
/**
|
||||
* An interface for receiving notifications when the database may have new
|
||||
* messages available.
|
||||
*/
|
||||
public interface MessageListener {
|
||||
|
||||
void messagesAdded();
|
||||
}
|
||||
Reference in New Issue
Block a user