|
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.commons.log.AbstractLogEnabled
com.genesyslab.platform.logging.utilities.MessageTemplateManager
public final class MessageTemplateManager
This class loads and parses *.lms files. Note: This class is not synchronized, so the caller is responsible for the access synchronization.
Constructor Summary | |
---|---|
MessageTemplateManager()
|
Method Summary | |
---|---|
void |
add(LmsMessageTemplate template)
Adds the LmsMessageTemplate . |
void |
clear()
Clears the loaded Headers and Log Templates. |
boolean |
containsTemplate(int id)
Checks if the template with specified ID loaded. |
java.util.Collection<LmsFileHeader> |
getHeaders()
The read-only collection of headers of loaded lms files. |
java.util.List<LmsFileHeader> |
getLoadedHeadersInternal()
|
LmsFileLoadPolicy |
getLoadPolicy()
See LmsFileLoadPolicy which defines the load
policy of manager. |
LmsMessageTemplate |
getTemplate(int id)
Gets the LmsMessageTemplate with the specified
ID. |
java.util.Collection<LmsMessageTemplate> |
getTemplates()
The read-only collection of loaded LmsMessageTemplate . |
void |
loadFrom(java.io.BufferedReader reader)
Loads the *.lms file header and log templates from the "reader". |
void |
loadFrom(java.lang.String fileName)
Parses the *.lms file into the Header and Message templates. |
protected void |
onEnableLogging(ILogger logger)
Called when a new logger is provided by user. |
LmsMessageTemplate |
remove(int id)
Removes the value with the specified ID. |
void |
setLoadPolicy(LmsFileLoadPolicy policy)
|
Methods inherited from class com.genesyslab.platform.commons.log.AbstractLogEnabled |
---|
enableLogging, getLogger |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MessageTemplateManager()
Method Detail |
---|
protected void onEnableLogging(ILogger logger)
onEnableLogging
in class AbstractLogEnabled
logger
- the new loggerpublic LmsFileLoadPolicy getLoadPolicy()
LmsFileLoadPolicy
which defines the load
policy of manager.
java.lang.NullPointerException
- thrown if attempt to set null as value detectedpublic void setLoadPolicy(LmsFileLoadPolicy policy)
public java.util.Collection<LmsFileHeader> getHeaders()
public java.util.List<LmsFileHeader> getLoadedHeadersInternal()
public java.util.Collection<LmsMessageTemplate> getTemplates()
LmsMessageTemplate
.
public void loadFrom(java.lang.String fileName) throws LoggerException
fileName
- the file to load
LoggerException
public void loadFrom(java.io.BufferedReader reader) throws LoggerException
reader
- the source to be read
LoggerException
- If reader does not contain the valid lms file header (should
be first string).public LmsMessageTemplate getTemplate(int id)
LmsMessageTemplate
with the specified
ID.
id
- The ID of LmsMessageTemplate
.
LmsMessageTemplate
.
java.lang.IllegalArgumentException
- If the LmsMessageTemplate
with
specified ID not found.public boolean containsTemplate(int id)
id
- ID of template to check.
public void add(LmsMessageTemplate template)
LmsMessageTemplate
.
template
- Template to add.
java.lang.IllegalArgumentException
- Thrown if template with specified ID was already loaded.public LmsMessageTemplate remove(int id)
id
- ID of template to remove.
public void clear()
|
Platform SDK Java 8.5 API Reference | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |