org.apache.abdera.ext.history
Class FeedPagingHelper

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

public final class FeedPagingHelper
extends Object

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


Field Summary
static QName ARCHIVE
           
static QName COMPLETE
           
static String FH_PREFIX
           
static String FHNS
           
 
Method Summary
static IRI getCurrent(Source feed)
          Returns the IRI of the current link relation
static IRI getFirst(Source feed)
          Returns the IRI of the first link relation
static IRI getLast(Source feed)
          Returns the IRI of the last link relation
static IRI getNext(Source feed)
          Returns the IRI of the next link relation
static IRI getNextArchive(Source feed)
          Returns the IRI of the next-archive link relation
static IRI getPrevious(Source feed)
          Returns the IRI of the previous link relation
static IRI getPreviousArchive(Source feed)
          Returns the IRI of the prev-archive link relation
static boolean isArchive(Source feed)
          Return true if the feed has been marked as an archive
static boolean isComplete(Source feed)
          Returns true if the feed is "complete".
static boolean isPaged(Source feed)
          Return true if the feed contains any next, previous, first or last paging link relations
static void setArchive(Source feed, boolean archive)
          Flag the feed as being an archive.
static void setComplete(Source feed, boolean complete)
          Flag the feed as being complete.
static Link setCurrent(Source feed, String iri)
          Adds a current link relation to the feed
static Link setFirst(Source feed, String iri)
          Adds a first link relation to the feed
static Link setLast(Source feed, String iri)
          Adds a last link relation to the feed
static Link setNext(Source feed, String iri)
          Adds a next link relation to the feed
static Link setNextArchive(Source feed, String iri)
          Adds a next-archive link relation to the feed
static Link setPrevious(Source feed, String iri)
          Adds a previous link relation to the feed
static Link setPreviousArchive(Source feed, 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 String FH_PREFIX
See Also:
Constant Field Values

FHNS

public static final String FHNS
See Also:
Constant Field Values

COMPLETE

public static final QName COMPLETE

ARCHIVE

public static final QName ARCHIVE
Method Detail

isComplete

public static boolean isComplete(Source 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(Source 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(Source 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(Source feed)
Return true if the feed has been marked as an archive

Parameters:
feed - The feed to check

isPaged

public static boolean isPaged(Source 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(Source feed,
                           String iri)
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

setPrevious

public static Link setPrevious(Source feed,
                               String iri)
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

setFirst

public static Link setFirst(Source feed,
                            String iri)
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

setLast

public static Link setLast(Source feed,
                           String iri)
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

setNextArchive

public static Link setNextArchive(Source feed,
                                  String iri)
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

setPreviousArchive

public static Link setPreviousArchive(Source feed,
                                      String iri)
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

setCurrent

public static Link setCurrent(Source feed,
                              String iri)
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

getNext

public static IRI getNext(Source feed)
Returns the IRI of the next link relation


getPrevious

public static IRI getPrevious(Source feed)
Returns the IRI of the previous link relation


getFirst

public static IRI getFirst(Source feed)
Returns the IRI of the first link relation


getLast

public static IRI getLast(Source feed)
Returns the IRI of the last link relation


getPreviousArchive

public static IRI getPreviousArchive(Source feed)
Returns the IRI of the prev-archive link relation


getNextArchive

public static IRI getNextArchive(Source feed)
Returns the IRI of the next-archive link relation


getCurrent

public static IRI getCurrent(Source feed)
Returns the IRI of the current link relation



Copyright © 2006-2012 Apache Software Foundation. All Rights Reserved.