public long getSessionIdForApplication(ApplicationId applicationId) {
        Tenant tenant = getTenant(applicationId);
        if (! tenant.getApplicationRepo().exists(applicationId))
            throw new NotFoundException("Unknown application id '" + applicationId + "'");

        return requireActiveSession(tenant, applicationId).getSessionId();
    }
Gets the active Session for the given application id.

@return the active session, or null if there is no active session for the given application id.
configserver/src/main/java/com/yahoo/vespa/config/server/ApplicationRepository.java