diff options
author | Harald Musum <musum@verizonmedia.com> | 2020-10-20 12:45:38 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-20 12:45:38 +0200 |
commit | c8409e4d6bd06adcc29bdf20328ef782a5d6f2ef (patch) | |
tree | f1a39ff4a7d1887c519c292f0bbdc45327593ed6 /configserver/src/main/java/com/yahoo/vespa/config/server/session/RemoteSession.java | |
parent | 169fcaabd9ae451fc241f572a7bbd8185af30808 (diff) |
Revert "Revert "Merge LocalSession and RemoteSession""
Diffstat (limited to 'configserver/src/main/java/com/yahoo/vespa/config/server/session/RemoteSession.java')
-rw-r--r-- | configserver/src/main/java/com/yahoo/vespa/config/server/session/RemoteSession.java | 61 |
1 files changed, 0 insertions, 61 deletions
diff --git a/configserver/src/main/java/com/yahoo/vespa/config/server/session/RemoteSession.java b/configserver/src/main/java/com/yahoo/vespa/config/server/session/RemoteSession.java deleted file mode 100644 index de5f1392242..00000000000 --- a/configserver/src/main/java/com/yahoo/vespa/config/server/session/RemoteSession.java +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright Verizon Media. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -package com.yahoo.vespa.config.server.session; - -import com.yahoo.config.provision.TenantName; -import com.yahoo.vespa.config.server.application.ApplicationSet; - -import java.util.Objects; -import java.util.Optional; - -/** - * A RemoteSession represents a session created on another config server. This session can - * be regarded as read only, and this interface only allows reading information about a session. - * - * @author Ulf Lilleengen - */ -public class RemoteSession extends Session { - - private final Optional<ApplicationSet> applicationSet; - - /** - * Creates a session. This involves loading the application, validating it and distributing it. - * - * @param tenant The name of the tenant creating session - * @param sessionId The session id for this session. - * @param zooKeeperClient a SessionZooKeeperClient instance - */ - RemoteSession(TenantName tenant, long sessionId, SessionZooKeeperClient zooKeeperClient) { - this(tenant, sessionId, zooKeeperClient, Optional.empty()); - } - - /** - * Creates a remote session, with application set - * - * @param tenant The name of the tenant creating session - * @param sessionId The session id for this session. - * @param zooKeeperClient a SessionZooKeeperClient instance - * @param applicationSet current application set for this session - */ - RemoteSession(TenantName tenant, long sessionId, SessionZooKeeperClient zooKeeperClient, Optional<ApplicationSet> applicationSet) { - super(tenant, sessionId, zooKeeperClient); - this.applicationSet = applicationSet; - } - - @Override - Optional<ApplicationSet> applicationSet() { return applicationSet; } - - public synchronized RemoteSession activated(ApplicationSet applicationSet) { - Objects.requireNonNull(applicationSet, "applicationSet cannot be null"); - return new RemoteSession(tenant, sessionId, sessionZooKeeperClient, Optional.of(applicationSet)); - } - - public synchronized RemoteSession deactivated() { - return new RemoteSession(tenant, sessionId, sessionZooKeeperClient, Optional.empty()); - } - - @Override - public String toString() { - return super.toString() + ",application set=" + applicationSet; - } - -} |