public class LogMessageImpl extends Object implements LogMessage
Constructor and Description |
---|
LogMessageImpl(Audit audit,
PersistentResource record,
Optional<ChangeSpec> changeSpec)
Construct a log message from an Audit annotation and the record that was updated in some way.
|
LogMessageImpl(String template,
int code)
Construct a log message that does not involve any templating.
|
LogMessageImpl(String template,
PersistentResource record,
String[] expressions,
int code,
Optional<ChangeSpec> changeSpec)
Construct a log message.
|
Modifier and Type | Method and Description |
---|---|
String |
getMessage()
Gets message.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getChangeSpec, getOperationCode, getPersistentResource, getUser
public LogMessageImpl(String template, int code)
template
- - The unsubstituted text that will be logged.code
- - The operation code of the auditable action.public LogMessageImpl(Audit audit, PersistentResource record, Optional<ChangeSpec> changeSpec) throws InvalidSyntaxException
audit
- - The annotation containing the type of operation (UPDATE, DELETE, CREATE)record
- - The modified recordchangeSpec
- - Change spec of modified elements (if logging object change). empty otherwiseInvalidSyntaxException
- if the Audit annotation has invalid syntax.public LogMessageImpl(String template, PersistentResource record, String[] expressions, int code, Optional<ChangeSpec> changeSpec) throws InvalidSyntaxException
template
- - The log message template that requires variable substitution.record
- - The record which will serve as the data to substitute.expressions
- - A set of UEL expressions that reference record.code
- - The operation code of the auditable action.changeSpec
- - the change spec that we want to logInvalidSyntaxException
- the invalid syntax exceptionpublic String getMessage()
LogMessage
getMessage
in interface LogMessage
Copyright © 2015–2021 Yahoo! Inc.. All rights reserved.