Class AbstractSerializablePageList<E>

java.lang.Object
org.exoplatform.commons.utils.PageList<E>
org.exoplatform.commons.utils.AbstractSerializablePageList<E>
Direct Known Subclasses:
EmptySerializablePageList, PageListAccess, StatelessPageList

public abstract class AbstractSerializablePageList<E> extends org.exoplatform.commons.utils.PageList<E>

This class defines the common functionalities for the serializable subclasses of PageList. Note that itself it does not implement the Serializable interface for the reason that it needs to define a no arg constructor in a non serializble class (serialization constraint).

The method defines an abstract connect() method that is used to connect the the page list to the underlying data.

The methods readState(java.io.ObjectInputStream) and writeState(java.io.ObjectOutputStream) are defined for the subclasses and should be called by void readObject(ObjectInputStream in) and void writeObject(ObjectOutputStream out) custom serialization protocol.

  • Constructor Details

    • AbstractSerializablePageList

      protected AbstractSerializablePageList(int pageSize)
      Builds a page list.
      Parameters:
      pageSize - the page size
    • AbstractSerializablePageList

      protected AbstractSerializablePageList()
      This constructor should not be used by subclasses, it is only for serialization needs.
  • Method Details

    • connect

      protected abstract org.exoplatform.commons.utils.ListAccess<E> connect() throws Exception
      Throws:
      Exception
    • populateCurrentPage

      protected final void populateCurrentPage(int page) throws Exception
      Specified by:
      populateCurrentPage in class org.exoplatform.commons.utils.PageList<E>
      Throws:
      Exception
    • getAll

      public final List<E> getAll()
      Specified by:
      getAll in class org.exoplatform.commons.utils.PageList<E>
    • writeState

      protected final void writeState(ObjectOutputStream out) throws IOException
      Throws:
      IOException
    • readState

      protected final void readState(ObjectInputStream in) throws IOException
      Throws:
      IOException
    • getAvailablePage

      public final int getAvailablePage()
      Overrides:
      getAvailablePage in class org.exoplatform.commons.utils.PageList<E>
    • getTo

      public final int getTo()
      Overrides:
      getTo in class org.exoplatform.commons.utils.PageList<E>
    • getFrom

      public final int getFrom()
      Overrides:
      getFrom in class org.exoplatform.commons.utils.PageList<E>
    • setAvailablePage

      protected final void setAvailablePage(int available)
      Overrides:
      setAvailablePage in class org.exoplatform.commons.utils.PageList<E>
    • checkAndSetPage

      protected final void checkAndSetPage(int page) throws Exception
      Overrides:
      checkAndSetPage in class org.exoplatform.commons.utils.PageList<E>
      Throws:
      Exception
    • getPage

      public final List<E> getPage(int page) throws Exception
      Overrides:
      getPage in class org.exoplatform.commons.utils.PageList<E>
      Throws:
      Exception
    • currentPage

      public final List<E> currentPage() throws Exception
      Overrides:
      currentPage in class org.exoplatform.commons.utils.PageList<E>
      Throws:
      Exception
    • getAvailable

      public final int getAvailable()
      Overrides:
      getAvailable in class org.exoplatform.commons.utils.PageList<E>
    • getCurrentPage

      public final int getCurrentPage()
      Overrides:
      getCurrentPage in class org.exoplatform.commons.utils.PageList<E>
    • setPageSize

      public final void setPageSize(int pageSize)
      Overrides:
      setPageSize in class org.exoplatform.commons.utils.PageList<E>
    • getPageSize

      public final int getPageSize()
      Overrides:
      getPageSize in class org.exoplatform.commons.utils.PageList<E>