[New] LogMessage constructor with I18nMessage
This commit is contained in:
parent
f102e69fe8
commit
1eb2655669
|
@ -25,6 +25,20 @@ public class LogMessage extends I18nMessage {
|
|||
private LogMessageState state;
|
||||
private String stackTrace;
|
||||
|
||||
public LogMessage(String realm, String username, Locator locator, LogSeverity severity, LogMessageState state,
|
||||
I18nMessage i18nMessage) {
|
||||
super(i18nMessage);
|
||||
this.id = StringHelper.getUniqueId();
|
||||
// persisting in the DB only handles millisecond precision, not nano precision
|
||||
ZonedDateTime now = ZonedDateTime.now();
|
||||
this.zonedDateTime = now.withNano((now.getNano() / 1000000) * 1000000);
|
||||
this.realm = realm;
|
||||
this.username = username;
|
||||
this.locator = locator;
|
||||
this.severity = severity;
|
||||
this.state = state;
|
||||
}
|
||||
|
||||
public LogMessage(String realm, String username, Locator locator, LogSeverity severity, LogMessageState state,
|
||||
ResourceBundle bundle, String key) {
|
||||
super(bundle, key);
|
||||
|
|
|
@ -37,6 +37,13 @@ public class I18nMessage {
|
|||
this.bundle = null;
|
||||
}
|
||||
|
||||
public I18nMessage(I18nMessage i18nMessage) {
|
||||
this.key = i18nMessage.key;
|
||||
this.values = i18nMessage.values;
|
||||
this.bundle = i18nMessage.bundle;
|
||||
this.message = i18nMessage.message;
|
||||
}
|
||||
|
||||
public String getKey() {
|
||||
return this.key;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue