public class LCEngine extends java.lang.Object implements Filterable
logRetrieval that,
in turn, send them to the registered listeners.
Audience and filtering are implemented by ACSLogRetrieval.| Constructor and Description |
|---|
LCEngine()
LCEngine constructor
|
LCEngine(boolean autoReconn)
LCEngine constructor.
|
LCEngine(boolean autoReconn,
FiltersVector filters)
LCEngine constructor.
|
LCEngine(boolean autoReconn,
FiltersVector filters,
TimestampedStringQueueFileHandler cacheFileHandler)
LCEngine constructor. |
LCEngine(boolean autoReconn,
TimestampedStringQueueFileHandler cacheFileHandler)
LCEngine constructor. |
LCEngine(TimestampedStringQueueFileHandler cacheFileHandler)
Build the
LCEngine by setting an handler for
the files of the cache. |
| Modifier and Type | Method and Description |
|---|---|
void |
addFilter(Filter filter)
Add a new filters to the vector of filters to apply to the incoming logs
before sending to the listeners.
|
void |
addLogConnectionListener(ACSLogConnectionListener listener)
Add a connection listener
|
void |
addLogErrorListener(ACSRemoteErrorListener listener)
Add an error listener
|
void |
addLogListener(ACSRemoteLogListener listener)
Add a log listener
|
void |
addRawLogListener(ACSRemoteRawLogListener listener)
Add a RAW log listener
|
void |
clearFilters()
Remove all the filters.
|
void |
close(boolean sync)
Close the engine and free the resources.
|
void |
connect()
LCEngine starts an attempt to connect to the remote system.
|
void |
connect(org.omg.CORBA.ORB theORB,
Manager mgr)
LCEngine starts an attempt to connect to the remote system.
|
void |
connect(java.lang.String newAccessType)
LCEngine starts an attempt to connect to the remote system.
|
void |
disconnect()
Disconnect the engine
|
void |
disconnect(boolean sync)
LCEngine starts an attempt to disconnect to the remote system.
|
void |
enableAutoReconnection(boolean autoRec)
Enable/disable the auto reconnection
|
void |
enableDynamicDiscarding(int threshold,
int damping,
int interval)
Enable or disable the dynamic change of the discard level
depending on the amount of available memory.
|
java.lang.String |
getAccessType()
Insert the method's description here.
|
LogTypeHelper |
getActualDiscardLevel()
Return the discard level in use by the engine.
|
int |
getActualInputRate() |
int |
getActualOutputRate() |
Audience |
getAudience() |
LogTypeHelper |
getDiscardLevel()
Return the discard level set by the user.
|
FiltersVector |
getFilters()
Return the filters to filter the incoming logs before sending to the
listeners
|
java.lang.String |
getFiltersString() |
int |
getMaxInputRate() |
int |
getMaxOutputRate() |
boolean |
isConnected() |
boolean |
isFiltered()
Return
true if the engine is applying filters. |
void |
setAccessType(java.lang.String newAccessType)
Insert the method's description here.
|
void |
setAudience(Audience newAudience)
Set the audience for the engine.
|
void |
setConnectionParams(org.omg.CORBA.ORB theORB,
Manager mgr)
Set the connection params fro this
|
void |
setDiscardLevel(LogTypeHelper newDiscardLevel)
Set the discard level for filtering.
|
void |
setFilters(FiltersVector newFilters,
boolean append)
Set the filters to apply before sending the log entries to the listener.
|
void |
setMaxInputRate(int rate)
Set the max number of logs per second to accept from the
RemoteAccess, typically the logging NC. |
void |
setMaxOutputRate(int rate)
Set the max number of logs to publish to listeners.
|
void |
setPaused(boolean pause)
Pause/unpause the publishing of logs to the listener The difference
between pause and suspended is that when the engine is suspended all the
received logs are discarded.
|
void |
setSupended(boolean suspended)
Suspend resume the notification of logs NOTE: When suspended the log
discarded are lost forever
|
int |
waitingLogsNumber()
Return the number of logs waiting in the cache i.e.
|
public LCEngine()
throws LogEngineException
LogEngineException#LCEngine(boolean, FiltersVector, ILogQueueFileHandler)public LCEngine(boolean autoReconn)
throws LogEngineException
autoReconn - If true the engine automatically reconnectsLogEngineException#LCEngine(boolean, FiltersVector, ILogQueueFileHandler)public LCEngine(boolean autoReconn,
FiltersVector filters)
throws LogEngineException
This constructor allows to define a set of filters to apply to incoming logs: only the logs passing the filters are sent to the listeners.
autoReconn - If true the engine automatically reconnectsfilters - The filters to apply to the incoming logs.
filters can be null or empty.LogEngineException#LCEngine(boolean, FiltersVector, ILogQueueFileHandler)public LCEngine(TimestampedStringQueueFileHandler cacheFileHandler) throws LogEngineException
LCEngine by setting an handler for
the files of the cache.cacheFileHandler - The handler of the files of the cacheLogEngineExceptionILogQueueFileHandler,
#LCEngine(boolean, FiltersVector, ILogQueueFileHandler)public LCEngine(boolean autoReconn,
TimestampedStringQueueFileHandler cacheFileHandler)
throws LogEngineException
LCEngine constructor.autoReconn - If true the engine automatically reconnectscacheFileHandler - The handler of the files of the cacheLogEngineExceptionILogQueueFileHandler,
#LCEngine(boolean, FiltersVector, ILogQueueFileHandler)public LCEngine(boolean autoReconn,
FiltersVector filters,
TimestampedStringQueueFileHandler cacheFileHandler)
throws LogEngineException
LCEngine constructor.
This constructor allows to define a set of filters to apply to incoming logs: only the logs passing the filters are sent to the listeners.
autoReconn - If true the engine automatically reconnectsfilters - The filters to apply to the incoming logs.
filters can also be either null or empty.cacheFileHandler - The handler of the files of the cache or
null if do not want to register for notificationLogEngineExceptionILogQueueFileHandlerpublic void connect()
LCEngine.AccessSetterpublic void connect(java.lang.String newAccessType)
accessTyp - The access typeLCEngine.AccessSetterpublic void connect(org.omg.CORBA.ORB theORB,
Manager mgr)
theORB - The ORB (can be null)mgr - The reference to the manager (can be null)LCEngine.AccessSetterpublic void close(boolean sync)
sync - If true the closing is made in a synchronized way.public void disconnect()
public void disconnect(boolean sync)
sync - If true the closing is made in a synchronized way.LCEngine.AccessSetterpublic java.lang.String getAccessType()
public void setAccessType(java.lang.String newAccessType)
newAccessType - java.lang.Stringpublic void setConnectionParams(org.omg.CORBA.ORB theORB,
Manager mgr)
theORB - The ORB. It can't be null if the manager is not nullmgr - The reference to the Managerpublic boolean isConnected()
public void setSupended(boolean suspended)
suspended - If true suspend the notification of the logspublic void enableAutoReconnection(boolean autoRec)
autoRec - If true the engine tries to reconnect automaticallypublic void setPaused(boolean pause)
pause - public void addLogListener(ACSRemoteLogListener listener)
listener - The listener to addACSRemoteLogListenerpublic void addRawLogListener(ACSRemoteRawLogListener listener)
listener - The listener to addACSRemoteRawLogListenerpublic void addLogErrorListener(ACSRemoteErrorListener listener)
listener - The error listener to addACSRemoteErrorListenerpublic void addLogConnectionListener(ACSLogConnectionListener listener)
listener - The listener to addACSLogConnectionListenerpublic void setFilters(FiltersVector newFilters, boolean append)
setFilters in interface FilterablenewFilters - The new filters to apply If null or empty the
filtering is disabledappend - If true the new filters are added to the
existing filters (if any).public void setDiscardLevel(LogTypeHelper newDiscardLevel)
Note: if the dynamic change of the discard
level depending on the memory usage has been
activated, then the discard level effectively
used by the engine might be greater then
newDiscardlevel.
newDiscardlevel - The discard level
Not applied if null.ACSLogRetrieval}public void setAudience(Audience newAudience)
newAudience - The not nullaudiencepublic void addFilter(Filter filter)
The filter is applied as active.
filter - The not null filter to addpublic void clearFilters()
public FiltersVector getFilters()
getFilters in interface Filterablenull)public LogTypeHelper getActualDiscardLevel()
Note: the actual discard level may or may not be the same discard level set by the user. They differ if the user enabled the dynamic change of the discard level depending on the available memory .
null)ACSLogRetrieval.getDiscardlevel()}, {@link LogMatcher.getActualDiscardLevel()},
getDiscardLevel()public LogTypeHelper getDiscardLevel()
Note: the discard level in use can be different if the dynamic change of the discard level depending on the available memory in the engine has been activated.
null)ACSLogRetrieval.getDiscardlevel()}, {@link LogMatcher.getActualDiscardLevel()},
getActualDiscardLevel()public Audience getAudience()
null)public boolean isFiltered()
true if the engine is applying filters.
If a filter is in place but not enabled then it is ignored.true if there are filters active in the engineFiltersVector.hasActiveFilters()public java.lang.String getFiltersString()
FiltersVector.getFilterString()public void setMaxInputRate(int rate)
RemoteAccess, typically the logging NC.
All the logs arriving after the max number has been reached will be discarded, regardless of their level.
See ACSLogRetrieval for further details.
rate - The max number of logs per second to acceptpublic int getMaxInputRate()
ACSLogRetrieval for further details.public int getActualInputRate()
ACSLogRetrieval for further details.public void setMaxOutputRate(int rate)
When this number has been reached, no more logs are sent to the listeners.
See ACSLogRetrieval for further details.
rate - The max number of logs per second to acceptpublic int getMaxOutputRate()
ACSLogRetrieval for further details.public int getActualOutputRate()
ACSLogRetrieval for further details.public int waitingLogsNumber()
RemoteAcess and not yet sent to
the listeners.public void enableDynamicDiscarding(int threshold,
int damping,
int interval)
threashold - The discard level is increased when the available
memory for the application is less then the threshold
(in bytes).
Integer.MAX_VALUE disables this feature.damping - The damping factor is used to avoid oscillations
The discard level is decreased when the free memory is
is greater then the threshold plus the dumping.interval - The time (in seconds) between two adjustments of the
dynamic discard level.
interval defaults to 10.ACSLogRetrieval}