com.metamatrix.dqp.service
Class CustomizableTrackingService

java.lang.Object
  extended by com.metamatrix.dqp.service.CustomizableTrackingService
All Implemented Interfaces:
ApplicationService, TrackingService

public class CustomizableTrackingService
extends java.lang.Object
implements TrackingService

Tracking service implementation that defers to a CommandLoggerSPI service provider. A value for the DQPServiceProperties.TrackingService#COMMAND_LOGGER_CLASSNAME must be supplied in the DQP properties in order to use this Tracking Service implementation.


Field Summary
static java.lang.String SYSTEM_TXN_STORE_MMCMD
          Whether to log MetaMatrix command.
static java.lang.String SYSTEM_TXN_STORE_SRCCMD
          Whether to log source command.
static java.lang.String SYSTEM_TXN_STORE_TXN
          Whether to log transaction.
 
Constructor Summary
CustomizableTrackingService()
           
 
Method Summary
 CommandLoggerSPI getCommandLogger()
           
 void initialize(java.util.Properties props)
          Initialize the service with the specified properties.
 void log(java.lang.String requestId, long nodeID, java.lang.String subTxnUid, short status, java.lang.String modelName, java.lang.String cbName, short cmdPoint, java.lang.String sessionUid, java.lang.String principal, java.lang.String sql, int rowCount, ExecutionContext context)
          Log the command if the value of the property "metamatrix.transaction.log.storeSRCCMD" is "true".
 void log(java.lang.String requestId, java.lang.String txnUid, short cmdPoint, short status, java.lang.String sessionUid, java.lang.String applicationName, java.lang.String principal, java.lang.String vdbName, java.lang.String vdbVersion, java.lang.String sql, int rowCount)
          Log the command if the value of the property "metamatrix.transaction.log.storeMMCMD" is "true".
 void start(ApplicationEnvironment environment)
          Start the service with the specified environment.
 void stop()
          Stop the service.
 boolean willRecordMMCmd()
          Returns whether the tracker will record MM commands.
 boolean willRecordSrcCmd()
          Returns whether the tracker will record source commands.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SYSTEM_TXN_STORE_TXN

public static final java.lang.String SYSTEM_TXN_STORE_TXN
Whether to log transaction. Defaults to false.

See Also:
Constant Field Values

SYSTEM_TXN_STORE_MMCMD

public static final java.lang.String SYSTEM_TXN_STORE_MMCMD
Whether to log MetaMatrix command. Defaults to false.

See Also:
Constant Field Values

SYSTEM_TXN_STORE_SRCCMD

public static final java.lang.String SYSTEM_TXN_STORE_SRCCMD
Whether to log source command. Defaults to false.

See Also:
Constant Field Values
Constructor Detail

CustomizableTrackingService

public CustomizableTrackingService()
Method Detail

log

public void log(java.lang.String requestId,
                java.lang.String txnUid,
                short cmdPoint,
                short status,
                java.lang.String sessionUid,
                java.lang.String applicationName,
                java.lang.String principal,
                java.lang.String vdbName,
                java.lang.String vdbVersion,
                java.lang.String sql,
                int rowCount)
Description copied from interface: TrackingService
Log the command if the value of the property "metamatrix.transaction.log.storeMMCMD" is "true".

Specified by:
log in interface TrackingService
Parameters:
requestId - Unique command ID.
txnUid - Unique transaction ID.
cmdPoint - Point in command being logged - TransactionLogConstants.POINT.BEGIN, or TransactionLogConstants.POINT.END.
sessionUid - Session ID.
applicationName - name of the user application
principal - User name.
vdbName - VDB name.
vdbVersion - VDB version.
sql - SQL for the command.
rowCount - Final row count.
See Also:
com.metamatrix.dqp.service.TrackingService#log(java.lang.String, java.lang.String, short, short, java.lang.String, java.lang.String, java.lang.String, java.lang.String, com.metamatrix.query.sql.lang.Command)

log

public void log(java.lang.String requestId,
                long nodeID,
                java.lang.String subTxnUid,
                short status,
                java.lang.String modelName,
                java.lang.String cbName,
                short cmdPoint,
                java.lang.String sessionUid,
                java.lang.String principal,
                java.lang.String sql,
                int rowCount,
                ExecutionContext context)
Description copied from interface: TrackingService
Log the command if the value of the property "metamatrix.transaction.log.storeSRCCMD" is "true".

Specified by:
log in interface TrackingService
Parameters:
requestId - Unique command ID.
nodeID - Subcommand ID
subTxnUid - Unique subtransaction ID.
status - Type of request - TransactionLogConstants.SRCCMD_STATUS.NEW, or TransactionLogConstants.SRCCMD_STATUS.CANCEL, or TransactionLogConstants.SRCCMD_STATUS.END, or TransactionLogConstants.SRCCMD_STATUS.ERROR.
modelName - Name of model.
cbName - Connector binding name.
cmdPoint - Point in command being logged - TransactionLogConstants.POINT.BEGIN, or TransactionLogConstants.POINT.END.
sessionUid - Session ID.
principal - User name.
sql - SQL for the command.
rowCount - Final row count.
See Also:
com.metamatrix.dqp.service.TrackingService#log(java.lang.String, long, java.lang.String, short, java.lang.String, java.lang.String, short, java.lang.String, java.lang.String, com.metamatrix.query.sql.lang.Command, int)

willRecordMMCmd

public boolean willRecordMMCmd()
Description copied from interface: TrackingService
Returns whether the tracker will record MM commands.

Specified by:
willRecordMMCmd in interface TrackingService
Returns:
See Also:
TrackingService.willRecordMMCmd()

willRecordSrcCmd

public boolean willRecordSrcCmd()
Description copied from interface: TrackingService
Returns whether the tracker will record source commands.

Specified by:
willRecordSrcCmd in interface TrackingService
Returns:
See Also:
TrackingService.willRecordSrcCmd()

initialize

public void initialize(java.util.Properties props)
                throws ApplicationInitializationException
Description copied from interface: ApplicationService
Initialize the service with the specified properties.

Specified by:
initialize in interface ApplicationService
Parameters:
props - Initialialization properties
Throws:
ApplicationInitializationException - If an error occurs during initialization
See Also:
ApplicationService.initialize(java.util.Properties)

start

public void start(ApplicationEnvironment environment)
           throws ApplicationLifecycleException
Description copied from interface: ApplicationService
Start the service with the specified environment. The environment can be used to find other services or resources.

Specified by:
start in interface ApplicationService
Parameters:
environment - Environment
Throws:
ApplicationLifecycleException - If an error occurs while starting
See Also:
ApplicationService.start(com.metamatrix.common.application.ApplicationEnvironment)

stop

public void stop()
          throws ApplicationLifecycleException
Description copied from interface: ApplicationService
Stop the service.

Specified by:
stop in interface ApplicationService
Throws:
ApplicationLifecycleException - If an error occurs while starting
See Also:
ApplicationService.stop()

getCommandLogger

public CommandLoggerSPI getCommandLogger()


Copyright © 2009. All Rights Reserved.