public ApplicationId getApplicationIdForHostname(String hostname) {
        Optional<ApplicationId> applicationId = tenantRepository.getAllTenantNames().stream()
                .map(tenantName -> tenantRepository.getTenant(tenantName).getApplicationRepo().resolveApplicationId(hostname))
                .filter(Objects::nonNull)
                .findFirst();
        return applicationId.orElse(null);
    }
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