Package jetbrains.buildServer.serverSide
Class BuildQueryOptions
- java.lang.Object
-
- jetbrains.buildServer.serverSide.BuildQueryOptions
-
public class BuildQueryOptions extends Object
-
-
Constructor Summary
Constructors Constructor Description BuildQueryOptions()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getAgentName()
int
getAgentTypeId()
String
getBranch()
String
getBuildTypeId()
Set<String>
getBuildTypeIds()
Date
getMaxStartDate()
Date
getMinStartDate()
User
getOwner()
Integer
getPageSize()
Returns the size of the page to use when builds are fetched from builds history.Boolean
getPinStatus()
String
getTagName()
User
getTagOwner()
boolean
isIncludeCanceled()
boolean
isIncludePersonal()
boolean
isIncludeRunning()
boolean
isMatchAllBranches()
boolean
isOrderByChanges()
BuildQueryOptions
setAgent(SBuildAgent agent)
Set agent to return only builds executed by the specified agent.BuildQueryOptions
setAgentName(String agentName)
Set to filter builds by agents with specified name.BuildQueryOptions
setAgentTypeId(int agentTypeId)
Set to filter builds by agent type, seeSBuildAgent.getAgentTypeId()
BuildQueryOptions
setBranch(String branch)
Only return builds with specified branch.BuildQueryOptions
setBuildTypeId(String buildTypeId)
Only return builds from the build type with the specified internal idBuildQueryOptions
setBuildTypeIds(Collection<String> buildTypeIds)
Only return builds from build types with the specified internal ids.BuildQueryOptions
setIncludeCanceled(boolean includeCanceled)
BuildQueryOptions
setIncludePersonal(boolean includePersonal, User owner)
Enables or disables personal builds in the provided result.BuildQueryOptions
setIncludeRunning(boolean includeRunning)
BuildQueryOptions
setMatchAllBranches(boolean matchAllBranches)
BuildQueryOptions
setOrderByChanges(boolean orderByChanges)
BuildQueryOptions
setPageSize(Integer pageSize)
Allows to control the size of the page when builds are fetched from the builds history.BuildQueryOptions
setPinStatus(Boolean pinStatus)
Sets pin status filter.void
setStartDateRange(Date minStartDate, Date maxStartDate)
BuildQueryOptions
setTagName(String tagName, User tagOwner)
Set tag name to return only builds with specified tag.
-
-
-
Method Detail
-
setBuildTypeId
@NotNull public BuildQueryOptions setBuildTypeId(@NotNull String buildTypeId)
Only return builds from the build type with the specified internal id- Parameters:
buildTypeId
- internal id of a build configuration- Returns:
- same options
-
getBuildTypeId
@Nullable public String getBuildTypeId()
-
setBuildTypeIds
public BuildQueryOptions setBuildTypeIds(@NotNull Collection<String> buildTypeIds)
Only return builds from build types with the specified internal ids.- Parameters:
buildTypeIds
- internal ids of build types- Returns:
- same options instance
- Since:
- 2017.2
-
setBranch
@NotNull public BuildQueryOptions setBranch(@NotNull String branch)
Only return builds with specified branch. UseBranch.DEFAULT_BRANCH_NAME
constant for builds from default branch. By default only builds from default branch are returned (unlesssetMatchAllBranches(boolean)
is set to true).- Parameters:
branch
- a particular branch to return builds from- Returns:
- same options
-
getBranch
@Nullable public String getBranch()
-
setMatchAllBranches
@NotNull public BuildQueryOptions setMatchAllBranches(boolean matchAllBranches)
-
isMatchAllBranches
public boolean isMatchAllBranches()
-
setIncludeRunning
@NotNull public BuildQueryOptions setIncludeRunning(boolean includeRunning)
-
isIncludeRunning
public boolean isIncludeRunning()
-
setIncludeCanceled
@NotNull public BuildQueryOptions setIncludeCanceled(boolean includeCanceled)
-
isIncludeCanceled
public boolean isIncludeCanceled()
-
setIncludePersonal
@NotNull public BuildQueryOptions setIncludePersonal(boolean includePersonal, @Nullable User owner)
Enables or disables personal builds in the provided result.
- If includePersonal is true then all the personal builds accessible to the user are returned.
- If both includePersonal is true and owner is not null, then the result will have all the personal builds created by the specified user, but if user has an option "Show all personal builds" turned on in their profile then the result will have all the personal builds accessible to the user.
- if includePersonal is false and owner is not null, then owner is ignored and no personal builds are returned.
- Parameters:
includePersonal
-owner
-- Returns:
-
isIncludePersonal
public boolean isIncludePersonal()
-
getOwner
@Nullable public User getOwner()
-
setOrderByChanges
@NotNull public BuildQueryOptions setOrderByChanges(boolean orderByChanges)
-
isOrderByChanges
public boolean isOrderByChanges()
-
setAgentTypeId
@NotNull public BuildQueryOptions setAgentTypeId(int agentTypeId)
Set to filter builds by agent type, seeSBuildAgent.getAgentTypeId()
- Parameters:
agentTypeId
- agent type id- Returns:
- the same options instance
- Since:
- 2017.2
-
getAgentTypeId
public int getAgentTypeId()
-
setAgentName
@NotNull public BuildQueryOptions setAgentName(@NotNull String agentName)
Set to filter builds by agents with specified name.- Parameters:
agentName
- name of an agent- Returns:
- the same options instance
- Since:
- 2017.2
-
getAgentName
@Nullable public String getAgentName()
-
setAgent
@NotNull public BuildQueryOptions setAgent(@NotNull SBuildAgent agent)
Set agent to return only builds executed by the specified agent. Calling this method will reset agent type id and agent name to default values (0 and null correspondingly).- Parameters:
agent
- agent- Returns:
- the same options instance
-
setTagName
@NotNull public BuildQueryOptions setTagName(@NotNull String tagName, @Nullable User tagOwner)
Set tag name to return only builds with specified tag.- Parameters:
tagName
- name of the tagtagOwner
- owner of a tag, if not null then search is performed by private tags- Returns:
- the same options instance
-
getTagName
@Nullable public String getTagName()
-
getTagOwner
@Nullable public User getTagOwner()
-
setPinStatus
public BuildQueryOptions setPinStatus(Boolean pinStatus)
Sets pin status filter.- Parameters:
pinStatus
- if true, only pinned builds are returned, if false, only not pinned builds are returned, if null, builds with any pin status are returned- Returns:
- the same options instance
- Since:
- 2019.2
-
getPinStatus
@Nullable public Boolean getPinStatus()
-
setPageSize
@NotNull public BuildQueryOptions setPageSize(@Nullable Integer pageSize)
Allows to control the size of the page when builds are fetched from the builds history. The bigger the page size, the faster is it to load builds from the history, but memory usage is increased as well.- Parameters:
pageSize
- if null, then default page size will be used (1000)- Returns:
- the same options instance
- Since:
- 2020.2.2
-
getPageSize
@Nullable public Integer getPageSize()
Returns the size of the page to use when builds are fetched from builds history. Returns null if default page size will be used.- Returns:
- see above
- Since:
- 2020.2.2
-
setStartDateRange
public void setStartDateRange(@Nullable Date minStartDate, @Nullable Date maxStartDate)
-
getMinStartDate
@Nullable public Date getMinStartDate()
-
getMaxStartDate
@Nullable public Date getMaxStartDate()
-
-