mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-18 21:59:54 +01:00
Add transactional version of removePendingContact()
This commit is contained in:
@@ -178,6 +178,12 @@ public interface ContactManager {
|
|||||||
*/
|
*/
|
||||||
void removePendingContact(PendingContactId p) throws DbException;
|
void removePendingContact(PendingContactId p) throws DbException;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Removes a {@link PendingContact}.
|
||||||
|
*/
|
||||||
|
void removePendingContact(Transaction txn, PendingContactId p)
|
||||||
|
throws DbException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the contact with the given ID.
|
* Returns the contact with the given ID.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -131,7 +131,8 @@ class ContactManagerImpl implements ContactManager, EventListener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public PendingContact addPendingContact(Transaction txn, String link, String alias)
|
public PendingContact addPendingContact(Transaction txn, String link,
|
||||||
|
String alias)
|
||||||
throws DbException, FormatException, GeneralSecurityException {
|
throws DbException, FormatException, GeneralSecurityException {
|
||||||
PendingContact p =
|
PendingContact p =
|
||||||
pendingContactFactory.createPendingContact(link, alias);
|
pendingContactFactory.createPendingContact(link, alias);
|
||||||
@@ -169,7 +170,8 @@ class ContactManagerImpl implements ContactManager, EventListener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Collection<Pair<PendingContact, PendingContactState>> getPendingContacts(Transaction txn)
|
public Collection<Pair<PendingContact, PendingContactState>> getPendingContacts(
|
||||||
|
Transaction txn)
|
||||||
throws DbException {
|
throws DbException {
|
||||||
Collection<PendingContact> pendingContacts = db.getPendingContacts(txn);
|
Collection<PendingContact> pendingContacts = db.getPendingContacts(txn);
|
||||||
List<Pair<PendingContact, PendingContactState>> pairs =
|
List<Pair<PendingContact, PendingContactState>> pairs =
|
||||||
@@ -184,7 +186,13 @@ class ContactManagerImpl implements ContactManager, EventListener {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void removePendingContact(PendingContactId p) throws DbException {
|
public void removePendingContact(PendingContactId p) throws DbException {
|
||||||
db.transaction(false, txn -> db.removePendingContact(txn, p));
|
db.transaction(false, txn -> removePendingContact(txn, p));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void removePendingContact(Transaction txn, PendingContactId p)
|
||||||
|
throws DbException {
|
||||||
|
db.removePendingContact(txn, p);
|
||||||
states.remove(p);
|
states.remove(p);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user