org.apache.logging.log4j.nosql.appender.couchdb
Class CouchDbProvider

java.lang.Object
  extended by org.apache.logging.log4j.nosql.appender.couchdb.CouchDbProvider
All Implemented Interfaces:
NoSqlProvider<CouchDbConnection>

@Plugin(name="CouchDB",
        category="Core",
        printObject=true)
public final class CouchDbProvider
extends Object
implements NoSqlProvider<CouchDbConnection>

The Apache CouchDB implementation of NoSqlProvider.


Method Summary
static CouchDbProvider createNoSqlProvider(String databaseName, String protocol, String server, String port, String username, String password, String factoryClassName, String factoryMethodName)
          Factory method for creating an Apache CouchDB provider within the plugin manager.
 CouchDbConnection getConnection()
          Obtains a connection from this provider.
 String toString()
          All implementations must override Object.toString() to provide information about the provider configuration (obscuring passwords with one-way hashes).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

getConnection

public CouchDbConnection getConnection()
Description copied from interface: NoSqlProvider
Obtains a connection from this provider. The concept of a connection in this case is not strictly an active duplex UDP or TCP connection to the underlying database. It can be thought of more as a gateway, a path for inserting objects that may use a persistent connection or may use HTTP web service calls, etc.

Where applicable, this method should return a connection from the connection pool as opposed to opening a brand new connection every time.

Specified by:
getConnection in interface NoSqlProvider<CouchDbConnection>
Returns:
a connection that can be used to create and persist objects to this database.
See Also:
NoSqlConnection

toString

public String toString()
Description copied from interface: NoSqlProvider
All implementations must override Object.toString() to provide information about the provider configuration (obscuring passwords with one-way hashes).

Specified by:
toString in interface NoSqlProvider<CouchDbConnection>
Overrides:
toString in class Object
Returns:
the string representation of this NoSQL provider.

createNoSqlProvider

@PluginFactory
public static CouchDbProvider createNoSqlProvider(@PluginAttribute(value="databaseName")
                                                                String databaseName,
                                                                @PluginAttribute(value="protocol")
                                                                String protocol,
                                                                @PluginAttribute(value="server")
                                                                String server,
                                                                @PluginAttribute(value="port")
                                                                String port,
                                                                @PluginAttribute(value="username")
                                                                String username,
                                                                @PluginAttribute(value="password",sensitive=true)
                                                                String password,
                                                                @PluginAttribute(value="factoryClassName")
                                                                String factoryClassName,
                                                                @PluginAttribute(value="factoryMethodName")
                                                                String factoryMethodName)
Factory method for creating an Apache CouchDB provider within the plugin manager.

Parameters:
databaseName - The name of the database to which log event documents will be written.
protocol - Either "http" or "https," defaults to "http" and mutually exclusive with factoryClassName&factoryMethodName!=null.
server - The host name of the CouchDB server, defaults to localhost and mutually exclusive with factoryClassName&factoryMethodName!=null.
port - The port that CouchDB is listening on, defaults to 80 if protocol is "http" and 443 if protocol is "https," and mutually exclusive with factoryClassName&factoryMethodName!=null.
username - The username to authenticate against the MongoDB server with, mutually exclusive with factoryClassName&factoryMethodName!=null.
password - The password to authenticate against the MongoDB server with, mutually exclusive with factoryClassName&factoryMethodName!=null.
factoryClassName - A fully qualified class name containing a static factory method capable of returning a CouchDbClient or CouchDbProperties.
factoryMethodName - The name of the public static factory method belonging to the aforementioned factory class.
Returns:
a new Apache CouchDB provider.


Copyright © 1999-2015 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.