blob: dbc36bbc948a34dbd7ae6c87b2c1e30e7141a2e2 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.vespa.config.server.http.v2;
import com.yahoo.container.jdisc.HttpRequest;
import com.yahoo.slime.Slime;
import com.yahoo.vespa.config.server.Tenant;
import com.yahoo.vespa.config.server.configchange.ConfigChangeActions;
import com.yahoo.vespa.config.server.configchange.ConfigChangeActionsSlimeConverter;
import com.yahoo.vespa.config.server.http.SessionResponse;
import com.yahoo.vespa.config.server.session.Session;
/**
* Creates a response for SessionPrepareHandler.
*
* @author musum
* @since 5.1.28
*/
class SessionPrepareResponse extends SessionResponse {
public SessionPrepareResponse(Slime deployLog, Tenant tenant, HttpRequest request, Session session, ConfigChangeActions actions) {
super(deployLog, deployLog.get());
String message = "Session " + session.getSessionId() + " for tenant '" + tenant.getName() + "' prepared.";
this.root.setString("tenant", tenant.getName().value());
this.root.setString("activate", "http://" + request.getHost() + ":" + request.getPort() + "/application/v2/tenant/" + tenant.getName() + "/session/" + session.getSessionId() + "/active");
root.setString("message", message);
new ConfigChangeActionsSlimeConverter(actions).toSlime(root);
}
}
|