Class CouchbaseManager


  • public class CouchbaseManager
    extends java.lang.Object
    Creates a CouchbaseConnection though that all of the operations performed against a Couchbase Server can be done.
    Since:
    15.8.2016
    • 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 a Pair containing a PasswordAuthenticator and a List of (cluster) nodes from configuration properties
      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 a Pair containing a PasswordAuthenticator and a List of (cluster) nodes from a URI
      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 a Pair containing a PasswordAuthenticator and a List 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
      protected static org.apache.commons.configuration2.Configuration getKeyMap​(java.lang.String hostOrKey)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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
      • PORT_CONFIG_KEY

        protected static final java.lang.String PORT_CONFIG_KEY
        See Also:
        Constant Field Values
    • Constructor Detail

      • CouchbaseManager

        protected CouchbaseManager()
    • 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 a Pair containing a PasswordAuthenticator and a List 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 a Pair containing a PasswordAuthenticator and a List 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 a Pair containing a PasswordAuthenticator and a List 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)