jimm.twice.syndicator
Class FileSubscriptionBuilder

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

public class FileSubscriptionBuilder
extends java.lang.Object

A file subscription builder creates ice-item and ice-item-ref tags for subscriptions that deliver the contents of a directory.

Author:
Jim Menard, jimm@io.com

Field Summary
protected  java.util.ArrayList addList
           
protected  java.util.ArrayList curFileInfoList
           
protected  long currModTime
           
protected  java.lang.String domain
           
protected  int inlineOrRef
           
protected static java.lang.String LOGGER_PREFIX
           
protected  long maxModTime
           
protected  java.util.ArrayList oldFileInfoList
           
protected  java.util.ArrayList removeList
           
protected  Syndicator syndicator
           
protected  java.io.File topLevelDir
           
protected  java.io.File xmlFile
           
 
Method Summary
 CmPackage generateItems(int inlineOrRef, java.lang.String urlPrefix, long currModTime)
          Generates a content-metadata package of items based on the current-state.
 long getMaxModTime()
           
 boolean hasUpdates()
           
 void loadMetadata()
           
 void setDomain(java.lang.String d)
           
 void setXmlFile(java.io.File f)
           
 void storeMetadata()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOGGER_PREFIX

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

syndicator

protected Syndicator syndicator

topLevelDir

protected java.io.File topLevelDir

maxModTime

protected long maxModTime

inlineOrRef

protected int inlineOrRef

currModTime

protected long currModTime

domain

protected java.lang.String domain

addList

protected java.util.ArrayList addList

removeList

protected java.util.ArrayList removeList

oldFileInfoList

protected java.util.ArrayList oldFileInfoList

curFileInfoList

protected java.util.ArrayList curFileInfoList

xmlFile

protected java.io.File xmlFile
Method Detail

setXmlFile

public void setXmlFile(java.io.File f)

setDomain

public void setDomain(java.lang.String d)

hasUpdates

public boolean hasUpdates()

getMaxModTime

public long getMaxModTime()

generateItems

public CmPackage generateItems(int inlineOrRef,
                               java.lang.String urlPrefix,
                               long currModTime)
                        throws java.io.IOException
Generates a content-metadata package of items based on the current-state. Returns null if no updates are available

Parameters:
urlPrefix - URL prefix for item references
Returns:
content-metadata package of items
Throws:
java.io.IOException

loadMetadata

public void loadMetadata()

storeMetadata

public void storeMetadata()