Milyn-Smooks Version 0.4

org.milyn.cdr.cdrar
Class CDRArchive

java.lang.Object
  extended byorg.milyn.cdr.cdrar.CDRArchive

public final class CDRArchive
extends java.lang.Object

Represents an actual Transformation Unit Archive (cdrar) and its entries (JarEntry).

A CDRAR is a container for transformation resource and/or the archive definitions.

Author:
tfennelly

Constructor Summary
CDRArchive(java.lang.String name)
          Public Constructor.
CDRArchive(java.lang.String name, java.util.jar.JarInputStream cdrarStream)
          Constructor.
 
Method Summary
 void addArchiveDef(CDRConfig archiveDef)
          Add and CDRConfig instance to this CDRArchive instance.
 void addEntries(CDRArchiveEntry[] cdrarEntries)
          Add the supplied CDRArchiveEntry instances to this CDRArchive.
 CDRDef[] getCDRDefs(UAContext deviceContext)
          Get all CDRDef entries for the specified device from this CDRArchive archive.
 java.util.Enumeration getEntries()
          Get an enumeration of all the CDRArchiveEntry objects in this CDRArchive.
protected  CDRArchiveEntry getEntry(java.lang.String name)
          Get the CDRArchiveEntry for the given name.
 java.lang.String getName()
          Get the name of this cdrar file.
protected  int size()
          Get the number of entries in the cdrar.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CDRArchive

public CDRArchive(java.lang.String name,
                  java.util.jar.JarInputStream cdrarStream)
           throws InvalidCDRArchiveException,
                  java.io.IOException
Constructor.

Parameters:
cdrarStream - Archive stream.
Throws:
java.io.IOException - Error reading the Archive.
InvalidCDRArchiveException

CDRArchive

public CDRArchive(java.lang.String name)
Public Constructor.

Creates a new, but empty, CDRArchive instance. Populate the instance using the addEntries(CDRArchiveEntry[]) and addArchiveDef(CDRConfig) methods.

Parameters:
name - The Archive name.
Method Detail

addEntries

public void addEntries(CDRArchiveEntry[] cdrarEntries)
Add the supplied CDRArchiveEntry instances to this CDRArchive.

Parameters:
cdrarEntries - Entries to be added.

addArchiveDef

public void addArchiveDef(CDRConfig archiveDef)
Add and CDRConfig instance to this CDRArchive instance.

Parameters:
archiveDef - The CDRConfig instance to be added.

getName

public java.lang.String getName()
Get the name of this cdrar file.

Returns:
The cdrar file name.

getEntry

protected CDRArchiveEntry getEntry(java.lang.String name)
Get the CDRArchiveEntry for the given name.

Parameters:
name - The CDRArchiveEntry name.
Returns:
The CDRArchiveEntry for the given name, or null if no such entry exists.

getEntries

public java.util.Enumeration getEntries()
Get an enumeration of all the CDRArchiveEntry objects in this CDRArchive.

Returns:
An enumeration of all the CDRArchiveEntry objects in this CDRArchive.

getCDRDefs

public CDRDef[] getCDRDefs(UAContext deviceContext)
Get all CDRDef entries for the specified device from this CDRArchive archive.

Parameters:
deviceContext - The device.
Returns:
All CDRDef entries for the specified device.

size

protected int size()
Get the number of entries in the cdrar.

Returns:
The number of entries in the cdrar.

Milyn-Smooks Version 0.4