Oracle® Beehive RESTful Web Services API Reference
  Release 2 (2.0.1.7)
  E16658-04
Oracle Beehive

Client-Side Pagination

When retrieving a large set of objects, such as the e-mail messages in a user's inbox, instead of retrieving the entire object, retrieve the minimum amount of information required to uniquely identify each object in the set. For example, you may retrieve only the EIDs of the e-mail messages in a user's inbox.

In general, follow these steps to more efficiently retrieve a large set of objects:

  1. In the /list method, specify how you want to filter and sort the list results in the request payload. For example, the EmailMessage resource list method, /emsg/list takes as its request payload an object of type predicateAndSortListParameters. In this object, you may specify the sort criteria of the list result with an object that inherits from sortCriteria. (Note that sortCriteria is an abstract type. It cannot directly be used; one of its subtypes must be used instead.)

    The following example is a JSON request payload that lists e-mail messages in a folder (whose EID is specified by the parent parameter) and sorts them by delivered time:

    Example 1-1 JSON Request Payload: List E-Mail Messages Sorted By Delivered TIme

    POST /comb/v1/d/emsg/list?parent=2E18:7540:afrh:72965AB26B15A98DE040578C5C8413D8000000001E8F

    {
    "beeType": "predicateAndSortListParameters",
    "sortCriteria": {
    "beeType": "deliveredTimeSortCriteria",
    "ascending": false
    }
    }
  2. The Web service returns the lightest object possible, such as a list of EIDs.

  3. In your client, call the /read method with an appropriate projection, depending on how much information the end user requires.

Maximum Batch Size

By default, the maximum number of objects you may retrieve with the /read method is 100. If you attempt to retrieve more than this minimum, you will encounter an error message similar to the following:

<obr:batchSizeExceededFailure xmlns:obr="http://www.oracle.com/beehive/rest">
<httpStatusCode>400</httpStatusCode>
<actualNumberOfIds>130</actualNumberOfIds>
<maxBatchSize>100</maxBatchSize>
</obr:batchSizeExceededFailure>

Retrieve the value of the maximum batch size by calling the /sys/config method.

Change the maximum batch size by running the following beectl commands, where <new value> is the new maximum batch size you want to specify:

beectl modify_property --component _MauiService:PublicProperties --name MaxBatchSize --value <new value>
beectl activate_configuration

Oracle Logo
Copyright © 2008, 2011, Oracle and/or its affiliates. All rights reserved.
Legal Notices

Top