Package rocks.xmpp.extensions.rsm.model
Class ResultSetManagement
- java.lang.Object
-
- rocks.xmpp.extensions.rsm.model.ResultSetManagement
-
public final class ResultSetManagement extends Object
The implementation of the<set/>
element in thehttp://jabber.org/protocol/rsm
namespace.- See Also:
- XEP-0059: Result Set Management, XML Schema
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ResultSetManagement
forCountResponse(int count)
Gets a result set, which has a count information.static ResultSetManagement
forFirstPage(int max)
Gets a result set, which requests the first page.static ResultSetManagement
forItemCount()
Gets a result set, which gets the item count of a result without retrieving the items themselves.static ResultSetManagement
forLastPage(int max)
Gets a result set, which requests the last page.static ResultSetManagement
forLimit(int limit, int index)
Gets a result set, which starts at a particular index.static ResultSetManagement
forNextPage(int max, String id)
Gets a result set, which requests the next page after a specified item.static ResultSetManagement
forPreviousPage(int max, String id)
Gets a result set, which requests the previous page before a specified item.static ResultSetManagement
forResponse(Integer count, Integer index, String first, String last)
Gets a result set, which has a count information, including first and last item.String
getAfter()
Gets the 'after' element.String
getBefore()
Gets the 'before' element.String
getFirstItem()
Gets the first item.Integer
getFirstItemIndex()
Gets the first item's index.Integer
getIndex()
Gets the index.Integer
getItemCount()
Gets the item count of a result set.String
getLastItem()
Gets the last item.Integer
getMaxSize()
Gets the max size.boolean
isRequestingCount()
Indicates, whether this RSM is used for requesting the item count.ResultSetManagement
nextPage(int max)
Creates the result set request for the next page.ResultSetManagement
previousPage(int max)
Creates the result set request for the previous page.
-
-
-
Field Detail
-
NAMESPACE
public static final String NAMESPACE
http://jabber.org/protocol/rsm- See Also:
- Constant Field Values
-
-
Method Detail
-
nextPage
public final ResultSetManagement nextPage(int max)
Creates the result set request for the next page. It requires that this result set management has a "last item" set, otherwise the last page is requested.- Parameters:
max
- The number of items in the page.- Returns:
- The result set management for requesting the next page.
-
previousPage
public final ResultSetManagement previousPage(int max)
Creates the result set request for the previous page. It requires that this result set management has a "first item" set, otherwise the first page is requested.- Parameters:
max
- The number of items in the page.- Returns:
- The result set management for requesting the previous page.
-
forFirstPage
public static ResultSetManagement forFirstPage(int max)
Gets a result set, which requests the first page.- Parameters:
max
- The item count per page.- Returns:
- The result set.
- See Also:
- 2.1 Limiting the Number of Items
-
forNextPage
public static ResultSetManagement forNextPage(int max, String id)
Gets a result set, which requests the next page after a specified item.- Parameters:
max
- The item count per page.id
- The id of the last item of the previous page. This should be thegetLastItem()
()} of the previous page.- Returns:
- The result set.
- See Also:
- 2.2 Paging Forwards Through a Result Set
-
forPreviousPage
public static ResultSetManagement forPreviousPage(int max, String id)
Gets a result set, which requests the previous page before a specified item.- Parameters:
max
- The item count per page.id
- The id of the first item of the next page. This should be thegetFirstItem()
of the next page.- Returns:
- The result set.
- See Also:
- 2.3 Paging Backwards Through a Result Set
-
forLastPage
public static ResultSetManagement forLastPage(int max)
Gets a result set, which requests the last page.- Parameters:
max
- The item count per page.- Returns:
- The result set.
- See Also:
- 2.5 Requesting the Last Page in a Result Set
-
forLimit
public static ResultSetManagement forLimit(int limit, int index)
Gets a result set, which starts at a particular index.- Parameters:
limit
- The item count per page.index
- The index to start from.- Returns:
- The result set.
- See Also:
- 2.6 Retrieving a Page Out of Order
-
forCountResponse
public static ResultSetManagement forCountResponse(int count)
Gets a result set, which has a count information. The result set is intended for the response.- Parameters:
count
- The item count per page.- Returns:
- The result set.
- See Also:
- 2.6 Retrieving a Page Out of Order
-
forResponse
public static ResultSetManagement forResponse(Integer count, Integer index, String first, String last)
Gets a result set, which has a count information, including first and last item. The result set is intended for the response.- Parameters:
count
- The item count per page.index
- The index of the first item.first
- The first item.last
- The last item.- Returns:
- The result set.
- See Also:
- 2.2 Paging Forwards Through a Result Set
-
forItemCount
public static ResultSetManagement forItemCount()
Gets a result set, which gets the item count of a result without retrieving the items themselves.- Returns:
- The result set.
- See Also:
- 2.7 Getting the Item Count
-
getItemCount
public final Integer getItemCount()
Gets the item count of a result set.- Returns:
- The item count.
-
getFirstItem
public final String getFirstItem()
Gets the first item.- Returns:
- The first item.
-
getFirstItemIndex
public final Integer getFirstItemIndex()
Gets the first item's index.- Returns:
- The first item's index.
-
getLastItem
public final String getLastItem()
Gets the last item.- Returns:
- The last item.
-
getMaxSize
public final Integer getMaxSize()
Gets the max size.- Returns:
- The max size.
-
getAfter
public final String getAfter()
Gets the 'after' element.- Returns:
- The 'after' element.
-
getBefore
public final String getBefore()
Gets the 'before' element.- Returns:
- The 'before' element.
-
getIndex
public final Integer getIndex()
Gets the index.- Returns:
- The index.
-
isRequestingCount
public final boolean isRequestingCount()
Indicates, whether this RSM is used for requesting the item count.- Returns:
- True, if this RSM is used for requesting the item count.
-
-