|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.cysols.iodef.transport.IodefXMLFileAcceptor
public abstract class IodefXMLFileAcceptor
This class provides IODEF message reception API from network through the various ways. By using the
specified IodefDocumentWriter instance (given by its constructor), it stores an incident to the data repository
like Database. After obtaining IODEF message, for example, by Email, FTP, HTTP or other ways, it is possible
to use this class and to call received method. The received method tries to store the received
iodef document into the data repository which depends on the specified IodefDocumentWriter instance.
This is an abstract class. So it is necessary to implement the concrete sub class. When received method is called, this super class calls "notifySuccess" method or "notifyFailure" method. The former is called if the IODEF Document is stored correctly. The latter is called if failed. Only the over-ridden methods are needed in the concrete sub class. Logging, Notification or something will be implemented in the methods.
| Field Summary | |
|---|---|
protected IODEFElementCreator |
creator
Instance variable of IODEF ElementCreator. |
protected IodefDocumentWriter |
writer
Instance variable of IodefDocumentWriter, which is used for storring the received IODEF Document |
| Constructor Summary | |
|---|---|
IodefXMLFileAcceptor(IodefDocumentWriter writer,
IODEFElementCreator creator)
Default Constructor, which is called by its sub class. |
|
| Method Summary | |
|---|---|
IODEFDocument |
loadIODEFDocument(File xmlFile)
Returns an array of IODEF Document instances from the specified File instance. |
IODEFDocument |
loadIODEFDocument(String xmlFilePath)
Returns an array of IODEF Document instances from the specified IODEF xml file. |
void |
notifyFailure(IODEFDocument iodef,
Throwable e)
Called when the IODEF Document could not be stored after received method is called. |
void |
notifySuccess(IODEFDocument iodef)
Called when the IODEF Document is stored correctly after received method is called. |
void |
received(File xmlFile)
Call this IODEF xml file is obtained from network. |
void |
received(IODEFDocument iodef)
Call this after an IODEF Document is obtained from network by the respective ways. |
void |
received(IODEFDocument[] iodefs)
Some IODEF Documents are stored at the same time. |
void |
received(String xmlFilePath)
Call this IODEF xml file is obtained from network. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected IodefDocumentWriter writer
protected IODEFElementCreator creator
| Constructor Detail |
|---|
public IodefXMLFileAcceptor(IodefDocumentWriter writer,
IODEFElementCreator creator)
writer - concrete instance of IodefDocumentWriter. The type of repository in which IODEF Document are stored depends
on the instance.| Method Detail |
|---|
public void notifySuccess(IODEFDocument iodef)
iodef - the stored IODEF document instance.
public void notifyFailure(IODEFDocument iodef,
Throwable e)
iodef - IODEF Document instance not to be stored.e - the cause of failure to storepublic void received(IODEFDocument iodef)
iodef - IODEF Document instance to be stored.public void received(IODEFDocument[] iodefs)
iodefs - an array of IODEF Document instances to be stored.
public void received(String xmlFilePath)
throws FileNotFoundException,
XMLReaderException
xmlFilePath - the file path of IODEF xml file
FileNotFoundException - The specfied xml file is not found.
XMLReaderException - Unable to read the IODEF Document from the specified file.
public void received(File xmlFile)
throws FileNotFoundException,
XMLReaderException
xmlFile - the File instance of IODEF xml file
FileNotFoundException - The specfied xml file is not found.
XMLReaderException - Unable to read the IODEF Documents from the specified file.
public IODEFDocument loadIODEFDocument(String xmlFilePath)
throws FileNotFoundException,
XMLReaderException
xmlFilePath - the file path of IODEF xml file
FileNotFoundException - The specfied xml file is not found.
XMLReaderException - Unable to read the IODEF Documents from the specified file.
public IODEFDocument loadIODEFDocument(File xmlFile)
throws FileNotFoundException,
XMLReaderException
xmlFile - the File instance of IODEF xml file
FileNotFoundException - The specfied xml file is not found.
XMLReaderException - Unable to read the IODEF Documents from the specified file.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||