public class WriteLogfile extends AbstractImplementation implements ExecutableIF
Writes information, depending on the previous processing status. Logged messagees
are automatically prefixed with timestamp and status.
According each status, an individual message can be defined, also a generic message for
the missing messages.
The logfile may be replaced or appended. Additionally it may be deleted anyway and is
recreated only if the appropriate message is written. So the existence of the file may indicate
the occurance of the status.
#init()} for argument description.
Modifier and Type | Class and Description |
---|---|
static class |
WriteLogfile.Option
An enumenation for the implemented append, replace and clear options.
|
arguments, ctx, descriptor, NEW_LINE
Constructor and Description |
---|
WriteLogfile()
Default constructor, used by MoMa in addition with #init().
|
WriteLogfile(java.lang.String f)
Initializes with minimum reqirements (Exposed for use within other rules).
|
WriteLogfile(java.lang.String f,
WriteLogfile.Option o)
Initializes with an additional reqirement to handle the file (Exposed for use within other rules).
|
Modifier and Type | Method and Description |
---|---|
void |
execute()
Writes either the success or the fail message.
|
void |
init()
Reads and verifies all arguments and sets values for:
logfile, generalMessage, successMessage, stoppedMessage,
rejectedMessage, failedMessage and isAppend.
|
void |
terminate()
Clears class variables.
|
boolean |
write()
Writes a default timestamp and status, no message.
|
boolean |
write(java.lang.String message)
Writes a default timestamp and status, plus message.
|
addAttributesToNameValueUnitArray, addAttributeToNameValueUnitArray, addStringValueToNameValueUnitArray, checkDirectoy, checkDirectoy, checkDirectoy, checkFile, checkFile, checkFile, checkIntValue, checkStringValue, compressNvuArray, createMessageFromPropertyFile, createMessageFromPropertyFile, createMessageFromPropertyFile, createTsUnionFromObject, deleteRowWithAttributes, getArguments, getContext, getDescriptor, getListFromProperty, getMandatoryProperty, getMandatoryProperty, getMandatoryPropertyAsInt, getMandatoryPropertyAsList, getMandatoryPropertyWithRuleException, getNvuArrayFromMap, getNvuArrayFromMap, getNvuObjectWithName, getNvuObjectWithName, getNvuObjectWithName, getOdsCacheFromProperty, getOptioanlPropertyAsInt, getOptionalProperty, getOptionalProperty, getOptionalProperty, getOptionalProperty, getOptionalPropertyAsBoolean, getOptionalPropertyAsBoolean, getOptionalPropertyAsBoolean, getOptionalPropertyAsList, makeUpperCaseKeyword, removeAttributeFromNameValueUnitArray, removeAttributeFromNameValueUnitArray, setArguments, setContext, setDescriptor
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getContext, getDescriptor, setArguments, setContext, setDescriptor
public WriteLogfile()
public WriteLogfile(java.lang.String f)
No speciic message defined, so only an entry with timestamp and status will be appended later.
f
- - fully qualified filenamepublic WriteLogfile(java.lang.String f, WriteLogfile.Option o)
No speciic message defined, so only an entry with timestamp and status will be appended later.
f
- - String, fully qualified filenameo
- - Option, handles an existing logfilepublic boolean write()
public boolean write(java.lang.String message)
message
- - String, message to be written.public void init() throws InitializationFailedException
init
in interface ImplementationIF
init
in class AbstractImplementation
InitializationFailedException
- When one of the requiError.ArgumentMissingred arguments does not exist.com.highqsoft.xsd.ImplentationIF#init()
public void execute() throws ExecutableException
execute
in interface ExecutableIF
ExecutableException
- In case of execution error.ExecutableIF.execute()
public void terminate() throws TerminationException
terminate
in interface ExecutableIF
TerminationException
- In case of termination error.