Package apoc.couchbase
Class CouchbaseManager
- java.lang.Object
-
- apoc.couchbase.CouchbaseManager
-
public class CouchbaseManager extends java.lang.Object
Creates aCouchbaseConnection
though that all of the operations performed against a Couchbase Server can be done.- Since:
- 15.8.2016
-
-
Field Summary
Fields Modifier and Type Field Description protected static java.lang.String
COUCHBASE_CONFIG_KEY
protected static java.lang.String
PASSWORD_CONFIG_KEY
protected static java.lang.String
PORT_CONFIG_KEY
protected static java.lang.String
URI_CONFIG_KEY
protected static java.lang.String
USERNAME_CONFIG_KEY
-
Constructor Summary
Constructors Modifier Constructor Description protected
CouchbaseManager()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description protected static java.net.URI
checkAndGetURI(java.lang.String hostOrKey)
static java.lang.String
getConfig(java.lang.String key)
static CouchbaseConnection
getConnection(java.lang.String hostOrKey, java.lang.String bucketName)
protected static org.neo4j.internal.helpers.collection.Pair<com.couchbase.client.core.env.PasswordAuthenticator,java.util.List<java.lang.String>>
getConnectionObjectsFromConfigurationKey(java.lang.String configurationKey)
Creates aPair
containing aPasswordAuthenticator
and aList
of (cluster) nodes from configuration propertiesprotected static org.neo4j.internal.helpers.collection.Pair<com.couchbase.client.core.env.PasswordAuthenticator,java.util.List<java.lang.String>>
getConnectionObjectsFromHost(java.net.URI host)
Creates aPair
containing aPasswordAuthenticator
and aList
of (cluster) nodes from a URIprotected static org.neo4j.internal.helpers.collection.Pair<com.couchbase.client.core.env.PasswordAuthenticator,java.util.List<java.lang.String>>
getConnectionObjectsFromHostOrKey(java.lang.String hostOrKey)
Creates aPair
containing aPasswordAuthenticator
and aList
of (cluster) nodes from configuration properties or a URI This method verifies if the variable hostOrKey has "couchbase" as a scheme if not then it consider hostOrKey as a configuration key If it's a URI then the credentials should be defined according to the URI specificationsprotected static org.apache.commons.configuration2.Configuration
getKeyMap(java.lang.String hostOrKey)
-
-
-
Field Detail
-
COUCHBASE_CONFIG_KEY
protected static final java.lang.String COUCHBASE_CONFIG_KEY
- See Also:
- Constant Field Values
-
USERNAME_CONFIG_KEY
protected static final java.lang.String USERNAME_CONFIG_KEY
- See Also:
- Constant Field Values
-
PASSWORD_CONFIG_KEY
protected static final java.lang.String PASSWORD_CONFIG_KEY
- See Also:
- Constant Field Values
-
URI_CONFIG_KEY
protected static final java.lang.String URI_CONFIG_KEY
- See Also:
- Constant Field Values
-
PORT_CONFIG_KEY
protected static final java.lang.String PORT_CONFIG_KEY
- See Also:
- Constant Field Values
-
-
Method Detail
-
checkAndGetURI
protected static java.net.URI checkAndGetURI(java.lang.String hostOrKey)
-
getConnectionObjectsFromConfigurationKey
protected static org.neo4j.internal.helpers.collection.Pair<com.couchbase.client.core.env.PasswordAuthenticator,java.util.List<java.lang.String>> getConnectionObjectsFromConfigurationKey(java.lang.String configurationKey)
Creates aPair
containing aPasswordAuthenticator
and aList
of (cluster) nodes from configuration properties- Parameters:
configurationKey
- the configuration key in apoc.conf that should be defined as apoc.couchbase.[configurationKey]- Returns:
- a tuple2, the connections objects that we need to establish a connection to a Couchbase Server
-
getConnectionObjectsFromHost
protected static org.neo4j.internal.helpers.collection.Pair<com.couchbase.client.core.env.PasswordAuthenticator,java.util.List<java.lang.String>> getConnectionObjectsFromHost(java.net.URI host)
Creates aPair
containing aPasswordAuthenticator
and aList
of (cluster) nodes from a URI- Parameters:
host
- a URI representing the connection to a single instance, for example couchbase://username:password@hostname:port- Returns:
- a tuple2, the connections objects that we need to establish a connection to a Couchbase Server
-
getConnectionObjectsFromHostOrKey
protected static org.neo4j.internal.helpers.collection.Pair<com.couchbase.client.core.env.PasswordAuthenticator,java.util.List<java.lang.String>> getConnectionObjectsFromHostOrKey(java.lang.String hostOrKey)
Creates aPair
containing aPasswordAuthenticator
and aList
of (cluster) nodes from configuration properties or a URI This method verifies if the variable hostOrKey has "couchbase" as a scheme if not then it consider hostOrKey as a configuration key If it's a URI then the credentials should be defined according to the URI specifications- Parameters:
hostOrKey
- a configuration key (in the apoc.conf file) or a URI- Returns:
-
getConnection
public static CouchbaseConnection getConnection(java.lang.String hostOrKey, java.lang.String bucketName)
- Parameters:
hostOrKey
-bucketName
-- Returns:
- the
CouchbaseConnection
-
getKeyMap
protected static org.apache.commons.configuration2.Configuration getKeyMap(java.lang.String hostOrKey)
-
getConfig
public static java.lang.String getConfig(java.lang.String key)
-
-