Class ConnectionManagerImpl
- java.lang.Object
-
- org.neotropic.kuwaiba.core.persistence.reference.neo4j.ConnectionManagerImpl
-
- All Implemented Interfaces:
ConnectionManager<org.neo4j.graphdb.GraphDatabaseService>
@Service public class ConnectionManagerImpl extends Object implements ConnectionManager<org.neo4j.graphdb.GraphDatabaseService>
ConnectionManager reference implementation using Neo4J as DBMS- Author:
- Adrian Martinez Molina <adrian.martinez@kuwaiba.org>
-
-
Field Summary
Fields Modifier and Type Field Description static org.neo4j.graphdb.config.Setting<Boolean>
udc_enabled
Custom configuration entry to disable the N4J's Usage Data Collector.
-
Constructor Summary
Constructors Constructor Description ConnectionManagerImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
closeConnection()
Closes the connection with the databasevoid
commitTransaction()
Commits the current transaction (if supported by the backend)String
getConnectionDetails()
Textual description a bout the connectionorg.neo4j.graphdb.GraphDatabaseService
getConnectionHandler()
Returns the connection handler, which depends on the kind of backed being used.List<ConnectionManager>
getConnectionPool()
Gets the list of spawned connectionsboolean
isSpawned()
Tells if the current manager is one spawned from another.void
openConnection()
Opens a database connection (an probably initialize the connection handler)void
rollbackTransaction()
Rolls back the current transaction (if supported by the backend)void
setConfiguration(Properties properties)
Sets the properties necessary to establish and manage the connection with the database (login, passwd, hostname, etc).void
shutDown()
Releases the resources associated to this ConnectionManager, assuming that closeConnection didn't do it completely.ConnectionManager
spawnConnection()
Creates a new connection from the original onevoid
startTransaction()
Starts a transaction (if supported by the backend)
-
-
-
Field Detail
-
udc_enabled
public static final org.neo4j.graphdb.config.Setting<Boolean> udc_enabled
Custom configuration entry to disable the N4J's Usage Data Collector.
-
-
Method Detail
-
closeConnection
public void closeConnection()
Description copied from interface:ConnectionManager
Closes the connection with the database- Specified by:
closeConnection
in interfaceConnectionManager<org.neo4j.graphdb.GraphDatabaseService>
-
commitTransaction
public void commitTransaction()
Description copied from interface:ConnectionManager
Commits the current transaction (if supported by the backend)- Specified by:
commitTransaction
in interfaceConnectionManager<org.neo4j.graphdb.GraphDatabaseService>
-
getConnectionPool
public List<ConnectionManager> getConnectionPool()
Description copied from interface:ConnectionManager
Gets the list of spawned connections- Specified by:
getConnectionPool
in interfaceConnectionManager<org.neo4j.graphdb.GraphDatabaseService>
- Returns:
- The list of spawned connections
-
isSpawned
public boolean isSpawned()
Description copied from interface:ConnectionManager
Tells if the current manager is one spawned from another.- Specified by:
isSpawned
in interfaceConnectionManager<org.neo4j.graphdb.GraphDatabaseService>
- Returns:
-
openConnection
public void openConnection() throws ConnectionException
Description copied from interface:ConnectionManager
Opens a database connection (an probably initialize the connection handler)- Specified by:
openConnection
in interfaceConnectionManager<org.neo4j.graphdb.GraphDatabaseService>
- Throws:
ConnectionException
- If the attempt to open the connection to the database failed
-
rollbackTransaction
public void rollbackTransaction()
Description copied from interface:ConnectionManager
Rolls back the current transaction (if supported by the backend)- Specified by:
rollbackTransaction
in interfaceConnectionManager<org.neo4j.graphdb.GraphDatabaseService>
-
spawnConnection
public ConnectionManager spawnConnection()
Description copied from interface:ConnectionManager
Creates a new connection from the original one- Specified by:
spawnConnection
in interfaceConnectionManager<org.neo4j.graphdb.GraphDatabaseService>
- Returns:
- Another connection manager
-
startTransaction
public void startTransaction()
Description copied from interface:ConnectionManager
Starts a transaction (if supported by the backend)- Specified by:
startTransaction
in interfaceConnectionManager<org.neo4j.graphdb.GraphDatabaseService>
-
getConnectionHandler
public org.neo4j.graphdb.GraphDatabaseService getConnectionHandler()
Description copied from interface:ConnectionManager
Returns the connection handler, which depends on the kind of backed being used.- Specified by:
getConnectionHandler
in interfaceConnectionManager<org.neo4j.graphdb.GraphDatabaseService>
- Returns:
-
shutDown
public void shutDown()
Description copied from interface:ConnectionManager
Releases the resources associated to this ConnectionManager, assuming that closeConnection didn't do it completely.- Specified by:
shutDown
in interfaceConnectionManager<org.neo4j.graphdb.GraphDatabaseService>
-
getConnectionDetails
public String getConnectionDetails()
Description copied from interface:ConnectionManager
Textual description a bout the connection- Specified by:
getConnectionDetails
in interfaceConnectionManager<org.neo4j.graphdb.GraphDatabaseService>
- Returns:
-
setConfiguration
public void setConfiguration(Properties properties)
Description copied from interface:ConnectionManager
Sets the properties necessary to establish and manage the connection with the database (login, passwd, hostname, etc). It is typically called before openConnection- Specified by:
setConfiguration
in interfaceConnectionManager<org.neo4j.graphdb.GraphDatabaseService>
- Parameters:
properties
- A properties object with the pairs name-value of all properties to be set.
-
-