gov.nasa.pds.registry.client.results
Class RegistryResults

java.lang.Object
  extended by gov.nasa.pds.registry.client.results.RegistryResults

public class RegistryResults
extends Object

Wrapper for Registry Service PagedResponse object. A simple utility to handles paging through the registry results to minimize memory load when a large number of products are being queries

Author:
jpadams

Field Summary
static int MAX_PAGE_LENGTH
          In order to scale for very large registry products, need to page the registry output
 
Constructor Summary
RegistryResults(List<String> registryUrlList, RegistryQuery<?> query, int queryMax)
          Constructor for list of registry urls.
RegistryResults(List<String> registryUrlList, RegistryQuery<?> query, int queryMax, List<ResultsFilter> resultsFilterList)
          Main constructor that initializes globals as needed and increments to the first registry in the list.
RegistryResults(String registryUrl, RegistryQuery<?> query, int queryMax)
          Constructor for a single registryUrl.
RegistryResults(String registryUrl, RegistryQuery<?> query, int queryMax, List<ResultsFilter> resultsFilterList)
          Constructor for a single registryUrl.
 
Method Summary
 int getPageLength()
           
 List<Object> getResultObjects()
           
 boolean nextPage()
          Handles paging through results
 void performRegistryQuery(int start, int pageLength)
          Queries Registry with page beginning at start with specified page length.
 void setPageLength(int pageLength)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MAX_PAGE_LENGTH

public static final int MAX_PAGE_LENGTH
In order to scale for very large registry products, need to page the registry output

See Also:
Constant Field Values
Constructor Detail

RegistryResults

public RegistryResults(String registryUrl,
                       RegistryQuery<?> query,
                       int queryMax)
                throws RegistryClientException
Constructor for a single registryUrl. Creates list with registryUrl and calls main constructor.

Parameters:
registryUrl -
query -
version -
queryMax -
Throws:
RegistryClientException

RegistryResults

public RegistryResults(String registryUrl,
                       RegistryQuery<?> query,
                       int queryMax,
                       List<ResultsFilter> resultsFilterList)
                throws RegistryClientException
Constructor for a single registryUrl. Creates list with registryUrl and calls main constructor.

Parameters:
registryUrl -
query -
version -
queryMax -
Throws:
RegistryClientException

RegistryResults

public RegistryResults(List<String> registryUrlList,
                       RegistryQuery<?> query,
                       int queryMax)
                throws RegistryClientException
Constructor for list of registry urls. Call main constructor with null for filter list

Parameters:
registryUrlList -
query -
version -
queryMax -
Throws:
RegistryClientException

RegistryResults

public RegistryResults(List<String> registryUrlList,
                       RegistryQuery<?> query,
                       int queryMax,
                       List<ResultsFilter> resultsFilterList)
                throws RegistryClientException
Main constructor that initializes globals as needed and increments to the first registry in the list.

Parameters:
registryUrlList -
query -
version -
queryMax -
Throws:
RegistryClientException
Method Detail

nextPage

public boolean nextPage()
                 throws RegistryServiceException,
                        RegistryClientException
Handles paging through results

Returns:
list of ExtrinsicObjects objects from query
Throws:
RegistryServiceException
RegistryClientException

performRegistryQuery

public void performRegistryQuery(int start,
                                 int pageLength)
                          throws RegistryServiceException,
                                 RegistryClientException
Queries Registry with page beginning at start with specified page length. TODO Current implementation requires this method to be called an extra time after it runs out of results For instance, if we query from start=1 with pageLength=100, but there are only 90 results, it will still query the Registry again even though we should know it is already out of results

Parameters:
start -
pageLength -
Throws:
RegistryServiceException
RegistryClientException
SearchCoreFatalException

getResultObjects

public List<Object> getResultObjects()
Returns:
the resultObjects

getPageLength

public int getPageLength()
Returns:
the pageLength

setPageLength

public void setPageLength(int pageLength)
Parameters:
pageLength - the pageLength to set


Copyright © 2010-2014 Planetary Data System. All Rights Reserved.