@Override
    protected HttpResponse handlePOST(HttpRequest request) {
        TenantName tenantName = Utils.getTenantNameFromSessionRequest(request);
        Utils.checkThatTenantExists(applicationRepository.tenantRepository(), tenantName);
        TimeoutBudget timeoutBudget = SessionHandler.getTimeoutBudget(request, zookeeperBarrierTimeout);
        boolean verbose = request.getBooleanProperty("verbose");

        DeployHandlerLogger logger;
        long sessionId;
        if (request.hasProperty("from")) {
            ApplicationId applicationId = getFromApplicationId(request);
            logger = DeployHandlerLogger.forApplication(applicationId, verbose);
            sessionId = applicationRepository.createSessionFromExisting(applicationId, false, timeoutBudget, logger);
        } else {
            validateDataAndHeader(request, List.of(ApplicationApiHandler.APPLICATION_ZIP, ApplicationApiHandler.APPLICATION_X_GZIP));
            logger = DeployHandlerLogger.forTenant(tenantName, verbose);
            // TODO: Avoid using application id here at all
            ApplicationId applicationId = ApplicationId.from(tenantName, ApplicationName.defaultName(), InstanceName.defaultName());
            sessionId = applicationRepository.createSession(applicationId,
                                                            timeoutBudget,
                                                            request.getData(),
                                                            request.getHeader(ApplicationApiHandler.contentTypeHeader),
                                                            logger);
        }
        return new SessionCreateResponse(logger.slime(), tenantName, request.getHost(), request.getPort(), sessionId);
    }
A handler that is able to create a session from an application package,
or create a new session from a previous session (with id or the "active" session).
Handles /application/v2/ requests

@author hmusum
configserver/src/main/java/com/yahoo/vespa/config/server/http/v2/SessionCreateHandler.java