|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.fcrepo.server.journal.xmlhelpers.AbstractXmlWriter
org.fcrepo.server.journal.JournalWriter
public abstract class JournalWriter
The abstract base for all JournalWriter classes.
Each child class is responsible for providing an XMLEventWriter that will receive the JournalEntry tag. This class will format a JournalEntry object into XML and add it to the XMLEventWriter.
Note that the writing of an entry is necessarily a three step process, consisting of
prepareToWriteJournalEntry(),writeJournalEntry(CreatorJournalEntry)CreatorJournalEntry, and these values must be written to the
journal.
| Field Summary | |
|---|---|
protected Map<String,String> |
parameters
|
protected String |
role
|
protected ServerInterface |
server
|
static Object |
SYNCHRONIZER
A single object on which to synchronize all writing operations. |
| Constructor Summary | |
|---|---|
protected |
JournalWriter(Map<String,String> parameters,
String role,
ServerInterface server)
Concrete sub-classes must implement this constructor. |
| Method Summary | |
|---|---|
static JournalWriter |
getInstance(Map<String,String> parameters,
String role,
ServerInterface server)
Create an instance of the proper JournalWriter child class, as determined by the server parameters. |
abstract void |
prepareToWriteJournalEntry()
Concrete sub-classes should insure that a message transport is ready, and call {@link #writeDocumentHeader(XMLEventWriter) if needed. |
abstract void |
shutdown()
|
protected void |
writeDocumentHeader(XMLEventWriter writer)
Subclasses should call this method to initialize a new Journal file. |
protected void |
writeDocumentHeader(XMLEventWriter writer,
String repositoryHash,
Date currentDate)
Subclasses should call this method to initialize a new Journal file, if they already know the repository hash and the current date. |
protected void |
writeDocumentTrailer(XMLEventWriter writer)
Subclasses should call this method to close a Journal file. |
abstract void |
writeJournalEntry(CreatorJournalEntry journalEntry)
Concrete sub-classes should provide an XMLEventWriter, and call #writeJournalEntry(XMLEventWriter), after which, they should
probably flush the XMLEventWriter. |
protected void |
writeJournalEntry(CreatorJournalEntry journalEntry,
XMLEventWriter writer)
Format a JournalEntry object and write a JournalEntry tag to the journal. |
| Methods inherited from class org.fcrepo.server.journal.xmlhelpers.AbstractXmlWriter |
|---|
putAttribute, putAttributeIfNotNull, putCharacters, putEndDocument, putEndTag, putStartDocument, putStartTag |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final Object SYNCHRONIZER
protected final String role
protected final Map<String,String> parameters
protected final ServerInterface server
| Constructor Detail |
|---|
protected JournalWriter(Map<String,String> parameters,
String role,
ServerInterface server)
| Method Detail |
|---|
public static JournalWriter getInstance(Map<String,String> parameters,
String role,
ServerInterface server)
throws JournalException
JournalException
public abstract void shutdown()
throws JournalException
JournalException
public abstract void prepareToWriteJournalEntry()
throws JournalException
JournalException
public abstract void writeJournalEntry(CreatorJournalEntry journalEntry)
throws JournalException
#writeJournalEntry(XMLEventWriter), after which, they should
probably flush the XMLEventWriter. This method is called after the
Management method is invoked, since the Management method may modify the
context object in the journal entry.
JournalException
protected void writeDocumentHeader(XMLEventWriter writer)
throws JournalException
JournalException
protected void writeDocumentHeader(XMLEventWriter writer,
String repositoryHash,
Date currentDate)
throws JournalException
JournalException
protected void writeDocumentTrailer(XMLEventWriter writer)
throws JournalException
JournalException
protected void writeJournalEntry(CreatorJournalEntry journalEntry,
XMLEventWriter writer)
throws JournalException
JournalException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||