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) |
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 | |||
) | [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 alma.acs.logging.RemoteLogDispatcher.USE_ACS_LOGSERVICE_EXTENSIONS_PROPERTYNAME, and alma.acs.logging.RemoteLogDispatcher.useAcsLogServiceExtensions.
int alma.acs.logging.RemoteLogDispatcher.getBufferSize | ( | ) |
Referenced by alma.acs.logging.RemoteLogDispatcher.sendLogRecords().
FailedLogRecords alma.acs.logging.RemoteLogDispatcher.sendLogRecords | ( | LogRecord[] | logRecords | ) | [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.formatters.AcsLogFormatter.formatAny(), alma.acs.logging.RemoteLogDispatcher.getBufferSize(), alma.acs.logging.RemoteLogDispatcher.useAcsLogServiceExtensions, and alma.acs.logging.RemoteLogDispatcher.writeRecords().
void alma.acs.logging.RemoteLogDispatcher.setBufferSize | ( | int | newBuffSize | ) |
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 |
void alma.acs.logging.RemoteLogDispatcher.writeRecords | ( | XmlLogRecord[] | remoteLogRecords | ) | [protected] |
void alma.acs.logging.RemoteLogDispatcher.writeRecords | ( | Any[] | anyLogRecordsArray | ) | throws UserException [protected] |
The CORBA call to Log#write_records(Any[]). May be faked by test subclasses.
anyLogRecordsArray |
UserException |
Referenced by alma.acs.logging.RemoteLogDispatcher.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 alma.acs.logging.RemoteLogDispatcher.RemoteLogDispatcher().
final boolean alma.acs.logging.RemoteLogDispatcher.useAcsLogServiceExtensions = Boolean.getBoolean(USE_ACS_LOGSERVICE_EXTENSIONS_PROPERTYNAME) |