Skip to content

Commit 859b447

Browse files
author
Mark
committed
added convenience methods
1 parent f4d6d4a commit 859b447

File tree

7 files changed

+22
-33
lines changed

7 files changed

+22
-33
lines changed

ChangeLog

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
v4.1.11 (2017-03-xx)
2+
---------------------------
3+
* added convenience methods (ArangoDatabase.arango(), ArangoCollection.db(), ArangoGraph.db())
4+
15
v4.1.10 (2017-02-22)
26
---------------------------
37
* changed velocystream message sending to async

src/main/java/com/arangodb/ArangoCollectionAsync.java

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -55,18 +55,11 @@
5555
* @author Mark - mark at arangodb.com
5656
*
5757
*/
58-
public class ArangoCollectionAsync
59-
extends InternalArangoCollection<ArangoExecutorAsync, CompletableFuture<Response>, ConnectionAsync> {
60-
61-
private final ArangoDatabaseAsync db;
58+
public class ArangoCollectionAsync extends
59+
InternalArangoCollection<ArangoDBAsync, ArangoDatabaseAsync, ArangoExecutorAsync, CompletableFuture<Response>, ConnectionAsync> {
6260

6361
protected ArangoCollectionAsync(final ArangoDatabaseAsync db, final String name) {
64-
super(db.executor(), db.name(), name);
65-
this.db = db;
66-
}
67-
68-
protected ArangoDatabaseAsync db() {
69-
return db;
62+
super(db, name);
7063
}
7164

7265
/**

src/main/java/com/arangodb/ArangoCursorAsync.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
*/
3535
public class ArangoCursorAsync<T> extends ArangoCursor<T> {
3636

37-
protected ArangoCursorAsync(final InternalArangoDatabase<?, ?, ?> db, final ArangoCursorExecute execute,
37+
protected ArangoCursorAsync(final InternalArangoDatabase<?, ?, ?, ?> db, final ArangoCursorExecute execute,
3838
final Class<T> type, final CursorEntity result) {
3939
super(db, execute, type, result);
4040
}

src/main/java/com/arangodb/ArangoDatabaseAsync.java

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -66,22 +66,18 @@
6666
* @author Mark - mark at arangodb.com
6767
*
6868
*/
69-
public class ArangoDatabaseAsync
70-
extends InternalArangoDatabase<ArangoExecutorAsync, CompletableFuture<Response>, ConnectionAsync> {
69+
public class ArangoDatabaseAsync extends
70+
InternalArangoDatabase<ArangoDBAsync, ArangoExecutorAsync, CompletableFuture<Response>, ConnectionAsync> {
7171

7272
protected ArangoDatabaseAsync(final ArangoDBAsync arangoDB, final String name) {
73-
super(arangoDB.executor(), name);
73+
super(arangoDB, arangoDB.executor(), name);
7474
}
7575

7676
protected ArangoDatabaseAsync(final CommunicationAsync communication, final VPack vpacker, final VPack vpackerNull,
7777
final VPackParser vpackParser, final DocumentCache documentCache, final CollectionCache collectionCache,
7878
final String name) {
79-
super(new ArangoExecutorAsync(communication, vpacker, vpackerNull, vpackParser, documentCache, collectionCache),
80-
name);
81-
}
82-
83-
protected ArangoExecutorAsync executor() {
84-
return executor;
79+
super(null, new ArangoExecutorAsync(communication, vpacker, vpackerNull, vpackParser, documentCache,
80+
collectionCache), name);
8581
}
8682

8783
/**

src/main/java/com/arangodb/ArangoEdgeCollectionAsync.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,11 @@
3838
* @author Mark - mark at arangodb.com
3939
*
4040
*/
41-
public class ArangoEdgeCollectionAsync
42-
extends InternalArangoEdgeCollection<ArangoExecutorAsync, CompletableFuture<Response>, ConnectionAsync> {
41+
public class ArangoEdgeCollectionAsync extends
42+
InternalArangoEdgeCollection<ArangoDBAsync, ArangoDatabaseAsync, ArangoGraphAsync, ArangoExecutorAsync, CompletableFuture<Response>, ConnectionAsync> {
4343

4444
protected ArangoEdgeCollectionAsync(final ArangoGraphAsync graph, final String name) {
45-
super(graph.executor(), graph.db(), graph.name(), name);
45+
super(graph, name);
4646
}
4747

4848
/**

src/main/java/com/arangodb/ArangoGraphAsync.java

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,11 @@
3434
* @author Mark - mark at arangodb.com
3535
*
3636
*/
37-
public class ArangoGraphAsync
38-
extends InternalArangoGraph<ArangoExecutorAsync, CompletableFuture<Response>, ConnectionAsync> {
37+
public class ArangoGraphAsync extends
38+
InternalArangoGraph<ArangoDBAsync, ArangoDatabaseAsync, ArangoExecutorAsync, CompletableFuture<Response>, ConnectionAsync> {
3939

4040
protected ArangoGraphAsync(final ArangoDatabaseAsync db, final String name) {
41-
super(db.executor(), db.name(), name);
42-
}
43-
44-
protected ArangoExecutorAsync executor() {
45-
return executor;
41+
super(db, name);
4642
}
4743

4844
/**

src/main/java/com/arangodb/ArangoVertexCollectionAsync.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,11 @@
3838
* @author Mark - mark at arangodb.com
3939
*
4040
*/
41-
public class ArangoVertexCollectionAsync
42-
extends InternalArangoVertexCollection<ArangoExecutorAsync, CompletableFuture<Response>, ConnectionAsync> {
41+
public class ArangoVertexCollectionAsync extends
42+
InternalArangoVertexCollection<ArangoDBAsync, ArangoDatabaseAsync, ArangoGraphAsync, ArangoExecutorAsync, CompletableFuture<Response>, ConnectionAsync> {
4343

4444
protected ArangoVertexCollectionAsync(final ArangoGraphAsync graph, final String name) {
45-
super(graph.executor(), graph.db(), graph.name(), name);
45+
super(graph, name);
4646
}
4747

4848
/**

0 commit comments

Comments
 (0)