All Downloads are FREE. Search and download functionalities are using the official Maven repository.

doc.com.rallydev.rest.request.QueryRequest.html Maven / Gradle / Ivy

There is a newer version: 2.2.1
Show newest version





QueryRequest (Rally Rest API for Java 2.1)











com.rallydev.rest.request

Class QueryRequest

  • All Implemented Interfaces:
    Cloneable


    public class QueryRequest
    extends Request
    implements Cloneable
    Represents a WSAPI request to retrieve all objects matching specified criteria.
    • Constructor Summary

      Constructors 
      Constructor and Description
      QueryRequest(JsonObject collection)
      Create a new query request for the specified collection.
      QueryRequest(String type)
      Create a new query request for the specified type.
    • Method Summary

      Methods 
      Modifier and Type Method and Description
      QueryRequest clone()
      Clone this request.
      Fetch getFetch()
      Get the current list of fields to be returned on the matching objects.
      int getLimit()
      Get the maximum number of records to be returned from the query.
      String getOrder()
      Set the order by which the result set will be sorted.
      int getPageSize()
      Get the page size of the result set.
      String getProject()
      Get the project which the result set should be scoped to.
      QueryFilter getQueryFilter()
      Get the filter by which the result set will be narrowed down.
      int getStart()
      Get the start index of the result set.
      String getWorkspace()
      Get the workspace which the result set should be scoped to.
      boolean isScopedDown()
      If a project has been specified, get whether to include matching objects in child projects in the result set.
      boolean isScopedUp()
      If a project has been specified, get whether to include matching objects in parent projects in the result set.
      void setFetch(Fetch fetch)
      Set the current list of fields to be returned on the matching objects.
      void setLimit(int limit)
      Set the maximum number of records to be returned from the query.
      void setOrder(String order)
      Get the order by which the result set will be sorted.
      void setPageSize(int pageSize)
      Set the page size of the result set.
      void setProject(String projectRef)
      Specify the project which the result set should be scoped to.

      The default is the user's default project.

      void setQueryFilter(QueryFilter queryFilter)
      Set a filter by which the result set will be narrowed down.
      void setScopedDown(boolean scopeDown)
      If a project has been specified, set whether to include matching objects in child projects in the result set.
      void setScopedUp(boolean scopeUp)
      If a project has been specified, set whether to include matching objects in parent projects in the result set.
      void setStart(int start)
      Set the 1-based start index of the result set.
      void setWorkspace(String workspaceRef)
      Specify the workspace which the result set should be scoped to.

      The default is the user's default workspace.

      String toUrl()
      Convert this request into a url compatible with the WSAPI.
    • Constructor Detail

      • QueryRequest

        public QueryRequest(String type)
        Create a new query request for the specified type.
        Parameters:
        type - The WSAPI type to be queried, e.g. Defect
      • QueryRequest

        public QueryRequest(JsonObject collection)
        Create a new query request for the specified collection. Only supported in WSAPI v2.0 and above.
        Parameters:
        collection - The collection to query. Should have a _ref property.
    • Method Detail

      • getQueryFilter

        public QueryFilter getQueryFilter()
        Get the filter by which the result set will be narrowed down.
        Returns:
        the filter
      • setQueryFilter

        public void setQueryFilter(QueryFilter queryFilter)
        Set a filter by which the result set will be narrowed down.
        Parameters:
        queryFilter - the filter
      • getOrder

        public String getOrder()
        Set the order by which the result set will be sorted.

        The default is ObjectID ASC.

        Returns:
        the order
      • setOrder

        public void setOrder(String order)
        Get the order by which the result set will be sorted.
        Parameters:
        order - the order
      • getWorkspace

        public String getWorkspace()
        Get the workspace which the result set should be scoped to.
        Returns:
        the project
      • setWorkspace

        public void setWorkspace(String workspaceRef)

        Specify the workspace which the result set should be scoped to.

        The default is the user's default workspace.

        Parameters:
        workspaceRef - the ref of the workspace to scope to. May be an absolute or relative ref, e.g. /workspace/1234
      • getProject

        public String getProject()
        Get the project which the result set should be scoped to.
        Returns:
        the project
      • setProject

        public void setProject(String projectRef)

        Specify the project which the result set should be scoped to.

        The default is the user's default project. Specifying null will cause the result to be scoped to the entire specified workspace.

        Parameters:
        projectRef - the ref of the project to scope to. May be null or an absolute or relative ref, e.g. /project/1234
      • isScopedUp

        public boolean isScopedUp()
        If a project has been specified, get whether to include matching objects in parent projects in the result set.

        Returns:
        whether to include matching objects in parent projects.
      • setScopedUp

        public void setScopedUp(boolean scopeUp)

        If a project has been specified, set whether to include matching objects in parent projects in the result set.

        Defaults to false.

        Parameters:
        scopeUp - whether to include matching objects in parent projects
      • isScopedDown

        public boolean isScopedDown()
        If a project has been specified, get whether to include matching objects in child projects in the result set.

        Returns:
        whether to include matching objects in child projects.
      • setScopedDown

        public void setScopedDown(boolean scopeDown)

        If a project has been specified, set whether to include matching objects in child projects in the result set.

        Defaults to true.

        Parameters:
        scopeDown - whether to include matching objects in child projects
      • getStart

        public int getStart()
        Get the start index of the result set.
        Returns:
        the start index
      • setStart

        public void setStart(int start)
        Set the 1-based start index of the result set. The default is 1.
        Parameters:
        start - the start index
      • getFetch

        public Fetch getFetch()

        Get the current list of fields to be returned on the matching objects.

        By default all fields will be returned in the response (fetch=true).
        Returns:
        the current list of fields.
      • setFetch

        public void setFetch(Fetch fetch)
        Set the current list of fields to be returned on the matching objects.
        Parameters:
        fetch - the list of fields to be returned.
      • getPageSize

        public int getPageSize()
        Get the page size of the result set.
        Returns:
        the page size
      • setPageSize

        public void setPageSize(int pageSize)

        Set the page size of the result set.

        The default is 200.
        Parameters:
        pageSize - the new page size. Must be between 1 and 200 inclusive.
      • getLimit

        public int getLimit()
        Get the maximum number of records to be returned from the query.
        Returns:
        the maximum number of records
      • clone

        public QueryRequest clone()
        Clone this request.
        Overrides:
        clone in class Object
        Returns:
        the cloned instance of this request.
      • toUrl

        public String toUrl()

        Convert this request into a url compatible with the WSAPI.

        The current criteria set on this request and any other parameters will be included.
        Specified by:
        toUrl in class Request
        Returns:
        the url representing this request.




© 2015 - 2025 Weber Informatics LLC | Privacy Policy