diff --git a/jnosql-arangodb/src/main/java/org/eclipse/jnosql/databases/arangodb/communication/ArangoDBAccessor.java b/jnosql-arangodb/src/main/java/org/eclipse/jnosql/databases/arangodb/communication/ArangoDBAccessor.java new file mode 100644 index 000000000..50ce97741 --- /dev/null +++ b/jnosql-arangodb/src/main/java/org/eclipse/jnosql/databases/arangodb/communication/ArangoDBAccessor.java @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2022 Contributors to the Eclipse Foundation + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * and Apache License v2.0 which accompanies this distribution. + * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html + * and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php. + * + * You may elect to redistribute this code under either of these licenses. + * + * Contributors: + * + * Michele Rastelli + */ +package org.eclipse.jnosql.databases.arangodb.communication; + +import com.arangodb.ArangoDB; + +public interface ArangoDBAccessor { + + /** + * Accessor for the underlying ArangoDB driver instance. + * + * @return the {@link ArangoDB} instance + */ + ArangoDB getArangoDB(); + +} diff --git a/jnosql-arangodb/src/main/java/org/eclipse/jnosql/databases/arangodb/communication/ArangoDBBucketManager.java b/jnosql-arangodb/src/main/java/org/eclipse/jnosql/databases/arangodb/communication/ArangoDBBucketManager.java index f050679e4..8f4755b68 100644 --- a/jnosql-arangodb/src/main/java/org/eclipse/jnosql/databases/arangodb/communication/ArangoDBBucketManager.java +++ b/jnosql-arangodb/src/main/java/org/eclipse/jnosql/databases/arangodb/communication/ArangoDBBucketManager.java @@ -40,7 +40,7 @@ *
{@link BucketManager#put(Iterable, Duration)}
*{@link BucketManager#put(Iterable, Duration)}
*/ -public class ArangoDBBucketManager implements BucketManager { +public class ArangoDBBucketManager implements BucketManager, ArangoDBAccessor { private static final String KEY = "_key"; @@ -145,4 +145,9 @@ public void put(KeyValueEntity entity, Duration ttl) throws NullPointerException throw new UnsupportedOperationException("ArangoDB does not support TTL"); } + @Override + public ArangoDB getArangoDB() { + return arangoDB; + } + } diff --git a/jnosql-arangodb/src/main/java/org/eclipse/jnosql/databases/arangodb/communication/ArangoDBDocumentManager.java b/jnosql-arangodb/src/main/java/org/eclipse/jnosql/databases/arangodb/communication/ArangoDBDocumentManager.java index d8ce0664e..41cff3b9c 100644 --- a/jnosql-arangodb/src/main/java/org/eclipse/jnosql/databases/arangodb/communication/ArangoDBDocumentManager.java +++ b/jnosql-arangodb/src/main/java/org/eclipse/jnosql/databases/arangodb/communication/ArangoDBDocumentManager.java @@ -23,7 +23,7 @@ * The ArangoDB implementation of {@link DatabaseManager}. This implementation does not support TTL methods in the context of * {@link DatabaseManager#insert(org.eclipse.jnosql.communication.semistructured.CommunicationEntity)}. */ -public interface ArangoDBDocumentManager extends DatabaseManager { +public interface ArangoDBDocumentManager extends DatabaseManager, ArangoDBAccessor { /** * Executes an ArangoDB query using the ArangoDB Query Language (AQL). diff --git a/jnosql-arangodb/src/main/java/org/eclipse/jnosql/databases/arangodb/communication/DefaultArangoDBDocumentManager.java b/jnosql-arangodb/src/main/java/org/eclipse/jnosql/databases/arangodb/communication/DefaultArangoDBDocumentManager.java index 470eecfb4..87b3674b5 100644 --- a/jnosql-arangodb/src/main/java/org/eclipse/jnosql/databases/arangodb/communication/DefaultArangoDBDocumentManager.java +++ b/jnosql-arangodb/src/main/java/org/eclipse/jnosql/databases/arangodb/communication/DefaultArangoDBDocumentManager.java @@ -201,14 +201,15 @@ public Iterable