Class Neo4JDatabaseManagerFactory

java.lang.Object
org.eclipse.jnosql.databases.neo4j.communication.Neo4JDatabaseManagerFactory
All Implemented Interfaces:
AutoCloseable, Function<String,org.eclipse.jnosql.communication.semistructured.DatabaseManager>, org.eclipse.jnosql.communication.semistructured.DatabaseManagerFactory

public class Neo4JDatabaseManagerFactory extends Object implements org.eclipse.jnosql.communication.semistructured.DatabaseManagerFactory
This class provides a factory for creating and managing instances of DefaultNeo4JDatabaseManager, enabling communication with a Neo4j database. It implements the DatabaseManagerFactory interface and handles the lifecycle of the Neo4j Driver.

Main Responsibilities:

  • Establishing a connection to a Neo4j database using the provided URI, username, and password.
  • Creating new instances of DefaultNeo4JDatabaseManager for a specific database.
  • Managing the lifecycle of the Neo4j driver, including proper resource cleanup.
>Thread Safety: The factory is thread-safe as long as it is used properly. Ensure to close the factory when it is no longer needed to release resources. At the close method, the factory closes the Neo4j Driver and releases resources.
  • Method Details

    • close

      public void close()
      Closes the Neo4j driver and releases resources.
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface org.eclipse.jnosql.communication.semistructured.DatabaseManagerFactory
    • apply

      public org.eclipse.jnosql.databases.neo4j.communication.DefaultNeo4JDatabaseManager apply(String database)
      Specified by:
      apply in interface Function<String,org.eclipse.jnosql.communication.semistructured.DatabaseManager>