mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-19 22:29:53 +01:00
Pass-through implementations of UI/DB interfaces.
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
package org.briarproject.identity;
|
||||
|
||||
import com.google.inject.Inject;
|
||||
|
||||
import org.briarproject.api.db.DatabaseComponent;
|
||||
import org.briarproject.api.db.DbException;
|
||||
import org.briarproject.api.identity.AuthorId;
|
||||
import org.briarproject.api.identity.IdentityManager;
|
||||
import org.briarproject.api.identity.LocalAuthor;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
class IdentityManagerImpl implements IdentityManager {
|
||||
|
||||
private final DatabaseComponent db;
|
||||
|
||||
@Inject
|
||||
IdentityManagerImpl(DatabaseComponent db) {
|
||||
this.db = db;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addLocalAuthor(LocalAuthor a) throws DbException {
|
||||
db.addLocalAuthor(a);
|
||||
}
|
||||
|
||||
@Override
|
||||
public LocalAuthor getLocalAuthor(AuthorId a) throws DbException {
|
||||
return db.getLocalAuthor(a);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<LocalAuthor> getLocalAuthors() throws DbException {
|
||||
return db.getLocalAuthors();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeLocalAuthor(AuthorId a) throws DbException {
|
||||
db.removeLocalAuthor(a);
|
||||
}
|
||||
}
|
||||
13
briar-core/src/org/briarproject/identity/IdentityModule.java
Normal file
13
briar-core/src/org/briarproject/identity/IdentityModule.java
Normal file
@@ -0,0 +1,13 @@
|
||||
package org.briarproject.identity;
|
||||
|
||||
import com.google.inject.AbstractModule;
|
||||
|
||||
import org.briarproject.api.identity.IdentityManager;
|
||||
|
||||
public class IdentityModule extends AbstractModule {
|
||||
|
||||
@Override
|
||||
protected void configure() {
|
||||
bind(IdentityManager.class).to(IdentityManagerImpl.class);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user