Classes | Public Member Functions | Public Attributes | Static Public Attributes | Protected Member Functions | Package Functions

alma.acs.logging.RemoteLogDispatcher Class Reference

List of all members.

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)

Detailed Description

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.

Author:
hsommer created Apr 19, 2005 4:15:19 PM

Constructor & Destructor Documentation

alma.acs.logging.RemoteLogDispatcher.RemoteLogDispatcher ( ORB  orb,
AcsLogServiceOperations  logService,
AcsLogFormatter  logFormatter 
) [package]
Parameters:
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.


Member Function Documentation

int alma.acs.logging.RemoteLogDispatcher.getBufferSize (  ) 
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.

Parameters:
logRecords 
Returns:
those LogRecords that failed to be sent, either because they could not be converted to Any, or because the remote logger failed.

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.

Parameters:
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.

Parameters:
anyLogRecordsArray 
Exceptions:
UserException 

Referenced by alma.acs.logging.RemoteLogDispatcher.sendLogRecords().


Member Data Documentation

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().


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Enumerations Properties