Module org.elasticsearch.server
Record Class TargetProjects
java.lang.Object
java.lang.Record
org.elasticsearch.search.crossproject.TargetProjects
- Record Components:
originProject- the origin project, can be null if the request is not cross-project OR it was excluded by project routinglinkedProjects- all projects that are linked and authorized, can be empty if the request is not cross-project
public record TargetProjects(ProjectRoutingInfo originProject, List<ProjectRoutingInfo> linkedProjects)
extends Record
Holds information about the target projects for a cross-project search request. This record is used both by the
project authorization filter and project routing logic.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionTargetProjects(ProjectRoutingInfo originProject) TargetProjects(ProjectRoutingInfo originProject, List<ProjectRoutingInfo> linkedProjects) Creates an instance of aTargetProjectsrecord class. -
Method Summary
Modifier and TypeMethodDescriptionStream containing all project infos, including origin and linked projectsbooleanfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanisEmpty()Returns the value of thelinkedProjectsrecord component.Returns the value of theoriginProjectrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
EMPTY
-
LOCAL_ONLY_FOR_CPS_DISABLED
-
-
Constructor Details
-
TargetProjects
-
TargetProjects
public TargetProjects(@Nullable ProjectRoutingInfo originProject, @Nullable List<ProjectRoutingInfo> linkedProjects) Creates an instance of aTargetProjectsrecord class.- Parameters:
originProject- the value for theoriginProjectrecord componentlinkedProjects- the value for thelinkedProjectsrecord component
-
-
Method Details
-
originProjectAlias
-
allProjectAliases
-
allProjects
Stream containing all project infos, including origin and linked projects -
crossProject
public boolean crossProject() -
isEmpty
public boolean isEmpty() -
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
originProject
Returns the value of theoriginProjectrecord component.- Returns:
- the value of the
originProjectrecord component
-
linkedProjects
Returns the value of thelinkedProjectsrecord component.- Returns:
- the value of the
linkedProjectsrecord component
-