use of com.yahoo.vespa.config.server.session.PrepareParams in project vespa by vespa-engine.
the class ApplicationApiHandler method handlePOST.
@Override
protected HttpResponse handlePOST(HttpRequest request) {
Tenant tenant = getExistingTenant(request);
TenantName tenantName = tenant.getName();
TimeoutBudget timeoutBudget = SessionHandler.getTimeoutBudget(request, zookeeperBarrierTimeout);
PrepareParams prepareParams = PrepareParams.fromHttpRequest(request, tenantName, zookeeperBarrierTimeout);
Slime deployLog = createDeployLog();
DeployLogger logger = SessionCreateHandler.createLogger(request, deployLog, tenantName);
String name = SessionCreateHandler.getNameProperty(request, logger);
SessionCreateHandler.validateDataAndHeader(request);
PrepareResult result = applicationRepository.createSessionAndPrepareAndActivate(tenant, request.getData(), request.getHeader(contentTypeHeader), timeoutBudget, name, prepareParams, shouldIgnoreLockFailure(request), shouldIgnoreSessionStaleFailure(request), Instant.now());
return new SessionPrepareAndActivateResponse(result, tenantName, request, prepareParams.getApplicationId(), zone);
}
use of com.yahoo.vespa.config.server.session.PrepareParams in project vespa by vespa-engine.
the class SessionPrepareHandler method handlePUT.
@Override
protected HttpResponse handlePUT(HttpRequest request) {
Tenant tenant = getExistingTenant(request);
TenantName tenantName = tenant.getName();
long sessionId = getSessionIdV2(request);
PrepareParams prepareParams = PrepareParams.fromHttpRequest(request, tenantName, zookeeperBarrierTimeout);
PrepareResult result = applicationRepository.prepare(tenant, sessionId, prepareParams, Instant.now());
return new SessionPrepareResponse(result, tenantName, request);
}
use of com.yahoo.vespa.config.server.session.PrepareParams in project vespa by vespa-engine.
the class ApplicationApiHandler method handlePUT.
@Override
protected HttpResponse handlePUT(HttpRequest request) {
Tenant tenant = getExistingTenant(request);
TenantName tenantName = tenant.getName();
long sessionId = getSessionIdV2(request);
PrepareParams prepareParams = PrepareParams.fromHttpRequest(request, tenantName, zookeeperBarrierTimeout);
PrepareResult result = applicationRepository.prepareAndActivate(tenant, sessionId, prepareParams, shouldIgnoreLockFailure(request), shouldIgnoreSessionStaleFailure(request), Instant.now());
return new SessionPrepareAndActivateResponse(result, tenantName, request, prepareParams.getApplicationId(), zone);
}
Aggregations