Class AbstractConfigurableDriver

java.lang.Object
org.neo4j.ogm.driver.AbstractConfigurableDriver
All Implemented Interfaces:
AutoCloseable, Driver

public abstract class AbstractConfigurableDriver extends Object implements Driver
The AbstractConfigurableDriver is used by all drivers to register themselves. The register method takes a generic Configuration object, which is used to register the driver appropriately. This object contains of one or more key-value pairs. Every driver configuration must contain a mandatory key "URI", whose corresponding value is a text representation of the driver uri, for example: setConfig("URI", "http://username:password@hostname:port") if credentials are not present the URI, they can be specified in one of two ways, either as a plain text username/password key-values pair in the configuration e.g. setConfig("username", "bilbo") setConfig("password", "hobbit") or, alternatively using the "credentials" key setConfig("credentials", new UsernamePasswordCredentials("bilbo", "hobbit")
Author:
Vince Bickers, Mark Angrish, Michael J. Simons
  • Field Details

  • Constructor Details

    • AbstractConfigurableDriver

      public AbstractConfigurableDriver()
    • AbstractConfigurableDriver

      protected AbstractConfigurableDriver(Supplier<Map<String,Object>> customPropertiesSupplier)
      This is only provided for the embedded driver that can take a preconfigured, embedded database without any way to add configuration properties.
      Parameters:
      customPropertiesSupplier -
  • Method Details

    • configure

      public void configure(Configuration newConfiguration)
      Stores the configuration locally and loads the native type system for this driver if applicable. Be sure to call this method in case you opt to overwrite it in an implementation.
      Specified by:
      configure in interface Driver
      Parameters:
      newConfiguration - The new configuration
    • getConfiguration

      public Configuration getConfiguration()
      Specified by:
      getConfiguration in interface Driver
    • getCypherModification

      public final Function<String,String> getCypherModification()
      Specified by:
      getCypherModification in interface Driver
    • getTypeSystem

      public final TypeSystem getTypeSystem()
      Description copied from interface: Driver
      This returns the type system of the specific drivers. A type system for a driver is set of types that are special to Neo4j and can be represented in either Java built-ins or dedicated types. The driver interface defaults to a type system that does not support any native types.
      Specified by:
      getTypeSystem in interface Driver
      Returns:
      This driver's type system.
    • getTypeSystemName

      protected abstract String getTypeSystemName()
      Returns:
      The fully qualified name of the native typesystem to use.
      Throws:
      UnsupportedOperationException - in case the concrete driver doesn't support a native typesystem.