wt.fc
Class PagingSessionHelper

java.lang.Object
  extended bywt.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


Field Summary
private static String CLASSNAME
           
private static String FC_RESOURCE
           
private static String RESOURCE
           
(package private) static boolean SERVER
           
 
Fields inherited from interface wt.method.RemoteAccess
versionID
 
Constructor Summary
PagingSessionHelper()
           
 
Method Summary
protected static void _closePagingSession(long a_sessionId)
          This method closes a paging session.
static void closePagingSession(long a_sessionId)
          This method closes a paging session.
static void closePagingSession(PagingSession a_pagingSession)
          This method closes a paging session.
static PagingQueryResult fetchPagingSession(int a_offset, int a_range, long a_sessionId)
          This method fetches a page of data from an opened paging session.
static int getTotalCount(long a_sessionId)
          Returns total count of results for the specified paging session.
static PagingQueryResult openPagingSession(int a_offset, int a_range, Persistable a_source, String a_role, Class a_linkClass, boolean a_onlyOtherSide)
          This method opens a paging session for navigation given the source object, the role, and linkclass.
static PagingQueryResult openPagingSession(int a_offset, int a_range, Persistable a_source, String a_role, QuerySpec a_criteria, boolean a_onlyOtherSide)
          This method opens a paging session for navigation given the source object, the role, and criteria.
static PagingQueryResult openPagingSession(int a_offset, int a_range, StatementSpec a_snapshotSpec)
          This method opens a paging session using the specified snapshot query.
static PagingQueryResult openPagingSession(int a_offset, int a_range, StatementSpec a_snapshotSpec, boolean a_backgroundThreadEnabled)
          This method opens a paging session using the specified snapshot query.
static PagingQueryResult openPagingSession(int a_offset, int a_range, StatementSpec a_snapshotSpec, int a_threshold)
          This method opens a paging session using the specified snapshot query.
static PagingQueryResult openPagingSession(int a_offset, int a_range, StatementSpec a_snapshotSpec, int a_threshold, boolean a_backgroundThreadEnabled)
          This method opens a paging session using the specified snapshot query.
private static PagingSession refreshPagingSession(long a_sessionId)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RESOURCE

private static final String RESOURCE
See Also:
Constant Field Values

CLASSNAME

private static final String CLASSNAME

SERVER

static final boolean SERVER

FC_RESOURCE

private static final String FC_RESOURCE
See Also:
Constant Field Values
Constructor Detail

PagingSessionHelper

public PagingSessionHelper()
Method Detail

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

_closePagingSession

protected 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

refreshPagingSession

private static PagingSession refreshPagingSession(long a_sessionId)
                                           throws WTException
Throws:
WTException