Package wt.fc

Class PagingSessionHelper

java.lang.Object
wt.fc.PagingSessionHelper
All Implemented Interfaces:
RemoteAccess

public class PagingSessionHelper extends Object implements RemoteAccess
This class provides static helper methods for managing PagingSessions. These methods hide the implementationd details of using the PersistenceManager for paging.

Supported API: true

Extendable: false
  • Method Details

    • openPagingSession

      public static PagingQueryResult openPagingSession(int a_offset, int a_range, StatementSpec a_snapshotSpec) throws WTException
      This method opens a paging session using the specified snapshot query.

      Supported API: true
      Parameters:
      a_offset - Offset value to fetch, intitially.
      a_range - Specifies the range for the intial page of data
      a_snapshotSpec - Statement to use as the source of the paging query.
      Returns:
      PagingQueryResult
      Throws:
      WTException
    • openPagingSession

      public static PagingQueryResult openPagingSession(int a_offset, int a_range, Persistable a_source, String a_role, Class a_linkClass, boolean a_onlyOtherSide) throws WTException
      This method opens a paging session for navigation given the source object, the role, and linkclass. Note: It doesn't support nevigation for Federated object.

      Supported API: true
      Parameters:
      a_offset - Offset value to fetch, intitially.
      a_range - Specifies the range for the intial page of data
      a_source - The persistable object to navigate.
      a_role - The role to navigate to
      a_linkClass - The link class for the association to navigate
      a_onlyOtherSide - Indicates that only the other side objects of the association should be returned. If false, then the link objects are returned.
      Returns:
      PagingQueryResult
      Throws:
      WTException
    • openPagingSession

      public static PagingQueryResult openPagingSession(int a_offset, int a_range, Persistable a_source, String a_role, QuerySpec a_criteria, boolean a_onlyOtherSide) throws WTException
      This method opens a paging session for navigation given the source object, the role, and criteria. Note: It doesn't support nevigation for Federated object.

      Supported API: true
      Parameters:
      a_offset - Offset value to fetch, intitially.
      a_range - Specifies the range for the intial page of data
      a_source - The persistable object to navigate.
      a_role - The role to navigate to
      a_criteria - Selection criteria for the navigate. This QuerySpec must contain the target and link class at class index 0 and 1, respectively.
      a_onlyOtherSide - Indicates that only the other side objects of the association should be returned. If false, then the link objects are returned.
      Returns:
      PagingQueryResult
      Throws:
      WTException
    • fetchPagingSession

      public static PagingQueryResult fetchPagingSession(int a_offset, int a_range, long a_sessionId) throws WTException
      This method fetches a page of data from an opened paging session.

      Supported API: true
      Parameters:
      a_offset - Offset value to fetch.
      a_range - Specifies the range for the page of data
      a_sessionId - Specifies the paging session to fetch from.
      Returns:
      PagingQueryResult
      Throws:
      WTException
    • closePagingSession

      public static void closePagingSession(PagingSession a_pagingSession) throws WTException
      This method closes a paging session.

      Supported API: true
      Parameters:
      a_pagingSession - PagingSession instance to close.
      Throws:
      WTException
    • closePagingSession

      public static void closePagingSession(long a_sessionId) throws WTException
      This method closes a paging session.

      Supported API: true
      Parameters:
      a_sessionId - Specifies the paging session to close.
      Throws:
      WTException
    • openPagingSession

      public static PagingQueryResult openPagingSession(int a_offset, int a_range, StatementSpec a_snapshotSpec, int a_threshold) throws WTException
      This method opens a paging session using the specified snapshot query.

      Supported API: true
      Parameters:
      a_offset - Offset value to fetch, intitially.
      a_range - Specifies the range for the intial page of data
      a_snapshotSpec - Statement to use as the source of the paging query.
      a_threshold - Specifies a paging thresold for this paging session. If results are less than this value, then no paging session is opened and all results are immediately returned.
      Returns:
      PagingQueryResult
      Throws:
      WTException
    • getTotalCount

      public static int getTotalCount(long a_sessionId) throws WTException
      Returns total count of results for the specified paging session. If a negative value is returned, then it means an error occurredn during paging processing and results are not accessible. If zero is returned, then paging processing is still occurring and results are not accessible. A positive return value indicates the actual total count and all results are accessible.

      Supported API: true
      Parameters:
      a_sessionId - The session id for the paging session of interest.
      Returns:
      int
      Throws:
      WTException
    • openPagingSession

      public static PagingQueryResult openPagingSession(int a_offset, int a_range, StatementSpec a_snapshotSpec, int a_threshold, boolean a_backgroundThreadEnabled) throws WTException
      This method opens a paging session using the specified snapshot query.

      Supported API: true
      Parameters:
      a_offset - Offset value to fetch, intitially.
      a_range - Specifies the range for the intial page of data
      a_snapshotSpec - Statement to use as the source of the paging query.
      a_threshold - Specifies a paging thresold for this paging session. If results are less than this value, then no paging session is opened and all results are immediately returned.
      a_backgroundThreadEnabled - Indicates the intermidiate process should use background thread or not, and the default value will be true.
      Returns:
      PagingQueryResult
      Throws:
      WTException
    • openPagingSession

      public static PagingQueryResult openPagingSession(int a_offset, int a_range, StatementSpec a_snapshotSpec, boolean a_backgroundThreadEnabled) throws WTException
      This method opens a paging session using the specified snapshot query.

      Supported API: true
      Parameters:
      a_offset - Offset value to fetch, intitially.
      a_range - Specifies the range for the intial page of data
      a_snapshotSpec - Statement to use as the source of the paging query.
      a_backgroundThreadEnabled - Indicates the intermidiate process should use background thread or not, and the default value will be true.
      Returns:
      PagingQueryResult
      Throws:
      WTException