org.apache.logging.log4j.core.appender.db.nosql
Class NoSQLDatabaseManager<W>

java.lang.Object
  extended by org.apache.logging.log4j.core.appender.AbstractManager
      extended by org.apache.logging.log4j.core.appender.db.AbstractDatabaseManager
          extended by org.apache.logging.log4j.core.appender.db.nosql.NoSQLDatabaseManager<W>
Type Parameters:
W - A type parameter for reassuring the compiler that all operations are using the same NoSQLObject.

public final class NoSQLDatabaseManager<W>
extends AbstractDatabaseManager

An AbstractDatabaseManager implementation for all NoSQL databases.


Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.logging.log4j.core.appender.db.AbstractDatabaseManager
AbstractDatabaseManager.AbstractFactoryData
 
Field Summary
 
Fields inherited from class org.apache.logging.log4j.core.appender.AbstractManager
count, LOGGER
 
Method Summary
protected  void connectInternal()
          Implementations should implement this method to perform any proprietary connection operations.
protected  void disconnectInternal()
          Implementations should implement this method to perform any proprietary disconnection / shutdown operations.
static NoSQLDatabaseManager<?> getNoSQLDatabaseManager(String name, int bufferSize, NoSQLProvider<?> provider)
          Creates a NoSQL manager for use within the NoSQLAppender, or returns a suitable one if it already exists.
protected  void writeInternal(LogEvent event)
          Performs the actual writing of the event in an implementation-specific way.
 
Methods inherited from class org.apache.logging.log4j.core.appender.db.AbstractDatabaseManager
connect, disconnect, flush, getManager, isConnected, releaseSub, toString, write
 
Methods inherited from class org.apache.logging.log4j.core.appender.AbstractManager
getContentFormat, getCount, getName, hasManager, release
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

connectInternal

protected void connectInternal()
Description copied from class: AbstractDatabaseManager
Implementations should implement this method to perform any proprietary connection operations. This method will never be called twice on the same instance. It is safe to throw any exceptions from this method.

Specified by:
connectInternal in class AbstractDatabaseManager

disconnectInternal

protected void disconnectInternal()
Description copied from class: AbstractDatabaseManager
Implementations should implement this method to perform any proprietary disconnection / shutdown operations. This method will never be called twice on the same instance, and it will only be called after AbstractDatabaseManager.connectInternal(). It is safe to throw any exceptions from this method.

Specified by:
disconnectInternal in class AbstractDatabaseManager

writeInternal

protected void writeInternal(LogEvent event)
Description copied from class: AbstractDatabaseManager
Performs the actual writing of the event in an implementation-specific way. This method is called immediately from AbstractDatabaseManager.write(LogEvent) if buffering is off, or from AbstractDatabaseManager.flush() if the buffer has reached its limit.

Specified by:
writeInternal in class AbstractDatabaseManager
Parameters:
event - The event to write to the database.

getNoSQLDatabaseManager

public static NoSQLDatabaseManager<?> getNoSQLDatabaseManager(String name,
                                                              int bufferSize,
                                                              NoSQLProvider<?> provider)
Creates a NoSQL manager for use within the NoSQLAppender, or returns a suitable one if it already exists.

Parameters:
name - The name of the manager, which should include connection details and hashed passwords where possible.
bufferSize - The size of the log event buffer.
provider - A provider instance which will be used to obtain connections to the chosen NoSQL database.
Returns:
a new or existing NoSQL manager as applicable.


Copyright © 1999-2013 Apache Software Foundation. All Rights Reserved.
Apache Logging, Apache Log4j, Log4j, Apache, the Apache feather logo, the Apache Logging project logo, and the Apache Log4j logo are trademarks of The Apache Software Foundation.