merged with master

This commit is contained in:
Ernir Erlingsson
2016-03-03 15:02:54 +01:00
parent ac5d68df81
commit 95d89553d5
15 changed files with 209 additions and 107 deletions

View File

@@ -11,22 +11,9 @@ import java.util.Collection;
import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;
<<<<<<< 08099714bab27d1ed48a8bee431a35a38098ecec
class IdentityManagerImpl implements IdentityManager {
=======
import javax.inject.Inject;
import static java.util.logging.Level.WARNING;
import static org.briarproject.api.db.StorageStatus.ACTIVE;
import static org.briarproject.api.db.StorageStatus.ADDING;
import static org.briarproject.api.db.StorageStatus.REMOVING;
class IdentityManagerImpl implements IdentityManager, Service {
private static final Logger LOG =
Logger.getLogger(IdentityManagerImpl.class.getName());
>>>>>>> Switched Roboguice/Guice out for Dagger 2
class IdentityManagerImpl implements IdentityManager {
private final DatabaseComponent db;
private final List<AddIdentityHook> addHooks;
private final List<RemoveIdentityHook> removeHooks;

View File

@@ -1,8 +1,14 @@
package org.briarproject.identity;
import org.briarproject.api.crypto.CryptoComponent;
import org.briarproject.api.data.BdfWriterFactory;
import org.briarproject.api.data.ObjectReader;
import org.briarproject.api.db.DatabaseComponent;
import org.briarproject.api.event.EventBus;
import org.briarproject.api.identity.Author;
import org.briarproject.api.identity.AuthorFactory;
import org.briarproject.api.identity.IdentityManager;
import org.briarproject.api.system.Clock;
import javax.inject.Singleton;
@@ -13,8 +19,18 @@ import dagger.Provides;
public class IdentityModule {
@Provides
@Singleton
IdentityManager provideIdendityModule(DatabaseComponent db, EventBus eventBus) {
return new IdentityManagerImpl(db, eventBus);
AuthorFactory provideAuthorFactory(CryptoComponent crypto,
BdfWriterFactory bdfWriterFactory, Clock clock) {
return new AuthorFactoryImpl(crypto, bdfWriterFactory, clock);
}
@Provides
IdentityManager provideIdendityModule(DatabaseComponent db) {
return new IdentityManagerImpl(db);
}
@Provides
ObjectReader<Author> provideAuthorReader(AuthorFactory authorFactory) {
return new AuthorReader(authorFactory);
}
}