Journaler
class implements the Management
interface, and adds functionality to each of the methods of that interface before delegating the calls to another Management instance.
ManagementDelegate
, and the Journaler
requires a module that implements that interface to use as its delegate.
Management
interface, and its implementing class, followed by an excerpt from fedora.fcfg, showing how the module is configured (without Journaling).
<module role="fedora.server.management.Management"
class="fedora.server.management.DefaultManagement">
</module>
Journaler
module, followed by another excerpt from fedora.fcfg with both Journaler
and Management
modules. Notice how the Journaler
class implements the Management
module interface, while the DefaultManagement
class has moved to implement ManagementDelegate
.
<module role="fedora.server.management.Management"
class="fedora.server.journal.Journaler">
</module>
<module role="fedora.server.management.ManagementDelegate"
class="fedora.server.management.DefaultManagement">
</module>
Management
module changes slightly when it is acting as a delegate for the Journaler
module. This is accomplished by adding a "recovery" namespace to the Context
object that is passed to the methods of the Management
module.
Journaler
stores information in the recovery namespace of the Context
. This information is needed in addition to the arguments and return value of the API method called, in order to fully capture the state of the repository for recovery.
Management
module will look for this additional information, and use it when executing the API method.
Journaler
records the PID, and on recovery the Management
module will assign the recorded PID to the new object, instead of generating a new PID which might be different.
Journaler
module are dynamically loaded at server startup time, based on parameter values. The storage and transport mechanisms for the Journals are controlled by these components. It is fairly simple to implement an alternative file structure for the Journal files, or to use a message-based transport instead of simple flat files.
Journaler
is controlled by a similar set of parameters, and can be extended or replaced in the same manner.
Journaler
module, or by its configurable components. See the section "Configurations in fedora.fcfg" for examples of how the options are used in fedora.fcfg
Journaler
module, and can be used with any configurable components.
Journaler
module. Optional. Default is "normal".
fedora.fcfg
shows a server that
writes Journal files to a local file system, and to two follower systems via
RMI.
<module role="fedora.server.management.Management" class="fedora.server.journal.Journaler">
<param name="journalFileSizeLimit" value="100M"/>
<param name="journalFileAgeLimit" value="1H"/>
<param name="journalWriterClassname"
value="fedora.server.journal.readerwriter.multicast.MulticastJournalWriter"/>
<param name="transport.local.classname"
value="fedora.server.journal.readerwriter.multicast.LocalDirectoryTransport"/>
<param name="transport.local.directoryPath" value="/usr/local/journals/archiveFiles"/>
<param name="transport.local.crucial" value="true"/>
<param name="transport.follow1.classname"
value="fedora.server.journal.readerwriter.multicast.rmi.RmiTransport"/>
<param name="transport.follow1.crucial" value="false"/>
<param name="transport.follow1.hostName" value="follow1.nsdl.org"/>
<param name="transport.follow1.service" value="RmiJournalReceiver"/>
<param name="transport.follow2.classname"
value="fedora.server.journal.readerwriter.multicast.rmi.RmiTransport"/>
<param name="transport.follow2.crucial" value="false"/>
<param name="transport.follow2.hostName" value="follow2.nsdl.org"/>
<param name="transport.follow2.service" value="RmiJournalReceiver"/>
</module>
Journaler
implementation, including how to configure it, what it produces, and how it operates.
Journaler
module.
<module role="fedora.server.management.Management"
class="fedora.server.journal.Journaler">
<param name="journalDirectory"
value="/usr/local/ndr-content/journals/journalFiles"/>
<param name="journalWriterClassname"
value="fedora.server.journal.readerwriter.multifile.MultiFileJournalWriter"/>
<param name="journalFileSizeLimit" value="100M" />
<param name="journalFileAgeLimit" value="1H" />
</module>
<module role="fedora.server.management.ManagementDelegate"
class="fedora.server.management.DefaultManagement">
</module>
<module role="fedora.server.management.Management"
class="fedora.server.journal.Journaler">
<param name="journalMode" value="recover"/>
<param name="journalDirectory"
value="/usr/local/ndr-content/journals/journalFiles"/>
<param name="archiveDirectory"
value="/usr/local/ndr-content/journals/archiveFiles"/>
<param name="journalReaderClassname"
value="fedora.server.journal.readerwriter.multifile.MultiFileJournalReader"/>
<param name="journalRecoveryLogClassname"
value="fedora.server.journal.recoverylog.RenamingJournalRecoveryLog"/>
<param name="recoveryLogFilename"
value="/usr/local/ndr-content/journals/journal.recovery.log"/>
</module>
<module role="fedora.server.management.ManagementDelegate"
class="fedora.server.management.DefaultManagement">
</module>
<module role="fedora.server.management.Management"
class="fedora.server.journal.Journaler">
<param name="journalMode" value="recover" />
<param name="journalDirectory"
value="/usr/local/ndr-content/journals/journalFiles"/>
<param name="archiveDirectory"
value="/usr/local/ndr-content/journals/archiveFiles"/>
<param name="journalReaderClassname"
value="fedora.server.journal.readerwriter.multifile.LockingFollowingJournalReader"/>
<param name="lockRequestedFilename"
value="/usr/local/ndr-content/journals/StopAcceptingJournals.lock"/>
<param name="lockAcceptedFilename"
value="/usr/local/ndr-content/journals/AcceptedJournalStop.lock"/>
<param name="journalRecoveryLogClassname"
value="fedora.server.journal.recoverylog.RenamingJournalRecoveryLog"/>
<param name="recoveryLogFilename"
value="/usr/local/ndr-content/journals/journal.recovery.log"/>
<param name="followPollingInterval" value="10"/>
</module>
<module role="fedora.server.management.ManagementDelegate"
class="fedora.server.management.DefaultManagement">
</module>
<?xml version="1.0" encoding="UTF-8"?>
<FedoraJournal repositoryHash="3|2,1,0" timestamp="2006-06-15T09:45:35.683-0400">
<JournalEntry method="purgeObject" timestamp="2006-06-15T09:45:35.683-0400"
clientIpAddress="127.0.0.1" loginId="fedoraAdmin">
<context>
<password>fedoraAdmin</password>
<noOp>false</noOp>
<now>2006-06-15T09:45:35.683-0400</now>
<multimap name="environment">
<multimapkey name="urn:fedora:names:fedora:2.1:environment:httpRequest:authType">
<multimapvalue>BASIC</multimapvalue>
</multimapkey>
<multimapkey name="urn:fedora:names:fedora:2.1:environment:httpRequest:serverIpAddress">
<multimapvalue>127.0.0.1</multimapvalue>
</multimapkey>
<multimapkey name="urn:fedora:names:fedora:2.1:environment:httpRequest:serverPort">
<multimapvalue>8080</multimapvalue>
</multimapkey>
<multimapkey name="urn:fedora:names:fedora:2.1:environment:httpRequest:method">
<multimapvalue>POST</multimapvalue>
</multimapkey>
<multimapkey name="urn:fedora:names:fedora:2.1:environment:httpRequest:protocol">
<multimapvalue>HTTP/1.1</multimapvalue>
</multimapkey>
</multimap>
<multimap name="subject">
<multimapkey name="fedoraRole">
<multimapvalue>administrator</multimapvalue>
</multimapkey>
<multimapkey name="urn:fedora:names:fedora:2.1:subject:loginId">
<multimapvalue>fedoraAdmin</multimapvalue>
</multimapkey>
</multimap>
<multimap name="action"></multimap>
<multimap name="resource"></multimap>
<multimap name="recovery"></multimap>
</context>
<argument name="pid" type="string">demo:99</argument>
<argument name="message" type="string">That dog's gonnna die.</argument>
<argument name="force" type="boolean">false</argument>
</JournalEntry>
</FedoraJournal>
2006-06-15T09:45:36.605-0400: Event: method='getNextPid',
file='C:\fedoraJournal20060615.134531.152Z',
entry='2006-06-15T09:45:30.167-0400'
2006-06-15T09:45:36.714-0400: Call complete:getNextPid
2006-06-15T09:45:36.605-0400: Event: method='getNextPid',
file='C:\fedoraJournal20060615.134531.152Z',
entry='2006-06-15T09:45:30.167-0400'
arguments
numPids='4'
namespace='newPIDs'
2006-06-15T09:45:36.714-0400: Call complete:getNextPid
2006-06-15T09:45:36.605-0400: Event: method='getNextPid',
file='C:\fedoraJournal20060615.134531.152Z',
entry='2006-06-15T09:45:30.167-0400'
context=fedora.server.journal.entry.JournalEntryContext
environmentAttributes
urn:fedora:names:fedora:2.1:environment:httpRequest:authType
BASIC
urn:fedora:names:fedora:2.1:environment:httpRequest:security
urn:fedora:names:fedora:2.1:environment:httpRequest:security-insecure
urn:fedora:names:fedora:2.1:environment:currentDate
2006-06-15Z
urn:fedora:names:fedora:2.1:environment:currentTime
13:45:30.027Z
urn:fedora:names:fedora:2.1:environment:httpRequest:sessionStatus
invalid
urn:fedora:names:fedora:2.1:environment:httpRequest:scheme
http
urn:fedora:names:fedora:2.1:environment:httpRequest:clientIpAddress
127.0.0.1
urn:fedora:names:fedora:2.1:environment:httpRequest:contentLength
576
urn:fedora:names:fedora:2.1:environment:httpRequest:clientFqdn
localhost
urn:fedora:names:fedora:2.1:environment:httpRequest:serverIpAddress
127.0.0.1
urn:fedora:names:fedora:2.1:environment:httpRequest:serverPort
8080
urn:fedora:names:fedora:2.1:environment:currentDateTime
2006-06-15T13:45:30.027Z
urn:fedora:names:fedora:2.1:environment:httpRequest:messageProtocol
urn:fedora:names:fedora:2.1:environment:httpRequest:messageProtocol-soap
urn:fedora:names:fedora:2.1:environment:httpRequest:method
POST
urn:fedora:names:fedora:2.1:environment:httpRequest:contentType
text/xml; charset=utf-8
urn:fedora:names:fedora:2.1:environment:httpRequest:serverFqdn
localhost
urn:fedora:names:fedora:2.1:environment:httpRequest:protocol
HTTP/1.1
subjectAttributes
fedoraRole
administrator
urn:fedora:names:fedora:2.1:subject:loginId
fedoraAdmin
actionAttributes
resourceAttributes
urn:fedora:names:fedora:2.1:resource:object:nPids
4
recoveryAttributes
info:fedora/fedora-system:def/recovery#pidList
newPIDs:1
newPIDs:2
newPIDs:3
newPIDs:4
password='*********'
noOp=false
now=false
arguments
numPids='4'
namespace='newPIDs'
2006-06-15T09:45:36.714-0400: Call complete:getNextPid