org.apache.abdera.ext.history
Class FeedPagingHelper

java.lang.Object
  extended by org.apache.abdera.ext.history.FeedPagingHelper

public class FeedPagingHelper
extends java.lang.Object

Initial support for Mark Nottingham's Feed Paging and Archiving draft (http://ietfreport.isoc.org/all-ids/draft-nottingham-atompub-feed-history-07.txt)


Field Summary
static javax.xml.namespace.QName ARCHIVE
           
static javax.xml.namespace.QName COMPLETE
           
static java.lang.String FH_PREFIX
           
static java.lang.String FHNS
           
 
Constructor Summary
FeedPagingHelper()
           
 
Method Summary
static IRI getCurrent(Feed feed)
          Returns the IRI of the current link relation
static IRI getFirst(Feed feed)
          Returns the IRI of the first link relation
static IRI getLast(Feed feed)
          Returns the IRI of the last link relation
static IRI getNext(Feed feed)
          Returns the IRI of the next link relation
static IRI getNextArchive(Feed feed)
          Returns the IRI of the next-archive link relation
static IRI getPrevious(Feed feed)
          Returns the IRI of the previous link relation
static IRI getPreviousArchive(Feed feed)
          Returns the IRI of the prev-archive link relation
static boolean isArchive(Feed feed)
          Return true if the feed has been marked as an archive
static boolean isComplete(Feed feed)
          Returns true if the feed is "complete".
static boolean isPaged(Feed feed)
          Return true if the feed contains any next, previous, first or last paging link relations
static void setArchive(Feed feed, boolean archive)
          Flag the feed as being an archive.
static void setComplete(Feed feed, boolean complete)
          Flag the feed as being complete.
static Link setCurrent(Feed feed, java.lang.String iri)
          Adds a current link relation to the feed
static Link setFirst(Feed feed, java.lang.String iri)
          Adds a first link relation to the feed
static Link setLast(Feed feed, java.lang.String iri)
          Adds a last link relation to the feed
static Link setNext(Feed feed, java.lang.String iri)
          Adds a next link relation to the feed
static Link setNextArchive(Feed feed, java.lang.String iri)
          Adds a next-archive link relation to the feed
static Link setPrevious(Feed feed, java.lang.String iri)
          Adds a previous link relation to the feed
static Link setPreviousArchive(Feed feed, java.lang.String iri)
          Adds a prev-archive link relation to the feed
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FH_PREFIX

public static final java.lang.String FH_PREFIX
See Also:
Constant Field Values

FHNS

public static final java.lang.String FHNS
See Also:
Constant Field Values

COMPLETE

public static final javax.xml.namespace.QName COMPLETE

ARCHIVE

public static final javax.xml.namespace.QName ARCHIVE
Constructor Detail

FeedPagingHelper

public FeedPagingHelper()
Method Detail

isComplete

public static boolean isComplete(Feed feed)
Returns true if the feed is "complete". According to the Feed Paging and Archiving specification, in a complete feed, "any entry not actually in the feed document SHOULD NOT be considered to be part of that feed."

Parameters:
feed - The feed to check

setComplete

public static void setComplete(Feed feed,
                               boolean complete)
Flag the feed as being complete. According to the Feed Paging and Archiving specification, in a complete feed, "any entry not actually in the feed document SHOULD NOT be considered to be part of that feed."

Parameters:
feed - The Feed to mark as complete
complete - True if the feed is complete

setArchive

public static void setArchive(Feed feed,
                              boolean archive)
Flag the feed as being an archive.

Parameters:
feed - The Feed to mark as an archive
archive - True if the feed is an archive

isArchive

public static boolean isArchive(Feed feed)
Return true if the feed has been marked as an archive

Parameters:
feed - The feed to check

isPaged

public static boolean isPaged(Feed feed)
Return true if the feed contains any next, previous, first or last paging link relations

Parameters:
feed - The feed to check

setNext

public static Link setNext(Feed feed,
                           java.lang.String iri)
                    throws IRISyntaxException
Adds a next link relation to the feed

Parameters:
feed - The feed
iri - The IRI of the next feed document
Returns:
The newly created Link
Throws:
IRISyntaxException

setPrevious

public static Link setPrevious(Feed feed,
                               java.lang.String iri)
                        throws IRISyntaxException
Adds a previous link relation to the feed

Parameters:
feed - The feed
iri - The IRI of the previous feed document
Returns:
The newly created Link
Throws:
IRISyntaxException

setFirst

public static Link setFirst(Feed feed,
                            java.lang.String iri)
                     throws IRISyntaxException
Adds a first link relation to the feed

Parameters:
feed - The feed
iri - The IRI of the first feed document
Returns:
The newly created Link
Throws:
IRISyntaxException

setLast

public static Link setLast(Feed feed,
                           java.lang.String iri)
                    throws IRISyntaxException
Adds a last link relation to the feed

Parameters:
feed - The feed
iri - The IRI of the last feed document
Returns:
The newly created Link
Throws:
IRISyntaxException

setNextArchive

public static Link setNextArchive(Feed feed,
                                  java.lang.String iri)
                           throws IRISyntaxException
Adds a next-archive link relation to the feed

Parameters:
feed - The feed
iri - The IRI of the next archive feed document
Returns:
The newly created Link
Throws:
IRISyntaxException

setPreviousArchive

public static Link setPreviousArchive(Feed feed,
                                      java.lang.String iri)
                               throws IRISyntaxException
Adds a prev-archive link relation to the feed

Parameters:
feed - The feed
iri - The IRI of the previous archive feed document
Returns:
The newly created Link
Throws:
IRISyntaxException

setCurrent

public static Link setCurrent(Feed feed,
                              java.lang.String iri)
                       throws IRISyntaxException
Adds a current link relation to the feed

Parameters:
feed - The feed
iri - The IRI of the current feed document
Returns:
The newly created Link
Throws:
IRISyntaxException

getNext

public static IRI getNext(Feed feed)
                   throws IRISyntaxException
Returns the IRI of the next link relation

Throws:
IRISyntaxException

getPrevious

public static IRI getPrevious(Feed feed)
                       throws IRISyntaxException
Returns the IRI of the previous link relation

Throws:
IRISyntaxException

getFirst

public static IRI getFirst(Feed feed)
                    throws IRISyntaxException
Returns the IRI of the first link relation

Throws:
IRISyntaxException

getLast

public static IRI getLast(Feed feed)
                   throws IRISyntaxException
Returns the IRI of the last link relation

Throws:
IRISyntaxException

getPreviousArchive

public static IRI getPreviousArchive(Feed feed)
                              throws IRISyntaxException
Returns the IRI of the prev-archive link relation

Throws:
IRISyntaxException

getNextArchive

public static IRI getNextArchive(Feed feed)
                          throws IRISyntaxException
Returns the IRI of the next-archive link relation

Throws:
IRISyntaxException

getCurrent

public static IRI getCurrent(Feed feed)
                      throws IRISyntaxException
Returns the IRI of the current link relation

Throws:
IRISyntaxException