public class LogDetailsDispatcher extends java.lang.Object implements ACSRemoteErrorListener, ACSRemoteLogListener, ACSRemoteRawLogListener, ACSLogConnectionListener, java.lang.Runnable
There are 2 types of listeners to perform different kind of statistics:
NUMBER_LISTENERS_INTERVAL
time interval
| Modifier and Type | Field and Description |
|---|---|
static int |
NUMBER_LISTENERS_INTERVAL
The interval of time (seconds) to notify listener of numbers
|
| Constructor and Description |
|---|
LogDetailsDispatcher()
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
void |
acsLogConnConnecting()
Notify that an attempt to connect to ACS NC is in progress
|
void |
acsLogConnDisconnected()
Notify that the connection with ACS NC has been disconnected
It can happen as a consequence of an error as well as as consequence
of a request
|
void |
acsLogConnEstablished()
Notify that the connection with ACS NC has been established
|
void |
acsLogConnLost()
Notify that the connection with ACS NC has been lost
(it means an error or something abnormal).
|
void |
acsLogConnSuspended()
Notify that the service is supended
(i.e.
|
void |
acsLogsDelay()
Notify that for some internal reason the service is not able
to follow the flow of the incoming logs and is queueing
the messages to be inserted later, when flow will decrease and
enough CPU time is availbale
This method is not executed each time a log is queued but
once when the situation begins.
|
void |
addNumsListener(LogNumbersListener listener)
Add a
LogNumbersListener listener to be notified about incoming
logs statistics |
void |
close()
Close the engine and free the resources
|
void |
errorReceived(java.lang.String xml)
The method is executed when an error happened building a log
from a string.
|
void |
logEntryReceived(ILogEntry logEntry)
The method is executed when a new log arrives from the NC
|
void |
removeNumsListener(LogNumbersListener listener)
Remove a
LogNumbersListener listener. |
void |
reportStatus(java.lang.String status)
Send a report string with the current status of the connection
|
void |
run()
The thread notifying listeners about statistics
|
void |
xmlEntryReceived(java.lang.String xmlLogString)
The method is executed when a new XML string arrives from the NC
|
public static final int NUMBER_LISTENERS_INTERVAL
LogNumbersListener,
Constant Field Valuespublic LogDetailsDispatcher()
throws LogEngineException
LogEngineException - In case of error instantiating the enginepublic void errorReceived(java.lang.String xml)
ACSRemoteErrorListenererrorReceived in interface ACSRemoteErrorListenerxml - That string that caused the errorpublic void xmlEntryReceived(java.lang.String xmlLogString)
ACSRemoteRawLogListenerxmlEntryReceived in interface ACSRemoteRawLogListenerxmlLogString - The new XML string just read from the NCpublic void acsLogConnConnecting()
ACSLogConnectionListeneracsLogConnConnecting in interface ACSLogConnectionListenerpublic void acsLogConnDisconnected()
ACSLogConnectionListeneracsLogConnDisconnected in interface ACSLogConnectionListenerpublic void acsLogConnEstablished()
ACSLogConnectionListeneracsLogConnEstablished in interface ACSLogConnectionListenerpublic void acsLogConnLost()
ACSLogConnectionListeneracsLogConnLost in interface ACSLogConnectionListenerpublic void acsLogConnSuspended()
ACSLogConnectionListeneracsLogConnSuspended in interface ACSLogConnectionListenerpublic void acsLogsDelay()
ACSLogConnectionListeneracsLogsDelay in interface ACSLogConnectionListenerpublic void reportStatus(java.lang.String status)
ACSLogConnectionListenerreportStatus in interface ACSLogConnectionListenerstatus - The status stringpublic void logEntryReceived(ILogEntry logEntry)
ACSRemoteLogListenerlogEntryReceived in interface ACSRemoteLogListenerlogEntry - The new log just read from the NCpublic void addNumsListener(LogNumbersListener listener)
LogNumbersListener listener to be notified about incoming
logs statisticslistener - The listener to addpublic void removeNumsListener(LogNumbersListener listener)
LogNumbersListener listener.listener - The listener to removepublic void run()
run in interface java.lang.Runnablepublic void close()