com.endeca.mobile.abstraction
Class ResultSetMetaInfoAbstraction

java.lang.Object
  extended by com.endeca.mobile.abstraction.ResultSetMetaInfoAbstraction

public final class ResultSetMetaInfoAbstraction
extends java.lang.Object

The ResultSetMetaInfoAbstractionPlugin retrieves information related to the result set (for instance, number of records, records per page, records returned, etc.) It adds its data to the AbstractedResults object, under the key "MetaInfo". If no information is relevant (e.g. a record query), this key will not exist.

All information added to the AbstractedResult object by the ResultSetMetaInfoAbstractionPlugin is contained within one master hash. This hash is keyed as follows:

Total Number of Matching Records How many records total are matched by the request (as opposed to how many were returned).
Total Number of Matching Aggregate Records How many records total are matched by the request (as opposed to how many were returned). This is returned only if the query was an aggregated record query.
Sorted By If a sort order other than the default was used, this will contain an array of hashes, representing the order in which the records were sorted. Each hash will have two keys: Sort Order and Sort Key. If no specific sort order was requested, or if the order requested was the default order, this key will not exist.
Total Network and Compute Time The total the total number of seconds spent waiting for the MDEX Engine to respond to all queries.
NOTE: The following values are calculated for aggregated records if the query was rolled up, or for "regular" records if it was not.
Starting Record Number The record number of the first record returned. For the first page, this will always be "1".
Number of Pages How many pages are available within the record set. This is based on the number of records per page that were requested.
Number of Records per Page How many records were requested for this particular request
Number of Records Returned How many records were actually returned (this will always be less than or equal to the number per page, and less than or equal to the total number of matching records)
Page Number Which page of records this is, based on the number of records per page and the total number of matching records
Ending Record Number The last record number on the page


If key properties are requested, it will contain one additional key, Key Properties. The value of this key will be a hash, containing the available properties. These properties are, in turn, represented by hashes of the availavle key properties.


Constructor Summary
ResultSetMetaInfoAbstraction()
           
 
Method Summary
static java.util.HashMap abstractifyAggrRecordsMetaInfo(long navTotalAggrRecs, long navTotalRecs, long aggrRecsOffset, long numAggrRecsReturned, long numAggrRecsPerPage, AbstractionContext context)
          Converts the metadata surrounding an aggregated record list into a form which is suitable for serialization.
static java.util.ArrayList abstractifyERecSortKeyList(com.endeca.navigation.ERecSortKeyList activeSortKeys, AbstractionContext context)
          Converts sort keys into a form suitable for serialization.
static java.util.HashMap abstractifyKeyPropMap(java.util.Map keyProps, AbstractionContext context)
          Converts a map of property maps into a form suitable for serialization.
static java.util.HashMap abstractifyOtherMetaInfo(com.endeca.navigation.ENEQuery query, java.util.Map keyProperties, java.lang.Double compTime, AbstractionContext context)
          Converts the compute time and key properties of a record list into a form suitable for serialization.
static java.util.HashMap abstractifyRecordsMetaInfo(long navTotalRecs, long recOffset, long numRecsReturned, long numRecsPerPage, AbstractionContext context)
          Converts the metadata surrounding a record list into a form which is suitable for serialization.
static java.util.HashMap abstractifySortMetaInfo(com.endeca.navigation.ERecSortKeyList activeSortKeys, com.endeca.navigation.ERecSortKeyList allSortKeys, AbstractionContext context)
          Converts metadata regarding sort keys into a form which is suitable for serialization.
static boolean hasAggregateRecs(com.endeca.navigation.ENEQuery query)
          Checks whether a query is intended to return aggregate records.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResultSetMetaInfoAbstraction

public ResultSetMetaInfoAbstraction()
Method Detail

abstractifyRecordsMetaInfo

public static java.util.HashMap abstractifyRecordsMetaInfo(long navTotalRecs,
                                                           long recOffset,
                                                           long numRecsReturned,
                                                           long numRecsPerPage,
                                                           AbstractionContext context)
Converts the metadata surrounding a record list into a form which is suitable for serialization.

Parameters:
navTotalRecs - The total number of records
recOffset - The offset of the records
numRecsReturned - The number of records in the list
numRecsPerPage - The number of records per page
numLinks - The number of page links returned
context - The context of the current request
Returns:
The converted metadata

abstractifyAggrRecordsMetaInfo

public static java.util.HashMap abstractifyAggrRecordsMetaInfo(long navTotalAggrRecs,
                                                               long navTotalRecs,
                                                               long aggrRecsOffset,
                                                               long numAggrRecsReturned,
                                                               long numAggrRecsPerPage,
                                                               AbstractionContext context)
Converts the metadata surrounding an aggregated record list into a form which is suitable for serialization.

Parameters:
navTotalRecs - The total number of records
recOffset - The offset of the records
numRecsReturned - The number of records in the list
numRecsPerPage - The number of records per page
numLinks - The number of page links returned
context - The context of the current request
Returns:
The converted metadata

abstractifyOtherMetaInfo

public static java.util.HashMap abstractifyOtherMetaInfo(com.endeca.navigation.ENEQuery query,
                                                         java.util.Map keyProperties,
                                                         java.lang.Double compTime,
                                                         AbstractionContext context)
Converts the compute time and key properties of a record list into a form suitable for serialization.

Parameters:
query - The query which produced the record list
keyProperties - The key properties
compTime - The compute time
context - The context of the current request
Returns:
The converted information

abstractifyKeyPropMap

public static java.util.HashMap abstractifyKeyPropMap(java.util.Map keyProps,
                                                      AbstractionContext context)
Converts a map of property maps into a form suitable for serialization.

Parameters:
keyProps - The map of property maps
context - The context of the current request
Returns:
The converted map

abstractifyERecSortKeyList

public static java.util.ArrayList abstractifyERecSortKeyList(com.endeca.navigation.ERecSortKeyList activeSortKeys,
                                                             AbstractionContext context)
Converts sort keys into a form suitable for serialization.

Parameters:
activeSortKeys - The sort keys
context - The context of the current request
Returns:
The converted sort keys

abstractifySortMetaInfo

public static java.util.HashMap abstractifySortMetaInfo(com.endeca.navigation.ERecSortKeyList activeSortKeys,
                                                        com.endeca.navigation.ERecSortKeyList allSortKeys,
                                                        AbstractionContext context)
Converts metadata regarding sort keys into a form which is suitable for serialization. This mostly consists of producing links which correspond to actions which involve sorts.

Parameters:
activeSortKeys - The active sort keys
allSortKeys - All sort keys
context - The context of the current request
Returns:
The converted metadata

hasAggregateRecs

public static boolean hasAggregateRecs(com.endeca.navigation.ENEQuery query)
Checks whether a query is intended to return aggregate records.

Parameters:
query - The query to check
Returns:
Whether the query should return aggregate records