Moved PrivateGroupFactory to clients package.

This commit is contained in:
akwizgran
2016-02-29 14:07:30 +00:00
parent 2e7df53dba
commit 640f5484e0
9 changed files with 21 additions and 16 deletions

View File

@@ -1,6 +1,8 @@
package org.briarproject.api.sync; package org.briarproject.api.clients;
import org.briarproject.api.contact.Contact; import org.briarproject.api.contact.Contact;
import org.briarproject.api.sync.ClientId;
import org.briarproject.api.sync.Group;
public interface PrivateGroupFactory { public interface PrivateGroupFactory {

View File

@@ -3,11 +3,13 @@ package org.briarproject.clients;
import com.google.inject.AbstractModule; import com.google.inject.AbstractModule;
import org.briarproject.api.clients.ClientHelper; import org.briarproject.api.clients.ClientHelper;
import org.briarproject.api.clients.PrivateGroupFactory;
public class ClientsModule extends AbstractModule { public class ClientsModule extends AbstractModule {
@Override @Override
protected void configure() { protected void configure() {
bind(ClientHelper.class).to(ClientHelperImpl.class); bind(ClientHelper.class).to(ClientHelperImpl.class);
bind(PrivateGroupFactory.class).to(PrivateGroupFactoryImpl.class);
} }
} }

View File

@@ -1,8 +1,9 @@
package org.briarproject.sync; package org.briarproject.clients;
import com.google.inject.Inject; import com.google.inject.Inject;
import org.briarproject.api.Bytes; import org.briarproject.api.Bytes;
import org.briarproject.api.clients.PrivateGroupFactory;
import org.briarproject.api.contact.Contact; import org.briarproject.api.contact.Contact;
import org.briarproject.api.data.BdfWriter; import org.briarproject.api.data.BdfWriter;
import org.briarproject.api.data.BdfWriterFactory; import org.briarproject.api.data.BdfWriterFactory;
@@ -10,7 +11,6 @@ import org.briarproject.api.identity.AuthorId;
import org.briarproject.api.sync.ClientId; import org.briarproject.api.sync.ClientId;
import org.briarproject.api.sync.Group; import org.briarproject.api.sync.Group;
import org.briarproject.api.sync.GroupFactory; import org.briarproject.api.sync.GroupFactory;
import org.briarproject.api.sync.PrivateGroupFactory;
import java.io.ByteArrayOutputStream; import java.io.ByteArrayOutputStream;
import java.io.IOException; import java.io.IOException;

View File

@@ -3,6 +3,7 @@ package org.briarproject.forum;
import com.google.inject.Inject; import com.google.inject.Inject;
import org.briarproject.api.FormatException; import org.briarproject.api.FormatException;
import org.briarproject.api.clients.PrivateGroupFactory;
import org.briarproject.api.contact.Contact; import org.briarproject.api.contact.Contact;
import org.briarproject.api.contact.ContactId; import org.briarproject.api.contact.ContactId;
import org.briarproject.api.contact.ContactManager.AddContactHook; import org.briarproject.api.contact.ContactManager.AddContactHook;
@@ -28,7 +29,6 @@ import org.briarproject.api.sync.GroupId;
import org.briarproject.api.sync.Message; import org.briarproject.api.sync.Message;
import org.briarproject.api.sync.MessageFactory; import org.briarproject.api.sync.MessageFactory;
import org.briarproject.api.sync.MessageId; import org.briarproject.api.sync.MessageId;
import org.briarproject.api.sync.PrivateGroupFactory;
import org.briarproject.api.sync.ValidationManager.ValidationHook; import org.briarproject.api.sync.ValidationManager.ValidationHook;
import org.briarproject.api.system.Clock; import org.briarproject.api.system.Clock;
import org.briarproject.util.StringUtils; import org.briarproject.util.StringUtils;

View File

@@ -3,6 +3,7 @@ package org.briarproject.messaging;
import com.google.inject.Inject; import com.google.inject.Inject;
import org.briarproject.api.FormatException; import org.briarproject.api.FormatException;
import org.briarproject.api.clients.PrivateGroupFactory;
import org.briarproject.api.contact.Contact; import org.briarproject.api.contact.Contact;
import org.briarproject.api.contact.ContactId; import org.briarproject.api.contact.ContactId;
import org.briarproject.api.contact.ContactManager.AddContactHook; import org.briarproject.api.contact.ContactManager.AddContactHook;
@@ -24,7 +25,6 @@ import org.briarproject.api.sync.Group;
import org.briarproject.api.sync.GroupId; import org.briarproject.api.sync.GroupId;
import org.briarproject.api.sync.MessageId; import org.briarproject.api.sync.MessageId;
import org.briarproject.api.sync.MessageStatus; import org.briarproject.api.sync.MessageStatus;
import org.briarproject.api.sync.PrivateGroupFactory;
import org.briarproject.util.StringUtils; import org.briarproject.util.StringUtils;
import java.io.ByteArrayInputStream; import java.io.ByteArrayInputStream;

View File

@@ -5,6 +5,7 @@ import com.google.inject.Inject;
import org.briarproject.api.DeviceId; import org.briarproject.api.DeviceId;
import org.briarproject.api.FormatException; import org.briarproject.api.FormatException;
import org.briarproject.api.TransportId; import org.briarproject.api.TransportId;
import org.briarproject.api.clients.PrivateGroupFactory;
import org.briarproject.api.contact.Contact; import org.briarproject.api.contact.Contact;
import org.briarproject.api.contact.ContactId; import org.briarproject.api.contact.ContactId;
import org.briarproject.api.contact.ContactManager.AddContactHook; import org.briarproject.api.contact.ContactManager.AddContactHook;
@@ -30,7 +31,6 @@ import org.briarproject.api.sync.GroupId;
import org.briarproject.api.sync.Message; import org.briarproject.api.sync.Message;
import org.briarproject.api.sync.MessageFactory; import org.briarproject.api.sync.MessageFactory;
import org.briarproject.api.sync.MessageId; import org.briarproject.api.sync.MessageId;
import org.briarproject.api.sync.PrivateGroupFactory;
import org.briarproject.api.system.Clock; import org.briarproject.api.system.Clock;
import org.briarproject.util.StringUtils; import org.briarproject.util.StringUtils;

View File

@@ -9,7 +9,6 @@ import org.briarproject.api.sync.GroupFactory;
import org.briarproject.api.sync.MessageFactory; import org.briarproject.api.sync.MessageFactory;
import org.briarproject.api.sync.PacketReaderFactory; import org.briarproject.api.sync.PacketReaderFactory;
import org.briarproject.api.sync.PacketWriterFactory; import org.briarproject.api.sync.PacketWriterFactory;
import org.briarproject.api.sync.PrivateGroupFactory;
import org.briarproject.api.sync.SyncSessionFactory; import org.briarproject.api.sync.SyncSessionFactory;
import org.briarproject.api.sync.ValidationManager; import org.briarproject.api.sync.ValidationManager;
@@ -23,7 +22,6 @@ public class SyncModule extends AbstractModule {
bind(MessageFactory.class).to(MessageFactoryImpl.class); bind(MessageFactory.class).to(MessageFactoryImpl.class);
bind(PacketReaderFactory.class).to(PacketReaderFactoryImpl.class); bind(PacketReaderFactory.class).to(PacketReaderFactoryImpl.class);
bind(PacketWriterFactory.class).to(PacketWriterFactoryImpl.class); bind(PacketWriterFactory.class).to(PacketWriterFactoryImpl.class);
bind(PrivateGroupFactory.class).to(PrivateGroupFactoryImpl.class);
bind(SyncSessionFactory.class).to( bind(SyncSessionFactory.class).to(
SyncSessionFactoryImpl.class).in(Singleton.class); SyncSessionFactoryImpl.class).in(Singleton.class);
} }

View File

@@ -23,6 +23,7 @@ import org.briarproject.api.messaging.PrivateMessage;
import org.briarproject.api.messaging.PrivateMessageFactory; import org.briarproject.api.messaging.PrivateMessageFactory;
import org.briarproject.api.sync.GroupId; import org.briarproject.api.sync.GroupId;
import org.briarproject.api.sync.MessageId; import org.briarproject.api.sync.MessageId;
import org.briarproject.clients.ClientsModule;
import org.briarproject.contact.ContactModule; import org.briarproject.contact.ContactModule;
import org.briarproject.crypto.CryptoModule; import org.briarproject.crypto.CryptoModule;
import org.briarproject.data.DataModule; import org.briarproject.data.DataModule;
@@ -56,10 +57,10 @@ public class ConstantsTest extends BriarTestCase {
public ConstantsTest() throws Exception { public ConstantsTest() throws Exception {
Injector i = Guice.createInjector(new TestDatabaseModule(), Injector i = Guice.createInjector(new TestDatabaseModule(),
new TestLifecycleModule(), new TestSystemModule(), new TestLifecycleModule(), new TestSystemModule(),
new ContactModule(), new CryptoModule(), new DatabaseModule(), new ClientsModule(), new ContactModule(), new CryptoModule(),
new DataModule(), new EventModule(), new ForumModule(), new DatabaseModule(), new DataModule(), new EventModule(),
new IdentityModule(), new MessagingModule(), new SyncModule(), new ForumModule(), new IdentityModule(), new MessagingModule(),
new TransportModule()); new SyncModule(), new TransportModule());
crypto = i.getInstance(CryptoComponent.class); crypto = i.getInstance(CryptoComponent.class);
authorFactory = i.getInstance(AuthorFactory.class); authorFactory = i.getInstance(AuthorFactory.class);
privateMessageFactory = i.getInstance(PrivateMessageFactory.class); privateMessageFactory = i.getInstance(PrivateMessageFactory.class);

View File

@@ -35,6 +35,7 @@ import org.briarproject.api.transport.KeyManager;
import org.briarproject.api.transport.StreamContext; import org.briarproject.api.transport.StreamContext;
import org.briarproject.api.transport.StreamReaderFactory; import org.briarproject.api.transport.StreamReaderFactory;
import org.briarproject.api.transport.StreamWriterFactory; import org.briarproject.api.transport.StreamWriterFactory;
import org.briarproject.clients.ClientsModule;
import org.briarproject.contact.ContactModule; import org.briarproject.contact.ContactModule;
import org.briarproject.crypto.CryptoModule; import org.briarproject.crypto.CryptoModule;
import org.briarproject.data.DataModule; import org.briarproject.data.DataModule;
@@ -86,10 +87,11 @@ public class SimplexMessagingIntegrationTest extends BriarTestCase {
private Injector createInjector(File dir) { private Injector createInjector(File dir) {
return Guice.createInjector(new TestDatabaseModule(dir), return Guice.createInjector(new TestDatabaseModule(dir),
new TestSystemModule(), new ContactModule(), new CryptoModule(), new TestSystemModule(), new ClientsModule(),
new DatabaseModule(), new DataModule(), new EventModule(), new ContactModule(), new CryptoModule(), new DatabaseModule(),
new IdentityModule(), new LifecycleModule(), new DataModule(), new EventModule(), new IdentityModule(),
new MessagingModule(), new SyncModule(), new TransportModule()); new LifecycleModule(), new MessagingModule(), new SyncModule(),
new TransportModule());
} }
@Test @Test