|
Platform SDK Java 8.5 API Reference | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.genesyslab.platform.apptemplate.lmslogger.LmsMessageConveyor
public class LmsMessageConveyor
Container of LMS events templates with correspondent LMS file(s) localization.
Usual application configuration supposes to have one instance ofLmsMessageConveyor
.LmsLoggerFactory
instance with LmsLoggerFactory.createInstance(LmsMessageConveyor)
.
It is possible to reconfigure active LmsMessageConveyor
in runtime, or
create new instance and reinitialize static LmsLoggerFactory
with it.
LmsLoggerFactory
,
LmsLoggerFactory.createInstance(LmsMessageConveyor)
,
newBuilder()
,
LmsMessageConveyor.Builder
Nested Class Summary | |
---|---|
static class |
LmsMessageConveyor.Builder
Builder for LmsMessageConveyor component. |
protected static class |
LmsMessageConveyor.UnknownLmsEvent
Internal class to represent "unknown" LMS log events. |
Field Summary | |
---|---|
static java.lang.String |
DEFAULT_MESSAGEFILE_VALUE
|
static java.lang.String |
LEVEL_REASSIGN_DISABLE_EXT_OPT
Deprecated. |
static java.lang.String |
LEVEL_REASSIGN_OPT_PREFIX
Deprecated. |
static java.lang.String |
MESSAGEFILE_PROPERTY_NAME
|
Constructor Summary | |
---|---|
|
LmsMessageConveyor()
Default constructor of LMS events conveyor. It loads common LMS events templates enumeration CommonLmsEnum ,
and available generated users' enumerations handled with the AppTemplate annotations processor. |
|
LmsMessageConveyor(java.lang.Class<E1> enum1)
Creates LMS messages conveyor by specified templates enumeration. |
|
LmsMessageConveyor(java.lang.Class<E1> enum1,
java.lang.Class<E2> enum2)
Creates LMS messages conveyor by specified templates enumerations. |
protected |
LmsMessageConveyor(java.util.List<java.lang.Class<?>> lmsEnums,
java.lang.Boolean allowUnknownEvents)
Internal constructor for the conveyor builder. |
Method Summary | |
---|---|
LmsMessageConveyor |
clone()
|
protected LmsMessageTemplate |
getDefaultEvent(int key,
LmsLogLevel level,
java.lang.Object... args)
Internal method to handle "unknown" LMS log event. |
LmsMessageTemplate |
getLmsEvent(java.lang.Integer key,
java.lang.Object... args)
Returns LMS event definition (template) from the conveyor configuration. |
LmsMessageTemplate |
getLmsEvent(LmsMessageTemplate key)
Returns LMS event definition (template) from the conveyor configuration. |
LmsMessageConveyor |
loadConfiguration(GAppLoggingOptions logOptions)
Loads and initializes conveyor configuration based on "log" and
"log-extended" sections of configuration server application object options. |
LmsMessageConveyor |
loadConfiguration(IGApplicationConfiguration appConfig)
Loads and initializes conveyor configuration based on "log" and
"log-extended" sections of configuration server application object options. |
LmsMessageConveyor |
loadConfiguration(KeyValueCollection optsLog,
KeyValueCollection optsLogExt)
Loads and initializes conveyor configuration based on "log" and
"log-extended" sections of configuration server application object options. |
LmsMessageConveyor |
loadConfiguration(java.lang.String messagefiles)
Loads content and initializes messages IDs mapping of given LMS files. |
LmsMessageConveyor |
loadConfiguration(java.lang.String messagefiles,
java.util.Map<java.lang.Integer,LmsLogLevel> levelsReassign)
Loads content and initializes messages IDs mapping of given LMS files. |
static LmsMessageConveyor.Builder |
newBuilder()
Creates and returns new instance of LmsMessageConveyor builder. |
protected LmsFileData |
readLmsFile(java.lang.String lmsfile)
Reads single LMS file. |
protected java.util.List<LmsFileData> |
readLmsFiles(java.lang.String messagefile)
Reads application LMS file(s). |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String MESSAGEFILE_PROPERTY_NAME
public static final java.lang.String DEFAULT_MESSAGEFILE_VALUE
@Deprecated public static final java.lang.String LEVEL_REASSIGN_OPT_PREFIX
GAppLogExtOptions
,
GAppLogExtOptions.LEVEL_REASSIGN_OPT_PREFIX
,
Constant Field Values@Deprecated public static final java.lang.String LEVEL_REASSIGN_DISABLE_EXT_OPT
GAppLogExtOptions
,
GAppLogExtOptions.LEVEL_REASSIGN_DISABLE_EXT_OPT
,
Constant Field ValuesConstructor Detail |
---|
public LmsMessageConveyor()
CommonLmsEnum
,
and available generated users' enumerations handled with the AppTemplate annotations processor.
newBuilder()
public LmsMessageConveyor(java.lang.Class<E1> enum1)
CommonLmsEnum
as well, it is required to create conveyor specifying
all of the enumerations classes including CommonLmsEnum.class
.LmsMessageConveyor lmsEvents =
new LmsMessageConveyor(MyAppLmsEnum.class, CommonLmsEnum.class);
enum1
- class of LmsMessageTemplate based enumeration.newBuilder()
public LmsMessageConveyor(java.lang.Class<E1> enum1, java.lang.Class<E2> enum2)
CommonLmsEnum
as well, it is required to create conveyor specifying
all of the enumerations classes including CommonLmsEnum.class
.LmsMessageConveyor lmsEvents =
new LmsMessageConveyor(MyAppLmsEnum.class, CommonLmsEnum.class);
enum1
- class of generated LmsMessageTemplate based enumeration.enum2
- other class of generated LmsMessageTemplate based enumeration.newBuilder()
protected LmsMessageConveyor(java.util.List<java.lang.Class<?>> lmsEnums, java.lang.Boolean allowUnknownEvents)
newBuilder()
Method Detail |
---|
public static LmsMessageConveyor.Builder newBuilder()
LmsMessageConveyor
builder.
LmsMessageConveyor.Builder
public LmsMessageConveyor clone()
clone
in class java.lang.Object
public LmsMessageConveyor loadConfiguration(IGApplicationConfiguration appConfig)
"log"
and
"log-extended"
sections of configuration server application object options.
appConfig
- the application configuration.
java.lang.NullPointerException
- if given application configuration is null,
or it does not contain "log" section.public LmsMessageConveyor loadConfiguration(KeyValueCollection optsLog, KeyValueCollection optsLogExt)
"log"
and
"log-extended"
sections of configuration server application object options.
optsLog
- "log" section of the application options.optsLogExt
- "log-extended" section of the application options.
public LmsMessageConveyor loadConfiguration(GAppLoggingOptions logOptions)
"log"
and
"log-extended"
sections of configuration server application object options.
logOptions
- the logging configuration options of the application options.
java.lang.NullPointerException
- if given logging options parameter is null
.public LmsMessageConveyor loadConfiguration(java.lang.String messagefiles)
messagefiles
- LMS files names separated with semicolon, empty string; or null.
loadConfiguration(String, Map)
public LmsMessageConveyor loadConfiguration(java.lang.String messagefiles, java.util.Map<java.lang.Integer,LmsLogLevel> levelsReassign)
messagefiles
- LMS file names separated with semicolon, empty string or null.levelsReassign
- map with events levels reassignments or null.
protected java.util.List<LmsFileData> readLmsFiles(java.lang.String messagefile)
messagefile
- name(s) of LMS files to read (comma separated list).
protected LmsFileData readLmsFile(java.lang.String lmsfile)
lmsfile
- the name of LMS file.
public LmsMessageTemplate getLmsEvent(LmsMessageTemplate key)
key
- the LMS event ID.
java.lang.NullPointerException
- if given key
parameter value is null.public LmsMessageTemplate getLmsEvent(java.lang.Integer key, java.lang.Object... args)
key
- the LMS event ID.args
- the LMS event parameters.
java.lang.NullPointerException
- if given key
parameter value is null.
java.lang.IllegalArgumentException
- if no such event declared and unknown events are disallowed.LmsMessageConveyor.Builder.allowUnknownMessages(Boolean)
protected LmsMessageTemplate getDefaultEvent(int key, LmsLogLevel level, java.lang.Object... args)
key
- the event ID which was not found in the conveyor configuration.level
- the LMS event level of the message.args
- the parameters of the LMS log event.
java.lang.IllegalArgumentException
- if unknown events are disallowed.LmsMessageConveyor.Builder.allowUnknownMessages(Boolean)
|
Platform SDK Java 8.5 API Reference | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |