mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-13 03:09:04 +01:00
Use event instead of CommitAction to handle removed PendingContacts
This commit is contained in:
@@ -80,10 +80,8 @@ public interface ContactManager {
|
||||
/**
|
||||
* Removes a {@link PendingContact} that is in state
|
||||
* {@link PendingContactState FAILED}.
|
||||
* @param commitAction an action to run on the main thread after removing.
|
||||
*/
|
||||
void removePendingContact(PendingContactId pendingContact,
|
||||
Runnable commitAction) throws DbException;
|
||||
void removePendingContact(PendingContactId pendingContact) throws DbException;
|
||||
|
||||
/**
|
||||
* Returns the contact with the given ID.
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
package org.briarproject.bramble.api.contact.event;
|
||||
|
||||
import org.briarproject.bramble.api.contact.PendingContactId;
|
||||
import org.briarproject.bramble.api.event.Event;
|
||||
import org.briarproject.bramble.api.nullsafety.NotNullByDefault;
|
||||
|
||||
import javax.annotation.concurrent.Immutable;
|
||||
|
||||
/**
|
||||
* An event that is broadcast when a pending contact is removed.
|
||||
*/
|
||||
@Immutable
|
||||
@NotNullByDefault
|
||||
public class PendingContactRemovedEvent extends Event {
|
||||
|
||||
private final PendingContactId id;
|
||||
|
||||
public PendingContactRemovedEvent(PendingContactId id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public PendingContactId getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user