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

    Modifier and Type
    Method
    Description
    static <T> T[]
    convertListToArray(List<T> list, Class<T> type)
     
    int
    Gets the number of newer elements based on the provided element.
    int
    Gets the number of newer elements based on the updated time.
    int
    Gets the number of older elements based on the provided element.
    int
    Gets the number of older elements based on the updated time.
    int
    Gets the number of stream elements based on the updated time.
    int
    Overrides its parent interface to avoid checked-exception.
    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.
    loadAsList(int index, int limit)
    Loads items as list instead of array as from load(int, int).
    loadIdsAsList(int index, int limit)
    Loads items as Ids list instead of array as from load(int, int).
    loadNewer(E e, int length)
    Loads newer elements based on the provided element.
    loadNewer(Long sinceTime, int limit)
    Loads newer elements based on the provided element.
    loadOlder(E e, int length)
    Loads older elements based on the provided element.
    loadOlder(Long sinceTime, int limit)
    Loads older elements based on the provided element.
  • Method Details

    • 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
    • loadIdsAsList

      List<String> loadIdsAsList(int index, int limit)
      Loads items as Ids list instead of array as from load(int, int).
      Parameters:
      index - the index
      limit - the number to load
      Returns:
      a Ids 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
    • 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
    • convertListToArray

      static <T> T[] convertListToArray(List<T> list, Class<T> type)