edu.iris.Fissures.seed.director
Class ExportTemplate

java.lang.Object
  extended by edu.iris.Fissures.seed.director.ExportTemplate

public class ExportTemplate
extends java.lang.Object

Template class used to arrange objects for export. ExportTemplate class accepts an ordered list of reference numbers (lookup IDs) that have been selected for inclusion in an export volume. The ExportTemplate registers itself with an Export Director, which will extract a sequence of reference numbers relating to a particular object type.

The list of reference numbers represents a subset of the current Object Container set of objects and confines the contents of the export volume to those objects referenced by this subset. No direct object references are stored here, which facilitates an additional level of indirection that the ExportDirector can use for object access optimization.

It may be necessary for the calling application to synthesize objects specifically for the export volume, storing them in the Object Container used by the Export Director and listing their reference numbers in this template. Such synthesized objects must have unique reference numbers.

Version:
11/5/2004
Author:
Robert Casey, IRIS DMC

Field Summary
protected  java.util.HashMap refNumMap
           
protected  java.util.HashMap uniqMap
           
 
Constructor Summary
ExportTemplate()
          Create Export Template instance.
 
Method Summary
 void addRefNum(long objType, int refNum)
          Add a reference number (refNum) to the template, grouped by the indicated object type, which may be contextual to a parent.
 void debugDump()
          This method is for debugging purposes only.
 int getNext(long objType)
          Return the next reference number in an ordered list that corresponds to an object of the specified type.
 long[] getObjectTypes()
          Return an array of object type numbers pertaining to our current holdings.
 void reset()
          Reset all of the indexes in the object type maps to 0, which places all getNext() reads at the starting point.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

refNumMap

protected java.util.HashMap refNumMap

uniqMap

protected java.util.HashMap uniqMap
Constructor Detail

ExportTemplate

public ExportTemplate()
Create Export Template instance. Internal mappings are initialized.

Method Detail

addRefNum

public void addRefNum(long objType,
                      int refNum)
               throws BuilderException
Add a reference number (refNum) to the template, grouped by the indicated object type, which may be contextual to a parent. Adding a value of 0 is legal and marks a 'hole' in the group sequence. objType is a long value to allow for a large value space.

Throws:
BuilderException

reset

public void reset()
           throws BuilderException
Reset all of the indexes in the object type maps to 0, which places all getNext() reads at the starting point.

Throws:
BuilderException

getNext

public int getNext(long objType)
            throws BuilderException
Return the next reference number in an ordered list that corresponds to an object of the specified type. objType is of type long due to the addition of parent context lookupID number ...so type is parent context specific (Blk 54 of parent A different than Blk 54 of parent B). Typically called by the concrete Export Director. Return -1 if there is not a reference Id to return.

Throws:
BuilderException

getObjectTypes

public long[] getObjectTypes()
Return an array of object type numbers pertaining to our current holdings.


debugDump

public void debugDump()
This method is for debugging purposes only. It dumps all of the contents of refNumMap and uniqMap to stderr.