com.cysols.iodef
Class IodefXMLDBWriter

java.lang.Object
  extended by com.cysols.iodef.IodefXMLDBWriter
All Implemented Interfaces:
DocumentWriter, IodefDocumentWriter

public class IodefXMLDBWriter
extends Object
implements DocumentWriter, IodefDocumentWriter

Write the XML docuemnt to XML database.

Author:
cysol

Constructor Summary
IodefXMLDBWriter()
           
 
Method Summary
 void validWrite(IODEFDocument iodef)
          Validates the iodef document and writes with XML document included iodef document to xml database if validation is passed.
 void validWrite(String key, IODEFDocument iodef)
          Validates the iodef document and writes with XML document included iodef document to xml database if validation is passed.
 void write(Document doc)
          Inserts the specified iodef document to database.
 void write(IODEFDocument iodef)
          Inserts the specified iodef document to database with null key.
 void write(String key, Document doc)
          Inserts the specified iodef document to database with key.
 void write(String key, IODEFDocument iodef)
          Inserts the specified iodef document to database with key.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IodefXMLDBWriter

public IodefXMLDBWriter()
Method Detail

write

public void write(Document doc)
           throws XMLWriteException
Inserts the specified iodef document to database. DB System specifies key.

Specified by:
write in interface DocumentWriter
Parameters:
doc - an iodef document
Throws:
XMLWriteException - if writing goes wrong

write

public void write(String key,
                  Document doc)
           throws XMLWriteException
Inserts the specified iodef document to database with key. DB System specifies key if key isn't specified.

Specified by:
write in interface DocumentWriter
Parameters:
doc - an iodef document
key - key name using by insert to database.
Throws:
XMLWriteException - if writing goes wrong

write

public void write(IODEFDocument iodef)
           throws XMLWriteException
Inserts the specified iodef document to database with null key.

Specified by:
write in interface IodefDocumentWriter
Parameters:
iodef - an iodef document
Throws:
XMLWriteException - if writing goes wrong

write

public void write(String key,
                  IODEFDocument iodef)
           throws XMLWriteException
Inserts the specified iodef document to database with key. DB System specifies key if key isn't specified.

Specified by:
write in interface IodefDocumentWriter
Parameters:
iodef - an iodef document
key - key name using by insert to database.
Throws:
XMLWriteException - if writing goes wrong.

validWrite

public void validWrite(IODEFDocument iodef)
                throws XMLValidationError,
                       XMLWriteException
Validates the iodef document and writes with XML document included iodef document to xml database if validation is passed.

Specified by:
validWrite in interface IodefDocumentWriter
Parameters:
iodef - an iodef document
Throws:
XMLValidationError - if validation is not passed
XMLWriteException - if writing goes wrong

validWrite

public void validWrite(String key,
                       IODEFDocument iodef)
                throws XMLValidationError,
                       XMLWriteException
Validates the iodef document and writes with XML document included iodef document to xml database if validation is passed.

Specified by:
validWrite in interface IodefDocumentWriter
Parameters:
key - key name using by insert to database.
iodef - an iodef document
Throws:
XMLValidationError - if validation is not passed
XMLWriteException - if writing goes wrong