use of com.yahoo.vespa.config.server.http.ContentHandler in project vespa by vespa-engine.
the class ApplicationHandler method handleGET.
@Override
public HttpResponse handleGET(HttpRequest request) {
ApplicationId applicationId = getApplicationIdFromRequest(request);
Tenant tenant = verifyTenantAndApplication(applicationId);
if (isServiceConvergeRequest(request)) {
return applicationRepository.serviceConvergenceCheck(tenant, applicationId, getHostNameFromRequest(request), request.getUri());
}
if (isClusterControllerStatusRequest(request)) {
String hostName = getHostNameFromRequest(request);
String pathSuffix = getPathSuffix(request);
return applicationRepository.clusterControllerStatusPage(tenant, applicationId, hostName, pathSuffix);
}
if (isContentRequest(request)) {
long sessionId = applicationRepository.getSessionIdForApplication(tenant, applicationId);
String contentPath = ApplicationContentRequest.getContentPath(request);
ApplicationFile applicationFile = applicationRepository.getApplicationFileFromSession(tenant.getName(), sessionId, contentPath, ContentRequest.getApplicationFileMode(request.getMethod()));
ApplicationContentRequest contentRequest = new ApplicationContentRequest(request, sessionId, applicationId, zone, contentPath, applicationFile);
return new ContentHandler().get(contentRequest);
}
if (isServiceConvergeListRequest(request)) {
return applicationRepository.serviceListToCheckForConfigConvergence(tenant, applicationId, request.getUri());
}
if (isFiledistributionStatusRequest(request)) {
Duration timeout = HttpHandler.getRequestTimeout(request, Duration.ofSeconds(5));
return applicationRepository.filedistributionStatus(tenant, applicationId, timeout);
}
return new GetApplicationResponse(Response.Status.OK, applicationRepository.getApplicationGeneration(tenant, applicationId));
}
Aggregations