com.blackledge.david.tivo.hmoclient
Class ContainerRequest

java.lang.Object
  extended by com.blackledge.david.tivo.hmoclient.ContainerRequest

public class ContainerRequest
extends Object

Class to set up a request for a container and parse the results back for us. RandomStart not supported.

Version:
$Revision: 1.1 $

Field Summary
static String ORDER_CREATION_DATE
           
static String ORDER_LAST_CHANGE_DATE
           
static String ORDER_RANDOM
          May not be used with any other ORDER.
static String ORDER_TITLE
           
static String ORDER_TYPE
           
 
Constructor Summary
ContainerRequest(ContainerRequest request, String url, boolean copy)
           
ContainerRequest(HMOSession session, String container)
           
 
Method Summary
 void addOrder(String order)
           
 void addReverseOrder(String order)
           
 Container execute(long startOffset, long numItems)
           
 Container execute(long startOffset, long numItems, Item startItem)
          Hopefully you can ignore the startItem and just specify the numeric position (1-based) you want the list to start at.
 String getFilter()
           
 String getOrder()
           
 long getRandomSeed()
           
 HMOSession getSession()
           
 boolean isRecursive()
           
 void setFilter(String filter)
          "{filter} is a comma-delimited list of MIME types, indicating the desired value(s) for the Details.ContentType element of each item.
 void setOrder(String order)
           
 void setRandomSeed(long randomSeed)
          Required if sort is Random.
 void setRecursive(boolean recursive)
          If set, container folder is ignored - it gets everything (up to apparent limit of 128 items)
 void setReverseOrder(String order)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ORDER_TYPE

public static final String ORDER_TYPE
See Also:
Constant Field Values

ORDER_TITLE

public static final String ORDER_TITLE
See Also:
Constant Field Values

ORDER_CREATION_DATE

public static final String ORDER_CREATION_DATE
See Also:
Constant Field Values

ORDER_LAST_CHANGE_DATE

public static final String ORDER_LAST_CHANGE_DATE
See Also:
Constant Field Values

ORDER_RANDOM

public static final String ORDER_RANDOM
May not be used with any other ORDER.

See Also:
Constant Field Values
Constructor Detail

ContainerRequest

public ContainerRequest(HMOSession session,
                        String container)

ContainerRequest

public ContainerRequest(ContainerRequest request,
                        String url,
                        boolean copy)
Method Detail

getSession

public HMOSession getSession()

setOrder

public void setOrder(String order)

setReverseOrder

public void setReverseOrder(String order)

addOrder

public void addOrder(String order)

addReverseOrder

public void addReverseOrder(String order)

getOrder

public String getOrder()

setFilter

public void setFilter(String filter)
"{filter} is a comma-delimited list of MIME types, indicating the desired value(s) for the Details.ContentType element of each item. Any entry can contain a wildcard (*) in place of the "major" or "minor" portion of the MIME type. For example, "image/*" would match any item with a general MIME type of "image". Any entry in the list also can be prefixed with an exclamation point (!) to limit the items returned to those NOT of the specified type. When the Filter parameter is missing, the default value is "* / *". This will result in no restriction of the types of items appearing in the meta-data."

Parameters:
filter -

getFilter

public String getFilter()

setRandomSeed

public void setRandomSeed(long randomSeed)
Required if sort is Random. Automatically generated as current time if not set.

Parameters:
randomSeed -

getRandomSeed

public long getRandomSeed()

setRecursive

public void setRecursive(boolean recursive)
If set, container folder is ignored - it gets everything (up to apparent limit of 128 items)

Parameters:
recursive -

isRecursive

public boolean isRecursive()

execute

public Container execute(long startOffset,
                         long numItems,
                         Item startItem)
Hopefully you can ignore the startItem and just specify the numeric position (1-based) you want the list to start at. You can also just re-use this ContainerRequest instance with different values to get the different "pages" of the container.

Parameters:
startOffset - use 0 if you don't want an offset - "{offset} is a positive or negative integer. When {offset} is positive, the effective location of the anchor is shifted downwards. When {offset} is negative, the location is shifted upwards."
numItems - use 0 for all items (max 128, so check your result's number of items vs. "totalitems", run again with offset 128 to get the next "page")- "{count} is a positive or negative integer. When {count} is positive, the items immediately following the anchor are described. When {count} is negative, the items immediately preceding the anchor are described. However, for the remaining discussion, assume {count} refers only to the absolute (non-negative magnitude) integer value"
startItem - may be null - "When the AnchorItem parameter is missing or ignored, the anchor is the imaginary item that precedes (or follows) the first (or last) item in the container."
Returns:

execute

public Container execute(long startOffset,
                         long numItems)