com.penguinwerks.jodene.managers
Class DataReaderManager

java.lang.Object
  extended bycom.penguinwerks.jodene.managers.DataReaderManager

public class DataReaderManager
extends java.lang.Object

Author:
Paul Hoehne

Method Summary
 void addNetwork(DataReader reader, DataStorageTag tag, java.lang.String name)
          Add a new data reader to the vault.
 void addNetwork(DataReader reader, java.lang.String name)
          Add a data reader to the vault, using the default data storage tag.
 void cleanVault()
          Cleans the vault of all data readers.
static DataReaderManager getManager()
          Returns an instance of the data reader manager.
 DataReader getReader(java.lang.String name)
          Returns the named data reader from the vault.
 DataStorageTag getStorageTag(java.lang.String name)
          Returns the data storage tag for the named data reader.
 java.lang.String getVaultDirectory()
          Returns the base directory for the vault.
 java.util.List listReaders()
          Lists the data readers in the vault.
 void removeReader(java.lang.String name)
          Remove the data reader from the vault.
 void setVaultDirectory(java.lang.String directory)
          Set the directory path for the data reader vault.
 void updateReader(DataReader reader, DataStorageTag tag, java.lang.String name)
          Update the given data reader and the data storage tag.
 void updateReader(DataReader reader, java.lang.String name)
          Update the given data reader without changing the data storage tag.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getManager

public static DataReaderManager getManager()
Returns an instance of the data reader manager.

Returns:
The data reader manager.

addNetwork

public void addNetwork(DataReader reader,
                       DataStorageTag tag,
                       java.lang.String name)
                throws java.io.IOException
Add a new data reader to the vault.

Parameters:
reader - The data reader.
tag - The storage tag for this network.
name - The name of the network.
Throws:
IOException - Thrown if there is a problem adding this network.

addNetwork

public void addNetwork(DataReader reader,
                       java.lang.String name)
                throws java.io.FileNotFoundException,
                       java.io.IOException,
                       java.lang.ClassNotFoundException
Add a data reader to the vault, using the default data storage tag.

Parameters:
reader - The data reader.
name - The name of the network.
Throws:
FileNotFoundException - Thrown if there is a problem saving the network.
IOException - Thrown if there is a porblem saving the network.
java.lang.ClassNotFoundException - Thrown if there is a problem saving the network.

cleanVault

public void cleanVault()
Cleans the vault of all data readers.


getVaultDirectory

public java.lang.String getVaultDirectory()
Returns the base directory for the vault.

Returns:
The file path to the vault.

getReader

public DataReader getReader(java.lang.String name)
                     throws java.io.IOException,
                            java.lang.ClassNotFoundException
Returns the named data reader from the vault.

Parameters:
name - The name of the data reader.
Returns:
The data reader.
Throws:
IOException - Thrown if there is a problem reading the network.
java.lang.ClassNotFoundException - Thrown if there is a problem retrieving the network.

getStorageTag

public DataStorageTag getStorageTag(java.lang.String name)
                             throws java.io.FileNotFoundException,
                                    java.io.IOException,
                                    java.lang.ClassNotFoundException
Returns the data storage tag for the named data reader.

Parameters:
name - The name of the data reader.
Returns:
The data storage tag.
Throws:
FileNotFoundException - Thrown if there is a problem reading the tag.
IOException - Thrown if there is a problem reading the tag.
java.lang.ClassNotFoundException - Thrown if there is a problem reading the tag.

listReaders

public java.util.List listReaders()
Lists the data readers in the vault.

Returns:
A list of the data readers in the vault.

removeReader

public void removeReader(java.lang.String name)
Remove the data reader from the vault.

Parameters:
name - The name of the data reader to remove.

setVaultDirectory

public void setVaultDirectory(java.lang.String directory)
Set the directory path for the data reader vault.

Parameters:
directory - The file path to the data reader vault.

updateReader

public void updateReader(DataReader reader,
                         java.lang.String name)
                  throws java.io.FileNotFoundException,
                         java.io.IOException,
                         java.lang.ClassNotFoundException
Update the given data reader without changing the data storage tag.

Parameters:
reader - The data reader configuration.
name - The name of the data reader to update.
Throws:
FileNotFoundException - Thrown if there is a problem saving the network.
IOException - Thrown if there is a problem saving the network.
java.lang.ClassNotFoundException - Thrown if there is a problem saving the network.

updateReader

public void updateReader(DataReader reader,
                         DataStorageTag tag,
                         java.lang.String name)
                  throws java.io.IOException
Update the given data reader and the data storage tag.

Parameters:
reader - The data reader configuration.
tag - The storage tag to update.
name - The name of the network.
Throws:
IOException - Thrown if there is an error updating the network.