From 2460e1feb0c35404f62e2f0e048b17a664c64682 Mon Sep 17 00:00:00 2001 From: akwizgran <akwizgran@users.sourceforge.net> Date: Mon, 8 Feb 2016 14:27:27 +0000 Subject: [PATCH] Moved author classes to identity package. --- .../{sync => identity}/AuthorFactoryImpl.java | 3 +-- .../briarproject/{sync => identity}/AuthorReader.java | 3 +-- .../src/org/briarproject/identity/IdentityModule.java | 11 +++++++++++ briar-core/src/org/briarproject/sync/SyncModule.java | 9 --------- 4 files changed, 13 insertions(+), 13 deletions(-) rename briar-core/src/org/briarproject/{sync => identity}/AuthorFactoryImpl.java (95%) rename briar-core/src/org/briarproject/{sync => identity}/AuthorReader.java (92%) diff --git a/briar-core/src/org/briarproject/sync/AuthorFactoryImpl.java b/briar-core/src/org/briarproject/identity/AuthorFactoryImpl.java similarity index 95% rename from briar-core/src/org/briarproject/sync/AuthorFactoryImpl.java rename to briar-core/src/org/briarproject/identity/AuthorFactoryImpl.java index bfb7688021..87c03a5995 100644 --- a/briar-core/src/org/briarproject/sync/AuthorFactoryImpl.java +++ b/briar-core/src/org/briarproject/identity/AuthorFactoryImpl.java @@ -1,4 +1,4 @@ -package org.briarproject.sync; +package org.briarproject.identity; import org.briarproject.api.crypto.CryptoComponent; import org.briarproject.api.data.BdfWriter; @@ -16,7 +16,6 @@ import javax.inject.Inject; import static org.briarproject.api.db.StorageStatus.ADDING; -// TODO: Move this class to the identity package class AuthorFactoryImpl implements AuthorFactory { private final CryptoComponent crypto; diff --git a/briar-core/src/org/briarproject/sync/AuthorReader.java b/briar-core/src/org/briarproject/identity/AuthorReader.java similarity index 92% rename from briar-core/src/org/briarproject/sync/AuthorReader.java rename to briar-core/src/org/briarproject/identity/AuthorReader.java index cb697681ee..16be01ae63 100644 --- a/briar-core/src/org/briarproject/sync/AuthorReader.java +++ b/briar-core/src/org/briarproject/identity/AuthorReader.java @@ -1,4 +1,4 @@ -package org.briarproject.sync; +package org.briarproject.identity; import org.briarproject.api.FormatException; import org.briarproject.api.data.BdfReader; @@ -11,7 +11,6 @@ import java.io.IOException; import static org.briarproject.api.identity.AuthorConstants.MAX_AUTHOR_NAME_LENGTH; import static org.briarproject.api.identity.AuthorConstants.MAX_PUBLIC_KEY_LENGTH; -// TODO: Move this class to the identity package class AuthorReader implements ObjectReader<Author> { private final AuthorFactory authorFactory; diff --git a/briar-core/src/org/briarproject/identity/IdentityModule.java b/briar-core/src/org/briarproject/identity/IdentityModule.java index 98134d1992..a57b916cc0 100644 --- a/briar-core/src/org/briarproject/identity/IdentityModule.java +++ b/briar-core/src/org/briarproject/identity/IdentityModule.java @@ -1,13 +1,24 @@ package org.briarproject.identity; import com.google.inject.AbstractModule; +import com.google.inject.Provides; +import org.briarproject.api.data.ObjectReader; +import org.briarproject.api.identity.Author; +import org.briarproject.api.identity.AuthorFactory; import org.briarproject.api.identity.IdentityManager; public class IdentityModule extends AbstractModule { @Override protected void configure() { + bind(AuthorFactory.class).to( + org.briarproject.identity.AuthorFactoryImpl.class); bind(IdentityManager.class).to(IdentityManagerImpl.class); } + + @Provides + ObjectReader<Author> getAuthorReader(AuthorFactory authorFactory) { + return new org.briarproject.identity.AuthorReader(authorFactory); + } } diff --git a/briar-core/src/org/briarproject/sync/SyncModule.java b/briar-core/src/org/briarproject/sync/SyncModule.java index 7a61c68a4e..83c8f86ec5 100644 --- a/briar-core/src/org/briarproject/sync/SyncModule.java +++ b/briar-core/src/org/briarproject/sync/SyncModule.java @@ -3,10 +3,7 @@ package org.briarproject.sync; import com.google.inject.AbstractModule; import com.google.inject.Provides; -import org.briarproject.api.data.ObjectReader; import org.briarproject.api.event.EventBus; -import org.briarproject.api.identity.Author; -import org.briarproject.api.identity.AuthorFactory; import org.briarproject.api.lifecycle.LifecycleManager; import org.briarproject.api.sync.GroupFactory; import org.briarproject.api.sync.MessageFactory; @@ -22,7 +19,6 @@ public class SyncModule extends AbstractModule { @Override protected void configure() { - bind(AuthorFactory.class).to(AuthorFactoryImpl.class); bind(GroupFactory.class).to(GroupFactoryImpl.class); bind(MessageFactory.class).to(MessageFactoryImpl.class); bind(PacketReaderFactory.class).to(PacketReaderFactoryImpl.class); @@ -32,11 +28,6 @@ public class SyncModule extends AbstractModule { SyncSessionFactoryImpl.class).in(Singleton.class); } - @Provides - ObjectReader<Author> getAuthorReader(AuthorFactory authorFactory) { - return new AuthorReader(authorFactory); - } - @Provides @Singleton ValidationManager getValidationManager(LifecycleManager lifecycleManager, EventBus eventBus, ValidationManagerImpl validationManager) { -- GitLab