|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.iris.Fissures.seed.container.SeedObjectContainer
public class SeedObjectContainer
Builder Container for Seed Blockettes.
Container that implements the interface of ObjectContainer and provides a facility for storing, retrieving, and cross-referencing blockettes. This container provides the implementer with the ability to ingest multiple SEED volumes and integrate the information in single location for merging and integration purposes. From this container, new SEED volumes (and even other formats) can be generated by creational classes, using it as a temporary database to retrieve all needed information. Note that this container is not meant for permanent storage, but the use of the disk persistence option allows you to re-load a previous container state from disk if so flagged.
Makes use of disk cache persistence in order to accomodate a large volume of Blockettes while minimizing memory consumption. Blockette's retrieved are placed in a Least Recently Used queue of some preconfigured size to accomodate repeated access of certain blockettes. All contents are persisted to disk as they are created and updated, and removed items are promtly eliminted. If so flagged, a new Container can access a previous session's persisted objects for immediate use.
Blockettes are stored in a parent/child heirarchy with regards to stations and channels, since their references to each other are positional in the SEED volume. Child blockettes are placed within a parent blockette to maintain this association. Stations are parents to Channels, and Channels are parents to response information. If this container has been flagged to indicate that a filter is being used by the Builder it is connected to, then the case of running into child blockettes with no parent, which had been filtered out, is treated as a normal condition, where the child blockettes are simply 'orphaned' and not stored in the container. If a filter is not being used, then this is considered an error condition, and an exception is thrown.
Constructor Summary | |
---|---|
SeedObjectContainer()
Default constructor that does not implement serialization |
|
SeedObjectContainer(java.lang.String cacheDir)
Contructor specifying a directory for disk cache persistence. |
|
SeedObjectContainer(java.lang.String cacheDir,
boolean loadPrevious)
Constructor specifying a directory for disk cache persistence and bootstrap recall of previous session from disk if so flagged. |
|
SeedObjectContainer(java.lang.String cacheDir,
int capacity)
Constructor specifying a directory for disk cache persistence. |
|
SeedObjectContainer(java.lang.String cacheDir,
int capacity,
boolean loadPrevious)
Constructor specifying a directory for disk cache persistence and bootstrap recall of previous session from disk if so flagged. |
Method Summary | |
---|---|
void |
add(java.lang.Object addThis)
Add a Blockette object to the container. |
void |
clear()
Clear all contents in this container and start fresh. |
int |
findMatchingDictionary(java.lang.String blocketteString)
Return an integer that represents the lookupId of the last added dictionary blockette to this container matching the provided blockette delimited string. |
void |
flushMemory()
Flush all Blockettes from the memory cache. |
java.lang.Object |
get(int lookupId)
Return blockette with the listed lookup ID. |
java.lang.String |
getCachePath()
return the path to the base of the cache tree |
static int |
getCategoryNumber(int lookupId)
Return the category number encoded in the lookupId. |
Blockette |
getDictionaryBlockette(Blockette blk,
int fieldNum)
Get the referenced dictionary blockette. |
Blockette |
getDictionaryBlockette(Blockette blk,
int fieldNum,
int fieldIndex)
Get the referenced dictionary blockette. |
Blockette |
getDictionaryBlockette(Blockette blk,
int fieldNum,
int fieldIndex,
int listIndex)
Get the referenced dictionary blockette. |
int |
getFiltered()
Return the current filter rank value assigned to the container. |
java.lang.String |
getMetaEncoding(Blockette dataBlk)
Return a string word representing the encoding type of data represented in the indicated data blockette. |
int |
getNewId(Blockette blk,
boolean useRefNum)
return an integer that represents a new lookupID number to be assigned to a new blockette, just before it is placed into the add() call. |
int |
getNewId(int category)
DEPRECATED -- does not handle predictive numbering for dictionary blockettes Return a new lookupID number that is an incrementation of the previous one added to this container. |
java.lang.Object |
getNext()
Get the next BlocketteDecorator in the established iterator, else return null. |
Blockette |
getTopParent(int lookupId)
Get the top level parent Blockette for the indicated lookupID. |
int |
getVolumeNumber()
Return the current volume number this container is set to |
static int |
getVolumeNumberFromId(int lookupId)
utility to determine the volume number based on the provided lookupId. |
java.lang.Object |
improvedGet(int lookupId)
Deprecated. |
boolean |
improvedLocate(int lookupId)
Deprecated. |
boolean |
isCaching()
return true if this container is caching objects to disk persistence. |
boolean |
isUsingSerialization()
pseudonym for isCaching() -- deprecated |
int |
iterate()
Set up an iterator for all parent Blockettes. |
int |
iterate(int catNum)
Set up an iterator for all parent Blockettes of a specific category number, all volumes. |
int |
iterate(int volNum,
int catNum)
Set up Blockette interation. |
int |
iterate(java.util.Vector stations,
java.util.Vector channels,
int catNum)
Set up an iterator for *Parent* Blockettes matching stations and channels. |
boolean |
locate(int lookupId)
Find the blockette with the listed lookup ID and set a handle to it in locateRegister. |
protected Blockette |
lookup(int lookupId)
Find the blockette in the hashmap that matches the blockette ID. |
java.lang.Object |
remove(int lookupId)
Delete the blockette object matching to lookupId from the container Return that object upon removal. |
void |
setFiltered(Blockette blk)
Notify the container that the indicated blockette has been filtered. |
void |
setFiltered(int value)
Tell the container to assume that the indicated filter rank has been filtered. |
void |
setParent(int lookupId)
Establish parent/child heirarchy for given lookup ID in the rank lattice. |
void |
setVolumeNumber(int volNum)
force the current volume number of this container to be the indicated value -- this number can get changed via the add() command, which polls for the current volume. |
java.lang.String |
toString()
Identify ourselves through this method. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public SeedObjectContainer()
public SeedObjectContainer(java.lang.String cacheDir, int capacity, boolean loadPrevious) throws java.lang.Exception
cacheDir
- the base directory where the disk cache will residecapacity
- the maximum number of items to be cached in memory at one timeloadPrevious
- true if previous disk persistence cache should be referenced.
java.lang.Exception
public SeedObjectContainer(java.lang.String cacheDir, int capacity) throws java.lang.Exception
cacheDir
- the base directory where the disk cache will residecapacity
- the maximum number of items to be cached in memory at one time
java.lang.Exception
public SeedObjectContainer(java.lang.String cacheDir, boolean loadPrevious) throws java.lang.Exception
cacheDir
- the base directory where the disk cache will resideloadPrevious
- true if previous disk persistence cache should be referenced.
java.lang.Exception
public SeedObjectContainer(java.lang.String cacheDir) throws java.lang.Exception
cacheDir
- the base directory where the disk cache will reside
java.lang.Exception
Method Detail |
---|
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String getCachePath()
public void clear() throws ContainerException
ContainerException
public void add(java.lang.Object addThis) throws java.lang.Exception
add
in interface ObjectContainer
java.lang.Exception
public Blockette getDictionaryBlockette(Blockette blk, int fieldNum) throws java.lang.Exception
java.lang.Exception
public Blockette getDictionaryBlockette(Blockette blk, int fieldNum, int fieldIndex) throws java.lang.Exception
java.lang.Exception
public Blockette getDictionaryBlockette(Blockette blk, int fieldNum, int fieldIndex, int listIndex) throws java.lang.Exception
java.lang.Exception
public java.lang.Object get(int lookupId) throws ContainerException
get
in interface ObjectContainer
ContainerException
public java.lang.Object remove(int lookupId) throws ContainerException
remove
in interface ObjectContainer
ContainerException
public boolean locate(int lookupId) throws ContainerException
locate
in interface ObjectContainer
ContainerException
public int iterate(int volNum, int catNum)
iterate
in interface ObjectContainer
public int iterate(int catNum)
iterate
in interface ObjectContainer
public int iterate()
iterate
in interface ObjectContainer
public int iterate(java.util.Vector stations, java.util.Vector channels, int catNum) throws ContainerException
ContainerException
public java.lang.Object getNext() throws ContainerException
getNext
in interface ObjectContainer
ContainerException
public void setFiltered(Blockette blk) throws java.lang.Exception
java.lang.Exception
public void setFiltered(int value)
public int getFiltered()
public void flushMemory()
public java.lang.String getMetaEncoding(Blockette dataBlk) throws java.lang.Exception
java.lang.Exception
public void setParent(int lookupId) throws ContainerException
lookupId
- the parent we want to establish in the rank lattice
ContainerException
public Blockette getTopParent(int lookupId)
public boolean improvedLocate(int lookupId) throws ContainerException
ContainerException
public java.lang.Object improvedGet(int lookupId) throws ContainerException
ContainerException
public int getNewId(Blockette blk, boolean useRefNum) throws java.lang.Exception
java.lang.Exception
public int getNewId(int category) throws java.lang.Exception
java.lang.Exception
public int findMatchingDictionary(java.lang.String blocketteString)
public boolean isCaching()
public boolean isUsingSerialization()
public void setVolumeNumber(int volNum)
volNum
- volume number to assign to this containerpublic int getVolumeNumber()
public static int getVolumeNumberFromId(int lookupId)
lookupId
-
public static int getCategoryNumber(int lookupId)
protected Blockette lookup(int lookupId)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |