mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-13 11:19:04 +01:00
Merged clock and os packages, moved events into their own package.
This commit is contained in:
@@ -12,7 +12,7 @@ import net.sf.briar.api.LocalAuthor;
|
||||
import net.sf.briar.api.TransportConfig;
|
||||
import net.sf.briar.api.TransportId;
|
||||
import net.sf.briar.api.TransportProperties;
|
||||
import net.sf.briar.api.db.event.DatabaseListener;
|
||||
import net.sf.briar.api.event.EventListener;
|
||||
import net.sf.briar.api.messaging.Ack;
|
||||
import net.sf.briar.api.messaging.Group;
|
||||
import net.sf.briar.api.messaging.GroupId;
|
||||
@@ -43,10 +43,10 @@ public interface DatabaseComponent {
|
||||
void close() throws DbException, IOException;
|
||||
|
||||
/** Adds a listener to be notified when database events occur. */
|
||||
void addListener(DatabaseListener d);
|
||||
void addListener(EventListener d);
|
||||
|
||||
/** Removes a listener. */
|
||||
void removeListener(DatabaseListener d);
|
||||
void removeListener(EventListener d);
|
||||
|
||||
/**
|
||||
* Stores a contact associated with the given local and remote pseudonyms,
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
package net.sf.briar.api.db.event;
|
||||
|
||||
/** An abstract superclass for database events. */
|
||||
public abstract class DatabaseEvent {
|
||||
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
package net.sf.briar.api.db.event;
|
||||
|
||||
/** An interface for receiving notifications when database events occur. */
|
||||
public interface DatabaseListener {
|
||||
|
||||
void eventOccurred(DatabaseEvent e);
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
package net.sf.briar.api.db.event;
|
||||
|
||||
/**
|
||||
* An event that is broadcast when the local transport properties are
|
||||
* updated.
|
||||
*/
|
||||
public class LocalTransportsUpdatedEvent extends DatabaseEvent {
|
||||
|
||||
}
|
||||
@@ -1,9 +1,9 @@
|
||||
package net.sf.briar.api.db.event;
|
||||
package net.sf.briar.api.event;
|
||||
|
||||
import net.sf.briar.api.ContactId;
|
||||
|
||||
/** An event that is broadcast when a contact is added. */
|
||||
public class ContactAddedEvent extends DatabaseEvent {
|
||||
public class ContactAddedEvent extends Event {
|
||||
|
||||
private final ContactId contactId;
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
package net.sf.briar.api.db.event;
|
||||
package net.sf.briar.api.event;
|
||||
|
||||
import net.sf.briar.api.ContactId;
|
||||
|
||||
/** An event that is broadcast when a contact is removed. */
|
||||
public class ContactRemovedEvent extends DatabaseEvent {
|
||||
public class ContactRemovedEvent extends Event {
|
||||
|
||||
private final ContactId contactId;
|
||||
|
||||
6
briar-api/src/net/sf/briar/api/event/Event.java
Normal file
6
briar-api/src/net/sf/briar/api/event/Event.java
Normal file
@@ -0,0 +1,6 @@
|
||||
package net.sf.briar.api.event;
|
||||
|
||||
/** An abstract superclass for events. */
|
||||
public abstract class Event {
|
||||
|
||||
}
|
||||
7
briar-api/src/net/sf/briar/api/event/EventListener.java
Normal file
7
briar-api/src/net/sf/briar/api/event/EventListener.java
Normal file
@@ -0,0 +1,7 @@
|
||||
package net.sf.briar.api.event;
|
||||
|
||||
/** An interface for receiving notifications when events occur. */
|
||||
public interface EventListener {
|
||||
|
||||
void eventOccurred(Event e);
|
||||
}
|
||||
@@ -1,9 +1,9 @@
|
||||
package net.sf.briar.api.db.event;
|
||||
package net.sf.briar.api.event;
|
||||
|
||||
import net.sf.briar.api.AuthorId;
|
||||
|
||||
/** An event that is broadcast when a local pseudonym is added. */
|
||||
public class LocalAuthorAddedEvent extends DatabaseEvent {
|
||||
public class LocalAuthorAddedEvent extends Event {
|
||||
|
||||
private final AuthorId authorId;
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
package net.sf.briar.api.db.event;
|
||||
package net.sf.briar.api.event;
|
||||
|
||||
import net.sf.briar.api.AuthorId;
|
||||
|
||||
/** An event that is broadcast when a local pseudonym is removed. */
|
||||
public class LocalAuthorRemovedEvent extends DatabaseEvent {
|
||||
public class LocalAuthorRemovedEvent extends Event {
|
||||
|
||||
private final AuthorId authorId;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package net.sf.briar.api.db.event;
|
||||
package net.sf.briar.api.event;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
@@ -8,7 +8,7 @@ import net.sf.briar.api.ContactId;
|
||||
* An event that is broadcast when the set of subscriptions visible to one or
|
||||
* more contacts is updated.
|
||||
*/
|
||||
public class LocalSubscriptionsUpdatedEvent extends DatabaseEvent {
|
||||
public class LocalSubscriptionsUpdatedEvent extends Event {
|
||||
|
||||
private final Collection<ContactId> affected;
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
package net.sf.briar.api.event;
|
||||
|
||||
/**
|
||||
* An event that is broadcast when the local transport properties are
|
||||
* updated.
|
||||
*/
|
||||
public class LocalTransportsUpdatedEvent extends Event {
|
||||
|
||||
}
|
||||
@@ -1,10 +1,10 @@
|
||||
package net.sf.briar.api.db.event;
|
||||
package net.sf.briar.api.event;
|
||||
|
||||
import net.sf.briar.api.ContactId;
|
||||
import net.sf.briar.api.messaging.Group;
|
||||
|
||||
/** An event that is broadcast when a message is added to the database. */
|
||||
public class MessageAddedEvent extends DatabaseEvent {
|
||||
public class MessageAddedEvent extends Event {
|
||||
|
||||
private final Group group;
|
||||
private final ContactId contactId;
|
||||
@@ -1,9 +1,9 @@
|
||||
package net.sf.briar.api.db.event;
|
||||
package net.sf.briar.api.event;
|
||||
|
||||
/**
|
||||
* An event that is broadcast when one or messages expire from the database,
|
||||
* potentially changing the database's retention time.
|
||||
*/
|
||||
public class MessageExpiredEvent extends DatabaseEvent {
|
||||
public class MessageExpiredEvent extends Event {
|
||||
|
||||
}
|
||||
@@ -1,9 +1,9 @@
|
||||
package net.sf.briar.api.db.event;
|
||||
package net.sf.briar.api.event;
|
||||
|
||||
import net.sf.briar.api.ContactId;
|
||||
|
||||
/** An event that is broadcast when a message is requested by a contact. */
|
||||
public class MessageRequestedEvent extends DatabaseEvent {
|
||||
public class MessageRequestedEvent extends Event {
|
||||
|
||||
private final ContactId contactId;
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
package net.sf.briar.api.db.event;
|
||||
package net.sf.briar.api.event;
|
||||
|
||||
import net.sf.briar.api.ContactId;
|
||||
|
||||
/**
|
||||
* An event that is broadcast when a message is received or offered from a
|
||||
* An event that is broadcast when a message is received from or offered by a
|
||||
* contact and needs to be acknowledged.
|
||||
*/
|
||||
public class MessageToAckEvent extends DatabaseEvent {
|
||||
public class MessageToAckEvent extends Event {
|
||||
|
||||
private final ContactId contactId;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package net.sf.briar.api.db.event;
|
||||
package net.sf.briar.api.event;
|
||||
|
||||
import net.sf.briar.api.ContactId;
|
||||
|
||||
@@ -6,7 +6,7 @@ import net.sf.briar.api.ContactId;
|
||||
* An event that is broadcast when a message is offered by a contact and needs
|
||||
* to be requested.
|
||||
*/
|
||||
public class MessageToRequestEvent extends DatabaseEvent {
|
||||
public class MessageToRequestEvent extends Event {
|
||||
|
||||
private final ContactId contactId;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package net.sf.briar.api.db.event;
|
||||
package net.sf.briar.api.event;
|
||||
|
||||
import net.sf.briar.api.ContactId;
|
||||
|
||||
@@ -6,7 +6,7 @@ import net.sf.briar.api.ContactId;
|
||||
* An event that is broadcast when the retention time of a contact's database
|
||||
* changes.
|
||||
*/
|
||||
public class RemoteRetentionTimeUpdatedEvent extends DatabaseEvent {
|
||||
public class RemoteRetentionTimeUpdatedEvent extends Event {
|
||||
|
||||
private final ContactId contactId;
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
package net.sf.briar.api.db.event;
|
||||
package net.sf.briar.api.event;
|
||||
|
||||
import net.sf.briar.api.ContactId;
|
||||
|
||||
/** An event that is broadcast when a contact's subscriptions are updated. */
|
||||
public class RemoteSubscriptionsUpdatedEvent extends DatabaseEvent {
|
||||
public class RemoteSubscriptionsUpdatedEvent extends Event {
|
||||
|
||||
private final ContactId contactId;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package net.sf.briar.api.db.event;
|
||||
package net.sf.briar.api.event;
|
||||
|
||||
import net.sf.briar.api.ContactId;
|
||||
import net.sf.briar.api.TransportId;
|
||||
@@ -7,7 +7,7 @@ import net.sf.briar.api.TransportId;
|
||||
* An event that is broadcast when a contact's remote transport properties
|
||||
* are updated.
|
||||
*/
|
||||
public class RemoteTransportsUpdatedEvent extends DatabaseEvent {
|
||||
public class RemoteTransportsUpdatedEvent extends Event {
|
||||
|
||||
private final ContactId contactId;
|
||||
private final TransportId transportId;
|
||||
@@ -1,9 +1,9 @@
|
||||
package net.sf.briar.api.db.event;
|
||||
package net.sf.briar.api.event;
|
||||
|
||||
import net.sf.briar.api.messaging.Group;
|
||||
|
||||
/** An event that is broadcast when the user subscribes to a group. */
|
||||
public class SubscriptionAddedEvent extends DatabaseEvent {
|
||||
public class SubscriptionAddedEvent extends Event {
|
||||
|
||||
private final Group group;
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
package net.sf.briar.api.db.event;
|
||||
package net.sf.briar.api.event;
|
||||
|
||||
import net.sf.briar.api.messaging.Group;
|
||||
|
||||
/** An event that is broadcast when the user unsubscribes from a group. */
|
||||
public class SubscriptionRemovedEvent extends DatabaseEvent {
|
||||
public class SubscriptionRemovedEvent extends Event {
|
||||
|
||||
private final Group group;
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
package net.sf.briar.api.db.event;
|
||||
package net.sf.briar.api.event;
|
||||
|
||||
import net.sf.briar.api.TransportId;
|
||||
|
||||
/** An event that is broadcast when a transport is added to the database. */
|
||||
public class TransportAddedEvent extends DatabaseEvent {
|
||||
/** An event that is broadcast when a transport is added. */
|
||||
public class TransportAddedEvent extends Event {
|
||||
|
||||
private final TransportId transportId;
|
||||
private final long maxLatency;
|
||||
@@ -1,9 +1,9 @@
|
||||
package net.sf.briar.api.db.event;
|
||||
package net.sf.briar.api.event;
|
||||
|
||||
import net.sf.briar.api.TransportId;
|
||||
|
||||
/** An event that is broadcast when a transport is removed. */
|
||||
public class TransportRemovedEvent extends DatabaseEvent {
|
||||
public class TransportRemovedEvent extends Event {
|
||||
|
||||
private final TransportId transportId;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package net.sf.briar.api.clock;
|
||||
package net.sf.briar.api.system;
|
||||
|
||||
/**
|
||||
* An interface for time-related system functions that allows them to be
|
||||
@@ -1,4 +1,4 @@
|
||||
package net.sf.briar.api.os;
|
||||
package net.sf.briar.api.system;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
@@ -1,4 +1,4 @@
|
||||
package net.sf.briar.api.clock;
|
||||
package net.sf.briar.api.system;
|
||||
|
||||
/** Default clock implementation. */
|
||||
public class SystemClock implements Clock {
|
||||
@@ -1,4 +1,4 @@
|
||||
package net.sf.briar.api.clock;
|
||||
package net.sf.briar.api.system;
|
||||
|
||||
import java.util.TimerTask;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package net.sf.briar.api.clock;
|
||||
package net.sf.briar.api.system;
|
||||
|
||||
import java.util.TimerTask;
|
||||
|
||||
Reference in New Issue
Block a user