org.fcrepo.server.journal.entry
Class JournalEntry

java.lang.Object
  extended by org.fcrepo.server.journal.entry.JournalEntry
Direct Known Subclasses:
ConsumerJournalEntry, CreatorJournalEntry

public abstract class JournalEntry
extends Object

An abstract base class for the JournalEntry classes.

At this level, a JournalEntry is a method name, a method adapter, and a map of arguments.

NOTE: when finished with the JournalEntry, call close(). This will release any temporary files associated with the entry.

Author:
Jim Blake

Constructor Summary
protected JournalEntry(String methodName, JournalEntryContext context)
           
 
Method Summary
 void addArgument(String key, boolean value)
           
 void addArgument(String key, InputStream stream)
          If handed an InputStream as an argument, copy it to a temp file and store that File in the arguments map instead.
 void addArgument(String key, int value)
           
 void addArgument(String key, Object value)
           
 void close()
          This should be called when usage of the object is complete, to clean up any temporary files that were created for the journal entry to use.
 Map<String,Object> getArgumentsMap()
           
 boolean getBooleanArgument(String name)
           
 JournalEntryContext getContext()
           
 Date getDateArgument(String name)
           
 int getIntegerArgument(String name)
           
 ManagementMethod getMethod()
           
 String getMethodName()
           
 InputStream getStreamArgument(String name)
          If they ask for an InputStream argument, get the File from the arguments map and create an InputStream on that file.
 String getStringArgument(String name)
           
 String[] getStringArrayArgument(String name)
           
 void setRecoveryValue(String attribute, String value)
           
 void setRecoveryValues(String attribute, String[] values)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JournalEntry

protected JournalEntry(String methodName,
                       JournalEntryContext context)
Method Detail

getContext

public JournalEntryContext getContext()

getMethod

public ManagementMethod getMethod()

getMethodName

public String getMethodName()

getArgumentsMap

public Map<String,Object> getArgumentsMap()

addArgument

public void addArgument(String key,
                        boolean value)

addArgument

public void addArgument(String key,
                        int value)

addArgument

public void addArgument(String key,
                        Object value)

addArgument

public void addArgument(String key,
                        InputStream stream)
                 throws JournalException
If handed an InputStream as an argument, copy it to a temp file and store that File in the arguments map instead. If the InputStream is null, store null in the arguments map.

Throws:
JournalException

setRecoveryValue

public void setRecoveryValue(String attribute,
                             String value)

setRecoveryValues

public void setRecoveryValues(String attribute,
                              String[] values)

getIntegerArgument

public int getIntegerArgument(String name)

getBooleanArgument

public boolean getBooleanArgument(String name)

getStringArgument

public String getStringArgument(String name)

getDateArgument

public Date getDateArgument(String name)

getStringArrayArgument

public String[] getStringArrayArgument(String name)

getStreamArgument

public InputStream getStreamArgument(String name)
                              throws JournalException
If they ask for an InputStream argument, get the File from the arguments map and create an InputStream on that file. If the value from the map is null, return null.

Throws:
JournalException

close

public void close()
This should be called when usage of the object is complete, to clean up any temporary files that were created for the journal entry to use.



Copyright © 2012 DuraSpace. All Rights Reserved.