org.overlord.sramp.server.atom.services
Class QueryResource

java.lang.Object
  extended by org.overlord.sramp.server.atom.services.AbstractResource
      extended by org.overlord.sramp.server.atom.services.AbstractFeedResource
          extended by org.overlord.sramp.server.atom.services.QueryResource

public class QueryResource
extends AbstractFeedResource

Implementation of the S-RAMP query features defined in the Atom Binding document.


Constructor Summary
QueryResource()
          Constructor.
 
Method Summary
protected  org.jboss.resteasy.plugins.providers.atom.Feed query(String query, Integer startIndex, Integer count, String orderBy, Boolean ascending, Set<String> propNames, String baseUrl)
          Common method that performs the query and returns the atom Feed.
 org.jboss.resteasy.plugins.providers.atom.Feed queryFromGet(javax.servlet.http.HttpServletRequest request, String query, Integer startPage, Integer startIndex, Integer count, String orderBy, Boolean asc, Set<String> propNames)
          Do an s-ramp query from a GET style request.
 org.jboss.resteasy.plugins.providers.atom.Feed queryFromPost(javax.servlet.http.HttpServletRequest request, org.jboss.resteasy.plugins.providers.multipart.MultipartFormDataInput input)
          Handles clients that POST the query to the /s-ramp endpoint.
 
Methods inherited from class org.overlord.sramp.server.atom.services.AbstractFeedResource
createArtifactFeed
 
Methods inherited from class org.overlord.sramp.server.atom.services.AbstractResource
logError
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

QueryResource

public QueryResource()
Constructor.

Method Detail

queryFromGet

public org.jboss.resteasy.plugins.providers.atom.Feed queryFromGet(@Context
                                                                   javax.servlet.http.HttpServletRequest request,
                                                                   String query,
                                                                   Integer startPage,
                                                                   Integer startIndex,
                                                                   Integer count,
                                                                   String orderBy,
                                                                   Boolean asc,
                                                                   Set<String> propNames)
                                                            throws SrampAtomException
Do an s-ramp query from a GET style request.

Parameters:
uri -
query -
startPage -
startIndex -
count -
orderBy -
asc -
Throws:
SrampAtomException

queryFromPost

public org.jboss.resteasy.plugins.providers.atom.Feed queryFromPost(@Context
                                                                    javax.servlet.http.HttpServletRequest request,
                                                                    org.jboss.resteasy.plugins.providers.multipart.MultipartFormDataInput input)
                                                             throws SrampAtomException
Handles clients that POST the query to the /s-ramp endpoint.

Parameters:
input - the multipart form data
Throws:
SrampAtomException

query

protected org.jboss.resteasy.plugins.providers.atom.Feed query(String query,
                                                               Integer startIndex,
                                                               Integer count,
                                                               String orderBy,
                                                               Boolean ascending,
                                                               Set<String> propNames,
                                                               String baseUrl)
                                                        throws SrampAtomException
Common method that performs the query and returns the atom Feed.

Parameters:
query - the x-path formatted s-ramp query
startIndex - index of the first item in the result that should be returned
count - the number of items to return
orderBy - the property to sort the results by
ascending - the sort direction
propNames - the set of s-ramp property names - the extra properties that the query should return as part of the Feed
Returns:
an Atom Feed
Throws:
SrampAtomException


Copyright © 2011-2013 JBoss, a division of Red Hat. All Rights Reserved.