com.collabnet.tracker.ws.handler
Class GetNextPageHandler

java.lang.Object
  extended by com.collabnet.tracker.ws.handler.GetNextPageHandler
All Implemented Interfaces:
DocumentHandler

public class GetNextPageHandler
extends java.lang.Object
implements DocumentHandler

Handles getNextPage requests. The request document looks like:

  <getNextPage>
      <pageInfo>
      [paging information], see PageInfoXMLHelper
      </pageInfo>
  </getNextPage>
 

Returns a <artifactList> document (see ArtifactListXMLHelper

The typical use case is the following:

  1. Execute a query using getArtifactList (see GetArtifactListHandler.
  2. The result is returned as an <pt:artifactList> document. This document contains a <pt:pageInfo> child element that contains paging information.
  3. If the next set of records is needed, execute the <pt:getNextPage> document by passing in the <pt:pageInfo> element that was returned in the <pt:artifactList> document.
  4. The result of a <pt:getNextPage> request is an <pt:artifactList> document, so if additional pages are needed, then simply call <pt:getNextPage> with the <pt:pageInfo> element returned in the <pt:artifactList> document.

Author:
sszego

Field Summary
static java.lang.String REQUEST_ROOT_ELEMENT_NAME
          The name of the root element: the string "getNextPage"
 
Constructor Summary
GetNextPageHandler()
           
 
Method Summary
 DocumentType[] getHandledDocumentTypes()
          Returns the following DocumentType:
 java.util.List getSchemaReferences(Callcontext context, XMLRequest request)
          (non-Javadoc)
 void handle(Callcontext context, XMLRequest request, XMLResponse response)
          Expects the following document:
 void produceSchema(Callcontext context, XMLRequest request, SchemaVisitor visitor)
          Returns the schema for artifactList and for the getNextPage document.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

REQUEST_ROOT_ELEMENT_NAME

public static final java.lang.String REQUEST_ROOT_ELEMENT_NAME
The name of the root element: the string "getNextPage"

See Also:
Constant Field Values
Constructor Detail

GetNextPageHandler

public GetNextPageHandler()
Method Detail

handle

public void handle(Callcontext context,
                   XMLRequest request,
                   XMLResponse response)
            throws java.lang.Exception
Expects the following document:
 <getNextPage>
     <pageInfo>
     [paging information], see PageInfoXMLHelper
     </pageInfo>
 </getNextPage>
 
Returns a <artifactList> document. (non-Javadoc)

Specified by:
handle in interface DocumentHandler
Throws:
java.lang.Exception
See Also:
DocumentHandler.handle(com.collabnet.core.ws.services.Callcontext, com.collabnet.core.ws.dispatcher.XMLRequest, com.collabnet.core.ws.dispatcher.XMLResponse)

getSchemaReferences

public java.util.List getSchemaReferences(Callcontext context,
                                          XMLRequest request)
                                   throws SchemaReferenceException
(non-Javadoc)

Specified by:
getSchemaReferences in interface DocumentHandler
Throws:
SchemaReferenceException
See Also:
DocumentHandler.getSchemaReferences(com.collabnet.core.ws.services.Callcontext, com.collabnet.core.ws.dispatcher.XMLRequest)

getHandledDocumentTypes

public DocumentType[] getHandledDocumentTypes()
Returns the following DocumentType:
 namespace: XMLConstants.NAMESPACE
 tag: REQUEST_ROOT_ELEMENT_NAME
 
(non-Javadoc)

Specified by:
getHandledDocumentTypes in interface DocumentHandler
See Also:
DocumentHandler.getHandledDocumentTypes()

produceSchema

public void produceSchema(Callcontext context,
                          XMLRequest request,
                          SchemaVisitor visitor)
                   throws SchemaGenerationException
Returns the schema for artifactList and for the getNextPage document.

Specified by:
produceSchema in interface DocumentHandler
Throws:
SchemaGenerationException
See Also:
ArtifactListXMLHelper.produceSchema(com.collabnet.core.ws.services.Callcontext, com.collabnet.core.ws.dispatcher.XMLRequest, com.collabnet.core.xml.SchemaVisitor), QueryXMLHelper.acceptSchemaVisitor(SchemaVisitor), DocumentHandler.produceSchema(com.collabnet.core.ws.services.Callcontext, com.collabnet.core.ws.dispatcher.XMLRequest, com.collabnet.core.xml.SchemaVisitor)