com.h3c.util.persistence.cassandra.query

## Class WriteQueryLoggingDecorator<T,C>

- java.lang.Object
- - com.h3c.util.persistence.cassandra.query.WriteQueryDecorator<T,C>
  - - com.h3c.util.persistence.cassandra.query.WriteQueryLoggingDecorator<T,C>

- Type Parameters:
    `T` - Type of the query result.
    `C` - Context for query execution
  All Implemented Interfaces:
    WriteQuery<T,C>

      public class WriteQueryLoggingDecorator<T,C>
      extends WriteQueryDecorator<T,C>

  WriteQueryLoggingDecorator provides a Logging decoration to the write query.
  The DataStoreManager should decorate a write query with this decorator if logging is enabled.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `WriteQueryLoggingDecorator(WriteQuery<T,C> update, org.slf4j.Logger log)` Decorator for write query operations to avail logging support.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `T` | `execute(C context)` Execute WriteQuery with logging.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### WriteQueryLoggingDecorator

          public WriteQueryLoggingDecorator(WriteQuery<T,C> update,
                                    org.slf4j.Logger log)

      Decorator for write query operations to avail logging support.
      Parameters:
        `update` - WriteQuery to be executed
        `log` - Instance of slf4j logger framework.

  - ### Method Detail

    - #### execute

          public T execute(C context)
                    throws Exception

      Execute WriteQuery with logging.
      Parameters:
        `context` - Context of the query.
      Returns:
        Result of WriteQuery operation.
      Throws:
        `NullPointerException` - In case of context is null.
        `Exception` - Throws Exception in case of any error in query execute.

Copyright © 2014. All Rights Reserved.