wt.replication.unit
Class Manifest

java.lang.Object
  extended bywt.replication.unit.Manifest
All Implemented Interfaces:
Serializable

public class Manifest
extends Object
implements Serializable

This class contains data and functionality for a WTUnit manifest file. A manifest file contains a unit descriptions, as well a unit metadat and content files.

Supported API: false

Extendable: false

See Also:
Serialized Form

Nested Class Summary
(package private)  class Manifest.DescriptorEnumerator
           
(package private)  class Manifest.UnitContentEnumerator
           
 
Field Summary
private static String CLASSNAME
           
private static String CODEBASE
           
static String DOCTYPE_TAG
           
static String MANIFEST_DIR
           
static String MANIFEST_FILENAME
           
private  int numContentEl
           
private  int numMetadataEl
           
private static WTProperties properties
           
private static String RESOURCE
           
private static String[] shifts
           
static String UFID
           
private  WTUnit unit
           
static String UNIT_CONTENT
           
static String UNIT_CONTENT_URL
           
static String UNIT_CREATED
           
static String UNIT_CREATED_AT
           
static String UNIT_CREATED_BY
           
static String UNIT_CREATOR
           
static String UNIT_DESCRIPTION
           
static String UNIT_MANIFEST
           
static String UNIT_METADATA
           
static String UNIT_METADATA_URL
           
static String UNIT_NAME
           
static String UNIT_NUMBER
           
static String UNIT_TAG
           
static String UNIT_TEAMTEMPLATE_DOMAIN
           
static String UNIT_TEAMTEMPLATE_NAME
           
static String UNIT_VERSION
           
private static boolean VERBOSE
           
 
Constructor Summary
Manifest(WTUnit unit)
          This constructor initializes the "unit" instance variables.
 
Method Summary
 long addContent(ContentItem ci)
          A caller passes a contentItem instance.
 long addContent(ContentItem ci, String fileName)
           
 Streamed addMetadata(InputStream is, String descriptor)
          This method creates an ApplicationData for this class's WTUnit, sets the ApplicationData attributes and updates this unit's content.
 void createManifestDomTree()
          This method queries the unit for ApplicationData corresponding to ContentRoleType.SECONDARY, which include both content files and metadata, and creates the manifest DOM tree, based on the results of the query.
 void deleteManifestFromUnit()
          This method crreates a QueryResult object representing the result of searching the unit for a manifest object.
 void deleteManifestFromUnit(QueryResult qr)
          This method gets a QueryResult object representing the result of searching the unit for a manifest object.
 void fillUnitSecondaryFields()
          This metod parses the manifest object, retrived its secondary fields and sets their values to the unit.
 ApplicationData getApplicationDataByStreamId(long streamId)
           
 Streamed getContentItem(long streamId)
          This method queries the unit for ApplicationData corresponding to the description "content".
private  QueryResult getManifestQueryResult()
          This method returns a QueryResult object that is the result of searching the unit for a manifest, which is the unit's primary content.
 Streamed getMetadata(String descriptor)
          This method queries the unit for ApplicationData corresponding to the description "metadata".
 Enumeration getMetadataList()
          this method queries the unit for ApplicacationData , corresponding to the description "metadata", and returns the DescriptorEnumerator for the results of this query.
private  String getShift(int level)
          Returns an indentation blank string based on the the level of indentation.
 Enumeration getUnitContentList()
          This method queries the unit for ApplicationData corresponding to the description "metadata" and description "content".
 void writeDomTreeToManifest(Node node, PrintWriter out, int level, boolean indented)
          This method writes the DOM tree created by the createManifestDomTree() method to the manifest PrintWriter output stream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RESOURCE

private static final String RESOURCE
See Also:
Constant Field Values

CLASSNAME

private static final String CLASSNAME

unit

private WTUnit unit

DOCTYPE_TAG

public static final String DOCTYPE_TAG
See Also:
Constant Field Values

UNIT_TAG

public static final String UNIT_TAG
See Also:
Constant Field Values

UNIT_NAME

public static final String UNIT_NAME
See Also:
Constant Field Values

UNIT_NUMBER

public static final String UNIT_NUMBER
See Also:
Constant Field Values

UNIT_CREATED

public static final String UNIT_CREATED
See Also:
Constant Field Values

UNIT_CREATED_AT

public static final String UNIT_CREATED_AT
See Also:
Constant Field Values

UNIT_CREATED_BY

public static final String UNIT_CREATED_BY
See Also:
Constant Field Values

UNIT_METADATA

public static final String UNIT_METADATA
See Also:
Constant Field Values

UNIT_METADATA_URL

public static final String UNIT_METADATA_URL
See Also:
Constant Field Values

UNIT_CREATOR

public static final String UNIT_CREATOR
See Also:
Constant Field Values

UNIT_VERSION

public static final String UNIT_VERSION
See Also:
Constant Field Values

UNIT_CONTENT

public static final String UNIT_CONTENT
See Also:
Constant Field Values

UNIT_CONTENT_URL

public static final String UNIT_CONTENT_URL
See Also:
Constant Field Values

UNIT_MANIFEST

public static final String UNIT_MANIFEST
See Also:
Constant Field Values

UNIT_DESCRIPTION

public static final String UNIT_DESCRIPTION
See Also:
Constant Field Values

UNIT_TEAMTEMPLATE_NAME

public static final String UNIT_TEAMTEMPLATE_NAME
See Also:
Constant Field Values

UNIT_TEAMTEMPLATE_DOMAIN

public static final String UNIT_TEAMTEMPLATE_DOMAIN
See Also:
Constant Field Values

MANIFEST_FILENAME

public static final String MANIFEST_FILENAME
See Also:
Constant Field Values

UFID

public static final String UFID
See Also:
Constant Field Values

MANIFEST_DIR

public static final String MANIFEST_DIR

shifts

private static final String[] shifts

numMetadataEl

private int numMetadataEl

numContentEl

private int numContentEl

properties

private static WTProperties properties

CODEBASE

private static String CODEBASE

VERBOSE

private static boolean VERBOSE
Constructor Detail

Manifest

public Manifest(WTUnit unit)
This constructor initializes the "unit" instance variables.

Supported API: false

Parameters:
unit -
Method Detail

addContent

public long addContent(ContentItem ci)
                throws WTException,
                       WTPropertyVetoException
A caller passes a contentItem instance. Its ApplicationData stream data and file size are assigned to the Manifest' unit's ApplicationData. The latter ApplicationData and the HolderToContent link are stored through PersistenceHelper.manager.store(). The method returns the stream data id.

Supported API: false

Parameters:
ci -
Returns:
long
Throws:
WTException
WTPropertyVetoException

addMetadata

public Streamed addMetadata(InputStream is,
                            String descriptor)
                     throws WTException,
                            PropertyVetoException,
                            FileNotFoundException,
                            IOException
This method creates an ApplicationData for this class's WTUnit, sets the ApplicationData attributes and updates this unit's content. The method returns the streeam data for this application data.

Supported API: false

Parameters:
is -
descriptor -
Returns:
Streamed
Throws:
WTException
PropertyVetoException
FileNotFoundException
IOException

getContentItem

public Streamed getContentItem(long streamId)
                        throws WTException
This method queries the unit for ApplicationData corresponding to the description "content". Then it finds the content corresponding to the passed streamId. It returns the stream object for the content file.

Supported API: false

Parameters:
streamId -
Returns:
Streamed
Throws:
WTException

getMetadataList

public Enumeration getMetadataList()
                            throws WTException
this method queries the unit for ApplicacationData , corresponding to the description "metadata", and returns the DescriptorEnumerator for the results of this query.

Supported API: false

Returns:
Enumeration
Throws:
WTException

createManifestDomTree

public void createManifestDomTree()
                           throws WTException,
                                  PropertyVetoException,
                                  FileNotFoundException,
                                  IOException
This method queries the unit for ApplicationData corresponding to ContentRoleType.SECONDARY, which include both content files and metadata, and creates the manifest DOM tree, based on the results of the query.

Supported API: false

Throws:
WTException
PropertyVetoException
FileNotFoundException
IOException

writeDomTreeToManifest

public void writeDomTreeToManifest(Node node,
                                   PrintWriter out,
                                   int level,
                                   boolean indented)
This method writes the DOM tree created by the createManifestDomTree() method to the manifest PrintWriter output stream.

Supported API: false

Parameters:
node -
out -
level -
indented -

getMetadata

public Streamed getMetadata(String descriptor)
                     throws WTException
This method queries the unit for ApplicationData corresponding to the description "metadata". The query results are search for metadata corresponding to the passed value of the "descriptor" argument. The method returns the Streamed object for the matching metadata.

Supported API: false

Parameters:
descriptor -
Returns:
Streamed
Throws:
WTException

getUnitContentList

public Enumeration getUnitContentList()
                               throws WTException
This method queries the unit for ApplicationData corresponding to the description "metadata" and description "content". It returns the unit content enumeration for for both "metadata" and "content".

Supported API: false

Returns:
Enumeration
Throws:
WTException

getShift

private String getShift(int level)
Returns an indentation blank string based on the the level of indentation.

Parameters:
level -
Returns:
String

getManifestQueryResult

private QueryResult getManifestQueryResult()
                                    throws WTException
This method returns a QueryResult object that is the result of searching the unit for a manifest, which is the unit's primary content.

Returns:
QueryResult
Throws:
WTException

deleteManifestFromUnit

public void deleteManifestFromUnit(QueryResult qr)
                            throws WTException
This method gets a QueryResult object representing the result of searching the unit for a manifest object. Then it deletes the manifest object.

Supported API: false

Parameters:
qr -
Throws:
WTException

deleteManifestFromUnit

public void deleteManifestFromUnit()
                            throws WTException
This method crreates a QueryResult object representing the result of searching the unit for a manifest object. Then it deletes the manifest object.

Supported API: false

Throws:
WTException

fillUnitSecondaryFields

public void fillUnitSecondaryFields()
                             throws WTException,
                                    WTPropertyVetoException
This metod parses the manifest object, retrived its secondary fields and sets their values to the unit.

Supported API: false

Throws:
WTException
WTPropertyVetoException

getApplicationDataByStreamId

public ApplicationData getApplicationDataByStreamId(long streamId)
                                             throws WTException
Throws:
WTException

addContent

public long addContent(ContentItem ci,
                       String fileName)
                throws WTException,
                       WTPropertyVetoException
Throws:
WTException
WTPropertyVetoException