Interface ProjectIdResolver

All Known Subinterfaces:
ProjectResolver
All Known Implementing Classes:
AbstractProjectResolver, DefaultProjectResolver

public interface ProjectIdResolver
This is a lightweight version of the ProjectResolver. It resolves for the ProjectId for the current request in the execution context. It intentionally does not take a ClusterState so that it can be used in places where we currently do not want to expose ClusterState such as REST handlers. NOTE this interface is also experimental since we have not fully settled on whether exposing it for REST handlers is a pattern to be followed. We should discuss it case-by-case by using it in more places until we settle on the issue.
  • Method Summary

    Modifier and Type
    Method
    Description
    Retrieve the project for the current request.
    default boolean
    Returns false if the cluster runs in a setup that always expects only a single default project (see also Metadata.DEFAULT_PROJECT_ID).
  • Method Details

    • getProjectId

      ProjectId getProjectId()
      Retrieve the project for the current request.
      Returns:
      The identifier of the current project.
    • supportsMultipleProjects

      default boolean supportsMultipleProjects()
      Returns false if the cluster runs in a setup that always expects only a single default project (see also Metadata.DEFAULT_PROJECT_ID). Otherwise, it should return true to indicate the cluster can accommodate multiple projects regardless how many project it current has.