|
||||||||||
| 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
org.fcrepo.server.journal.readerwriter.multicast.MulticastJournalWriter
public class MulticastJournalWriter
SYNCHRONIZATION NOTE: All public methods are synchronized against
JournalWriter.SYNCHRONIZER, as is the closeFile
method. This means that an asynchronous call by the timer task will not
interrupt a synchronous operation already in progress, or vice versa.
| Field Summary | |
|---|---|
static String |
CLASSNAME_PARAMETER_KEY
Required parameter for each transport: the full name of the class that implements the transport. |
static String |
CRUCIAL_PARAMETER_KEY
Required parameter for each transport, and must be set to "true" on at least one transport. |
static String |
TRANSPORT_PARAMETER_PREFIX
prefix that indicates a transport parameter - must include the separator character, if one is expected. |
| Fields inherited from class org.fcrepo.server.journal.JournalWriter |
|---|
parameters, role, server, SYNCHRONIZER |
| Constructor Summary | |
|---|---|
MulticastJournalWriter(Map<String,String> parameters,
String role,
ServerInterface server)
|
|
| Method Summary | |
|---|---|
protected void |
checkTransportParametersForValidity()
"protected" so we can mock it out in unit tests. |
protected Date |
getCurrentDate()
protected, so it can be mocked out for unit testing. |
void |
prepareToWriteJournalEntry()
Get ready to write a journal entry, insuring that we have an open file. |
void |
shutdown()
Shut it down |
void |
writeDocumentHeader(XMLEventWriter writer,
String repositoryHash,
Date currentDate)
make this public so the Transport classes can call it via TransportParent. |
void |
writeDocumentTrailer(XMLEventWriter writer)
make this public so the Transport classes can call it via TransportParent. |
void |
writeJournalEntry(CreatorJournalEntry journalEntry)
Write a journal entry. |
void |
writeJournalEntry(CreatorJournalEntry journalEntry,
XMLEventWriter writer)
make this public, so the TransportRequest class can call it. |
| Methods inherited from class org.fcrepo.server.journal.JournalWriter |
|---|
getInstance, writeDocumentHeader |
| 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 String TRANSPORT_PARAMETER_PREFIX
public static final String CLASSNAME_PARAMETER_KEY
public static final String CRUCIAL_PARAMETER_KEY
| Constructor Detail |
|---|
public MulticastJournalWriter(Map<String,String> parameters,
String role,
ServerInterface server)
throws JournalException
JournalException| Method Detail |
|---|
protected void checkTransportParametersForValidity()
throws JournalException
JournalException
public void prepareToWriteJournalEntry()
throws JournalException
Get ready to write a journal entry, insuring that we have an open file.
If we are shutdown, ignore this request. Otherwise, check if we need to shut a file down based on size limit. Then check to see whether we need to open another file. If so, we'll need a repository hash and a filename.
prepareToWriteJournalEntry in class JournalWriterJournalExceptionJournalWriter.prepareToWriteJournalEntry()
public void writeJournalEntry(CreatorJournalEntry journalEntry)
throws JournalException
Write a journal entry.
If we are shutdown, ignore this request. Otherwise, get an output stream from each Transport in turn, and write the entry. If this puts the file size over the limit, close them.
writeJournalEntry in class JournalWriterJournalExceptionJournalWriter.writeJournalEntry(org.fcrepo.server.journal.entry.CreatorJournalEntry)
public void shutdown()
throws JournalException
Shut it down
If the Transports still have files open, close them. Then stop responding to requests.
shutdown in class JournalWriterJournalExceptionJournalWriter.shutdown()protected Date getCurrentDate()
public void writeJournalEntry(CreatorJournalEntry journalEntry,
XMLEventWriter writer)
throws JournalException
writeJournalEntry in class JournalWriterJournalException
public void writeDocumentHeader(XMLEventWriter writer,
String repositoryHash,
Date currentDate)
throws JournalException
writeDocumentHeader in interface TransportParentwriteDocumentHeader in class JournalWriterJournalException
public void writeDocumentTrailer(XMLEventWriter writer)
throws JournalException
writeDocumentTrailer in interface TransportParentwriteDocumentTrailer in class JournalWriterJournalException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||