com.h3c.util.persistence.cassandra.query

## Class ReadQueryLoggingDecorator<T,C>

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

- Type Parameters:
    `T` - Type of the result of the query
    `C` - The context to execute the query.
  All Implemented Interfaces:
    ReadQuery<T,C>

      public class ReadQueryLoggingDecorator<T,C>
      extends ReadQueryDecorator<T,C>

  ReadQueryLoggingDecorator is a concrete decorator for Read Query operations. This decorator provides the ability to log queries as they are executed. The `DataStoreManager` should decorate the queries to use this decorator if logging is enabled.
  This decorator extends an abstract ReadQueryDecorator that caters to all types of concrete decorators for a Read Query.

- - ### Field Summary

    - ### Fields inherited from class com.h3c.util.persistence.cassandra.query.ReadQueryDecorator

      `delegate, log`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ReadQueryLoggingDecorator(ReadQuery<T,C> query, org.slf4j.Logger log)` Decorator for read query operations to avail logging support.

  - ### Method Summary

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

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

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

- - ### Constructor Detail

    - #### ReadQueryLoggingDecorator

          public ReadQueryLoggingDecorator(ReadQuery<T,C> query,
                                   org.slf4j.Logger log)

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

  - ### Method Detail

    - #### execute

          public T execute(C context)
                    throws Exception

      Execute ReadQuery with logging.
      Parameters:
        `context` - Context of the query.
      Returns:
        Result of ReadQuery 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.