added a cache to the IdentityManager, changed its signature, modified when and where the author is stored

made the author creation single-threaded again in the LifecycleManager, removed redundant code
This commit is contained in:
Ernir Erlingsson
2016-10-13 11:01:25 +02:00
parent 47d6fc526f
commit eaa393a7ed
45 changed files with 299 additions and 552 deletions

View File

@@ -4,6 +4,8 @@ import org.briarproject.api.clients.Client;
import java.util.concurrent.ExecutorService;
import javax.annotation.Nullable;
/**
* Manages the lifecycle of the app, starting {@link
* org.briarproject.api.clients.Client Clients}, starting and stopping {@link
@@ -14,7 +16,7 @@ import java.util.concurrent.ExecutorService;
public interface LifecycleManager {
/**
* The result of calling {@link LifecycleManager#startServices()}.
* The result of calling {@link LifecycleManager#startServices(String)}.
*/
enum StartResult {
ALREADY_RUNNING, DB_ERROR, SERVICE_ERROR, SUCCESS
@@ -39,11 +41,11 @@ public interface LifecycleManager {
/**
* Opens the {@link org.briarproject.api.db.DatabaseComponent
* DatabaseComponent} and starts any registered {@link
* org.briarproject.api.clients.Client Clients} and {@link Service
* Services}.
* DatabaseComponent}, creates a local author with the provided nick, and
* starts any registered {@link org.briarproject.api.clients.Client Clients}
* and {@link Service Services}.
*/
StartResult startServices();
StartResult startServices(@Nullable String authorNick);
/**
* Stops any registered {@link Service Services}, shuts down any