public Optional<Session> getActiveSession(Tenant tenant, ApplicationId applicationId) {
        TenantApplications applicationRepo = tenant.getApplicationRepo();
        return applicationRepo.activeSessionOf(applicationId).map(aLong -> tenant.getSessionRepository().getRemoteSession(aLong));
    }
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