org.exoplatform.social.common
Interface RealtimeListAccess<E>

All Superinterfaces:
org.exoplatform.commons.utils.ListAccess<E>

public interface RealtimeListAccess<E>
extends org.exoplatform.commons.utils.ListAccess<E>

The Realtime list access interface to provide more facility to list access for easier real-time access.

Since:
1.2.0-GA, Apr 4, 2011
Author:
hoatle (hoatlevan at gmail dot com)

Method Summary
 int getNumberOfMultiUpdated(Map<String,Long> sinceTimes)
          Gets the number of updated elements based on the of multi-value since time.
 int getNumberOfNewer(E e)
          Gets the number of newer elements based on the provided element.
 int getNumberOfNewer(Long sinceTime)
          Gets the number of newer elements based on the updated time.
 int getNumberOfOlder(E e)
          Gets the number of older elements based on the provided element.
 int getNumberOfOlder(Long sinceTime)
          Gets the number of older elements based on the updated time.
 int getNumberOfUpgrade()
          Gets the number of stream elements based on the updated time.
 int getSize()
          Overrides its parent interface to avoid checked-exception.
 List<E> getUpadtedActivities(Long sinceTime, int limit)
          Gets get updated activities base on since time.
 E[] load(int index, int limit)
          Overrides its parent interface to avoid checked-exception.
 List<E> loadAsList(int index, int limit)
          Loads items as list instead of array as from load(int, int).
 List<E> loadNewer(E e, int length)
          Loads newer elements based on the provided element.
 List<E> loadNewer(Long sinceTime, int limit)
          Loads newer elements based on the provided element.
 List<E> loadOlder(E e, int length)
          Loads older elements based on the provided element.
 List<E> loadOlder(Long sinceTime, int limit)
          Loads older elements based on the provided element.
 

Method Detail

loadAsList

List<E> loadAsList(int index,
                   int limit)
Loads items as list instead of array as from load(int, int).

Parameters:
index - the index
limit - the number to load
Returns:
a list

load

E[] load(int index,
         int limit)
Overrides its parent interface to avoid checked-exception.

Specified by:
load in interface org.exoplatform.commons.utils.ListAccess<E>
Parameters:
index - the index
limit - the maximum of elements to return
Returns:
array of elements

getSize

int getSize()
Overrides its parent interface to avoid checked-exception.

Specified by:
getSize in interface org.exoplatform.commons.utils.ListAccess<E>
Returns:
the number of elements.

loadNewer

List<E> loadNewer(E e,
                  int length)
Loads newer elements based on the provided element.

Parameters:
e - the based element
length - number of newer elements to load
Returns:
an array of newer elements

getNumberOfNewer

int getNumberOfNewer(E e)
Gets the number of newer elements based on the provided element.

Parameters:
e - the provided element
Returns:
number of newer elements if any

loadOlder

List<E> loadOlder(E e,
                  int length)
Loads older elements based on the provided element.

Parameters:
e - the based element
length - number of older elements to load
Returns:
an array of older elements

getNumberOfOlder

int getNumberOfOlder(E e)
Gets the number of older elements based on the provided element.

Parameters:
e - the provided element
Returns:
number of older elements if any

getNumberOfNewer

int getNumberOfNewer(Long sinceTime)
Gets the number of newer elements based on the updated time.

Parameters:
sinceTime - the updated time
Returns:
number of newer elements if any

getNumberOfMultiUpdated

int getNumberOfMultiUpdated(Map<String,Long> sinceTimes)
Gets the number of updated elements based on the of multi-value since time.

Parameters:
sinceTime - the postedTime
Returns:
number of newer elements if any

getUpadtedActivities

List<E> getUpadtedActivities(Long sinceTime,
                             int limit)
Gets get updated activities base on since time.

Parameters:
sinceTime - the sinceTime
limit - number of newer elements to load
Returns:
number of newer elements if any

loadNewer

List<E> loadNewer(Long sinceTime,
                  int limit)
Loads newer elements based on the provided element.

Parameters:
sinceTime - updated time of newer elements to load
limit - number of newer elements to load
Returns:
an array of newer elements

loadOlder

List<E> loadOlder(Long sinceTime,
                  int limit)
Loads older elements based on the provided element.

Parameters:
sinceTime - updated time of older elements to load
limit - number of older elements to load
Returns:
an array of older elements

getNumberOfOlder

int getNumberOfOlder(Long sinceTime)
Gets the number of older elements based on the updated time.

Parameters:
sinceTime - the updated time
Returns:
number of older elements if any

getNumberOfUpgrade

int getNumberOfUpgrade()
Gets the number of stream elements based on the updated time. This one will make query to count for load more case.

Returns:
number of elements if any


Copyright © 2003–2014 eXo Platform SAS. All rights reserved.