com.cybersource.ws.client
Class LoggerWrapper

java.lang.Object
  extended by com.cybersource.ws.client.LoggerWrapper
All Implemented Interfaces:
Logger

public class LoggerWrapper
extends java.lang.Object
implements Logger

An internal class used by the clients to encapsulate the logger, primarily to avoid having to check if the Logger object is null before logging. It implements Logger just so the clients can pass it to the exceptions' constructors.


Field Summary
 
Fields inherited from interface com.cybersource.ws.client.Logger
LT_EXCEPTION, LT_FAULT, LT_FILESTART, LT_INFO, LT_MERCHCFG, LT_PROXYCFG, LT_REPLY, LT_REQUEST, LT_TRANSTART
 
Constructor Summary
LoggerWrapper(Logger _logger, boolean _prepare, boolean _logTranStart, MerchantConfig _mc)
          Constructor.
 
Method Summary
 Logger getLogger()
          Returns the encapsulated Logger object.
 MyStopWatch getStopWatch()
          Returns the encapsulated StopWatch object.
 void log(java.lang.String type, java.lang.String text)
          Calls the encapsulated Logger object's log() method.
 void log(java.lang.String type, java.lang.String text, boolean splitTimer)
          Calls the encapsulated Logger object's log() method.
 void logTransactionStart()
          Calls the encapsulated Logger object's logTransactionStart() method.
 void prepare()
          Calls the encapsulated Logger object's prepare() method.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LoggerWrapper

public LoggerWrapper(Logger _logger,
                     boolean _prepare,
                     boolean _logTranStart,
                     MerchantConfig _mc)
              throws com.cybersource.ws.client.ConfigException
Constructor.

Parameters:
_logger - Logger object to encapsulate. May be null, in which case, a LoggerImpl object will be created (unless logging is not enabled).
_prepare - Flag as to whether or not the logger's prepare() method should be called.
_logTranStart - Flag as to whether or not the logger's logTransactionStart() method should be called.
_mc - MerchantConfig object used to create and configure the LoggerImpl object.
Throws:
ConfigException - if the preparation fails.
Method Detail

prepare

public void prepare()
             throws com.cybersource.ws.client.ConfigException
Calls the encapsulated Logger object's prepare() method.

Specified by:
prepare in interface Logger
Throws:
ConfigException - if preparation fails.

logTransactionStart

public void logTransactionStart()
Calls the encapsulated Logger object's logTransactionStart() method.

Specified by:
logTransactionStart in interface Logger

log

public void log(java.lang.String type,
                java.lang.String text)
Calls the encapsulated Logger object's log() method.

Specified by:
log in interface Logger
Parameters:
type - the log entry type.
text - the actual text to be logged.

log

public void log(java.lang.String type,
                java.lang.String text,
                boolean splitTimer)
Calls the encapsulated Logger object's log() method.

Parameters:
type - the log entry type.
text - the actual text to be logged.
splitTimer - to log split time.

getLogger

public Logger getLogger()
Returns the encapsulated Logger object.

Returns:
the encapsulated Logger object.

getStopWatch

public MyStopWatch getStopWatch()
Returns the encapsulated StopWatch object.

Returns:
the encapsulated StopWatch object.


Copyright © 2017. All Rights Reserved.