Annotation Type Query


  • @Retention(RUNTIME)
    @Target(METHOD)
    public @interface Query
    Indicates an CREST query method on an annotated POJO. This annotation can only be used on collection resource request handlers.

    The annotated method's return type must be:

    • A Promise<QueryResponse, ? extends ResourceException> promise.
    The method must take the following parameters:
    • A org.forgerock.json.resource.QueryResourceHandler for the results of the query.
    • A org.forgerock.json.resource.QueryRequest for the request.
    The method may also take the following parameters:
    • A Context to be given the context.
    See Also:
    RequestHandler, SingletonProvider, CollectionProvider
    • Required Element Summary

      Required Elements 
      Modifier and Type Required Element Description
      Operation operationDescription
      Describe the standard operation details of this action.
      QueryType type
      The type of query this method supports.
    • Optional Element Summary

      Optional Elements 
      Modifier and Type Optional Element Description
      CountPolicy[] countPolicies
      The count policies that can be used with this query.
      String id
      The query ID - required only when type is ID.
      PagingMode[] pagingModes
      The paging modes that can be used with this query.
      String[] queryableFields
      The set of fields that can be used in a query filter.
      String[] sortKeys
      The keys that can be used to sort the results of the query.
    • Element Detail

      • operationDescription

        Operation operationDescription
        Describe the standard operation details of this action.
      • type

        QueryType type
        The type of query this method supports.
      • pagingModes

        PagingMode[] pagingModes
        The paging modes that can be used with this query.
        Default:
        {}
      • countPolicies

        CountPolicy[] countPolicies
        The count policies that can be used with this query. If the array is empty, this means that the query does not support any form of count policy, and no value for count policy should be specified
        Default:
        {}
      • id

        String id
        The query ID - required only when type is ID. If not supplied but required, the name of the annotated method is used.
        Default:
        ""
      • queryableFields

        String[] queryableFields
        The set of fields that can be used in a query filter. Required only when the type is FILTER.
        Default:
        {}
      • sortKeys

        String[] sortKeys
        The keys that can be used to sort the results of the query.
        Default:
        {}