org.gcube.opensearch.opensearchlibrary.responseelements
Class OpenSearchResponse

java.lang.Object
  extended by org.gcube.opensearch.opensearchlibrary.responseelements.OpenSearchResponse
Direct Known Subclasses:
HTMLResponse, XMLResponse

public abstract class OpenSearchResponse
extends java.lang.Object

Class implementing functionality common to all OpenSearch responses

Author:
gerasimos.farantatos

Constructor Summary
OpenSearchResponse()
           
 
Method Summary
 boolean containsPagingElements()
          Determines whether this search response page contains OpenSearch response information relevant to page handling.
 java.lang.Integer getItemsPerPage()
          Returns the number of results per page that are contained in the OpenSearch response
 java.util.List<QueryBuilder> getQueryBuilders(java.lang.String role)
          Returns a list of QueryBuilder objects that may be used to construct queries for a specific role
 org.w3c.dom.Document getResponse()
          Returns the OpenSearch response Document
 java.lang.Integer getStartIndex()
          Returns the start index of the first result contained in the OpenSearch response
 java.lang.Integer getTotalResults()
          Returns the number of total results contained in the OpenSearchResponse
 boolean isFirstPage()
          Determines whether this page is the first page of search results
 boolean isLastPage()
          Determines whether this page is the last page of search results
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OpenSearchResponse

public OpenSearchResponse()
Method Detail

getResponse

public org.w3c.dom.Document getResponse()
Returns the OpenSearch response Document

Returns:
The response

getTotalResults

public java.lang.Integer getTotalResults()
Returns the number of total results contained in the OpenSearchResponse

Returns:
The number of total results

getStartIndex

public java.lang.Integer getStartIndex()
Returns the start index of the first result contained in the OpenSearch response

Returns:
The start index of the first result

getItemsPerPage

public java.lang.Integer getItemsPerPage()
Returns the number of results per page that are contained in the OpenSearch response

Returns:
The number of results per page

isFirstPage

public boolean isFirstPage()
Determines whether this page is the first page of search results

Returns:
true if the current page is the first page of search results

isLastPage

public boolean isLastPage()
Determines whether this page is the last page of search results

Returns:
true if the current page is the last page of search results

containsPagingElements

public boolean containsPagingElements()
Determines whether this search response page contains OpenSearch response information relevant to page handling. If not, all getter methods returning such information should return null with the possible exception of getItemsPerPage()

Returns:
true if this search response contains OpenSearch response information, false otherwise

getQueryBuilders

public java.util.List<QueryBuilder> getQueryBuilders(java.lang.String role)
Returns a list of QueryBuilder objects that may be used to construct queries for a specific role

Parameters:
role - The role that t
Returns:
The list of QueryBuilders associated with the role. If no QueryBuilders corresponding to the role are found, an empty list is returned