jimm.twice.syndicator
Class ProtoOffers

java.lang.Object
  extended byjimm.twice.syndicator.ProtoOffers

public class ProtoOffers
extends java.lang.Object

This class represents the prototypical subscriptions that are offered to subscribers. It knows how to load the prototypical instance descriptions from an XML file and generate content for each subscription.

Author:
Jim Menard, jimm@io.com

Field Summary
protected static java.lang.String DATE_URL_STRING
           
protected static java.lang.String DT_SUFFIX
           
protected static java.lang.String LOGGER_PREFIX
           
protected static java.lang.String TIME_URL_STRING
           
protected static java.lang.String XML_FILE_PROPERTY
           
protected static java.lang.String XML_NEWS_PROPERTY
           
 
Constructor Summary
ProtoOffers()
           
 
Method Summary
static OfferType find(java.lang.String identifier)
          Returns the prototype subscription offer with the specified identifier.
protected static PackageType generateItems(SubscriptionType subscription, java.lang.String currentState)
           
static void load()
          Loads all offers.
static int numOffers()
          For testing.
static java.util.Iterator offers()
          Returns an iterator over the list of available offers.
static java.util.Iterator pushOffers()
          Returns an iterator over the list of available push offers.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TIME_URL_STRING

protected static final java.lang.String TIME_URL_STRING

DATE_URL_STRING

protected static final java.lang.String DATE_URL_STRING

DT_SUFFIX

protected static final java.lang.String DT_SUFFIX
See Also:
Constant Field Values

XML_FILE_PROPERTY

protected static final java.lang.String XML_FILE_PROPERTY
See Also:
Constant Field Values

XML_NEWS_PROPERTY

protected static final java.lang.String XML_NEWS_PROPERTY
See Also:
Constant Field Values

LOGGER_PREFIX

protected static final java.lang.String LOGGER_PREFIX
See Also:
Constant Field Values
Constructor Detail

ProtoOffers

public ProtoOffers()
Method Detail

offers

public static java.util.Iterator offers()
                                 throws StatusCode
Returns an iterator over the list of available offers.

Returns:
an iterator over the list of available offers
Throws:
StatusCode

pushOffers

public static java.util.Iterator pushOffers()
                                     throws StatusCode
Returns an iterator over the list of available push offers.

Returns:
an iterator over the list of available push offers
Throws:
StatusCode

numOffers

public static int numOffers()
For testing.


find

public static OfferType find(java.lang.String identifier)
                      throws StatusCode
Returns the prototype subscription offer with the specified identifier. Returns null if not found.

Parameters:
identifier - the subscription offer id
Returns:
the offer or null if not found
Throws:
StatusCode

load

public static void load()
                 throws StatusCode
Loads all offers.

Throws:
StatusCode

generateItems

protected static PackageType generateItems(SubscriptionType subscription,
                                           java.lang.String currentState)
                                    throws StatusCode
Throws:
StatusCode