

Classes | |
| class | FailedLogRecords |
Public Member Functions | |
| int | getBufferSize () |
| void | setBufferSize (int newBuffSize) |
Public Attributes | |
| final boolean | useAcsLogServiceExtensions = Boolean.getBoolean(USE_ACS_LOGSERVICE_EXTENSIONS_PROPERTYNAME) |
Static Public Attributes | |
| static final String | USE_ACS_LOGSERVICE_EXTENSIONS_PROPERTYNAME = "alma.acs.logging.useAcsLogServiceExtensions" |
Protected Member Functions | |
| void | writeRecords (Any[] anyLogRecordsArray) throws UserException |
| void | writeRecords (XmlLogRecord[] remoteLogRecords) |
Package Functions | |
| RemoteLogDispatcher (ORB orb, AcsLogServiceOperations logService, AcsLogFormatter logFormatter) | |
| FailedLogRecords | sendLogRecords (LogRecord[] logRecords) |
Private Attributes | |
| int | bufferSize = 30 |
| final ORB | orb |
| final AcsLogServiceOperations | logService |
| final AcsLogFormatter | logFormatter |
| LogRecordComparator | timestampLogRecordComparator |
| final boolean | DEBUG = Boolean.getBoolean("alma.acs.logging.verbose") |
Sends log records to the remote CORBA log service. No caching or threading is done, so this class should be used at the delivering end of a smarter queue.
| alma::acs::logging::RemoteLogDispatcher::RemoteLogDispatcher | ( | ORB | orb, | |
| AcsLogServiceOperations | logService, | |||
| AcsLogFormatter | logFormatter | |||
| ) | [inline, package] |
| orb | used for creation of Anys | |
| logService | remote log service to which logs are sent. Since the reference is persistent across failures and restarts, we can keep working with this object the whole time. May be null for unit tests, in which case sendLogRecords(LogRecord[]) will fail and return the all log records inside the FailedLogRecords structure. With ACS 7.0.1 we allow the super type LogOperations instead of the usually expected Log, to allow unit tests with a mock Log service. | |
| logFormatter | used to format LogRecords to Any representation. No direct assumption on XML is made, so technically any valid Any returned by the formatter will do (as far as this class is concerned). |
References timestampLogRecordComparator, USE_ACS_LOGSERVICE_EXTENSIONS_PROPERTYNAME, and useAcsLogServiceExtensions.
| int alma::acs::logging::RemoteLogDispatcher::getBufferSize | ( | ) | [inline] |
| FailedLogRecords alma::acs::logging::RemoteLogDispatcher::sendLogRecords | ( | LogRecord[] | logRecords | ) | [inline, package] |
Attempts to send logRecords over to the remote logging service. To not lose any log records in case of failure, they can be obtained from the returned FailedLogRecords object, and should be fed back to the log record queue in order to try again later.
Should not be called concurrently (which can't happen since we use a single threaded executor in DispatchingLogQueue).
Sorts all log records by timestamp before converting them for remote transmission.
| logRecords |
References alma::acs::logging::RemoteLogDispatcher::FailedLogRecords::addSendFailure(), alma::acs::logging::RemoteLogDispatcher::FailedLogRecords::addSendFailures(), alma::acs::logging::RemoteLogDispatcher::FailedLogRecords::addSerializationFailure(), alma::acs::logging::formatters::AcsLogFormatter::formatAny(), getBufferSize(), logFormatter, orb, timestampLogRecordComparator, useAcsLogServiceExtensions, and writeRecords().
Referenced by alma::acs::logging::DispatchingLogQueue::flushLogRecords(), and alma::acs::logging::RemoteLogDispatcherTest::testSendLogRecords().
| void alma::acs::logging::RemoteLogDispatcher::setBufferSize | ( | int | newBuffSize | ) | [inline] |
Sets the size of the log record buffer, which determines the maximum number of log records that can be sent to the remote log service in one call.
Corresponds to dispatchPacketSize in the CDB.
| newBuffSize | value >=1, otherwise ignored |
References bufferSize.
Referenced by alma::acs::logging::RemoteLogDispatcherTest::testFailingRecords(), alma::acs::logging::RemoteLogDispatcherTest::testFlushByRecordNumber(), alma::acs::logging::RemoteLogDispatcherTest::testPeriodicFlush(), and alma::acs::logging::RemoteLogDispatcherTest::testUnavailableRemoteLogService().
| void alma::acs::logging::RemoteLogDispatcher::writeRecords | ( | XmlLogRecord[] | remoteLogRecords | ) | [inline, protected] |
Alternative to used when property alma.acs.logging.useAcsLogServiceExtensions is set. remoteLogRecords
Reimplemented in alma::acs::logging::TestLogDispatcher.
References logService, and alma::Logging::AcsLogServiceOperations::writeRecords().
| void alma::acs::logging::RemoteLogDispatcher::writeRecords | ( | Any[] | anyLogRecordsArray | ) | throws UserException [inline, protected] |
The CORBA call to Log#write_records(Any[]). May be faked by test subclasses.
| anyLogRecordsArray |
| UserException |
Reimplemented in alma::acs::logging::TestLogDispatcher.
References DEBUG, and logService.
Referenced by sendLogRecords().
int alma::acs::logging::RemoteLogDispatcher::bufferSize = 30 [private] |
Maximum number of CORBA Anys (with 1 log record each) sent to remote log service at a time. This buffer is is configured in the CDB through the attribute dispatchPacketSize.
Referenced by getBufferSize(), and setBufferSize().
final boolean alma::acs::logging::RemoteLogDispatcher::DEBUG = Boolean.getBoolean("alma.acs.logging.verbose") [private] |
Referenced by writeRecords().
final AcsLogFormatter alma::acs::logging::RemoteLogDispatcher::logFormatter [private] |
Referenced by sendLogRecords().
Referenced by writeRecords().
final ORB alma::acs::logging::RemoteLogDispatcher::orb [private] |
Referenced by sendLogRecords().
Referenced by RemoteLogDispatcher(), and sendLogRecords().
final String alma::acs::logging::RemoteLogDispatcher::USE_ACS_LOGSERVICE_EXTENSIONS_PROPERTYNAME = "alma.acs.logging.useAcsLogServiceExtensions" [static] |
Name of the property which will enable using the ACS extensions to the telecom logging service ("Log"), mainly to avoid wrapping all log records with a Corba Any.
Referenced by RemoteLogDispatcher().
| final boolean alma::acs::logging::RemoteLogDispatcher::useAcsLogServiceExtensions = Boolean.getBoolean(USE_ACS_LOGSERVICE_EXTENSIONS_PROPERTYNAME) |
1.6.2