|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objecteteg.sinon.dao.xml.XMLCollectorDAO
public class XMLCollectorDAO
Implementation of CollectorDAO that read and write instances of
Collector in XML files. These files must have .xml
suffix. Files are written and read from the directory passed to
XMLCollectorDAO().
| Field Summary | |
|---|---|
static java.lang.String |
COLLECTOR_SUFFIX
Sufixo que todos os arquivox XML descrevendo coletores devem usar. |
static java.lang.String |
DEFAULT_COLLECTOR_DIRECTORY
Collector directory used when no one is specified. |
| Constructor Summary | |
|---|---|
XMLCollectorDAO()
No-arg constructor. |
|
XMLCollectorDAO(java.io.File collectorDirectory)
Constructor that receives a File pointing to the
configurations file directory. |
|
| Method Summary | |
|---|---|
java.util.List |
findAll()
Returns all available collectors. |
java.io.File |
getCollectorDirectory()
Returns the collectors file directory. |
Collector |
load(java.lang.String id)
Loads the collector which id is id. |
void |
store(Collector collector)
Writes collector in
collectorDirectory + "/" + collector.getId() + ".xml". |
void |
store(Collector collector,
java.io.File destination)
Writes collector in a given destination
directory. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String COLLECTOR_SUFFIX
public static final java.lang.String DEFAULT_COLLECTOR_DIRECTORY
collectors.
| Constructor Detail |
|---|
public XMLCollectorDAO(java.io.File collectorDirectory)
File pointing to the
configurations file directory.
collectorDirectory - a java.io.File.
java.lang.IllegalArgumentException - if collectorDirectory is
null.public XMLCollectorDAO()
| Method Detail |
|---|
public java.io.File getCollectorDirectory()
File.
public void store(Collector collector)
throws SinonException
collector in
collectorDirectory + "/" + collector.getId() + ".xml".
store in interface CollectorDAOcollector - a Collector instance.
SinonException - if some error ocurrs.
public void store(Collector collector,
java.io.File destination)
throws SinonException
collector in a given destination
directory.
collector - a Collector instance.destination - a java.util.File.
SinonException - if some error ocurrs.
public java.util.List findAll()
throws java.lang.Exception
findAll in interface CollectorDAOjava.util.List.
java.lang.Exception - if some error ocurrs.
public Collector load(java.lang.String id)
throws SinonException
id.
load in interface CollectorDAOid - a String containing the collector id.
Collector instance.
SinonException - if some error ocurrs.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||