Skip to content

Commit 0d9df16

Browse files
committed
align Graph API naming to documentation (DE-729)
1 parent aa5ee8a commit 0d9df16

18 files changed

+226
-29
lines changed

core/src/main/java/com/arangodb/ArangoEdgeCollection.java

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,10 @@ public interface ArangoEdgeCollection extends ArangoSerdeAccessor {
5555
* @see <a href=
5656
* "https://www.arangodb.com/docs/stable/http/gharial-management.html#remove-an-edge-definition-from-the-graph">API
5757
* Documentation</a>
58+
*
59+
* @deprecated use {@link #remove()} instead
5860
*/
61+
@Deprecated
5962
void drop();
6063

6164
/**
@@ -65,9 +68,31 @@ public interface ArangoEdgeCollection extends ArangoSerdeAccessor {
6568
* @see <a href=
6669
* "https://www.arangodb.com/docs/stable/http/gharial-management.html#remove-an-edge-definition-from-the-graph">API
6770
* Documentation</a>
71+
*
72+
* @deprecated use {@link #remove(EdgeCollectionRemoveOptions)} instead
6873
*/
74+
@Deprecated
6975
void drop(EdgeCollectionDropOptions options);
7076

77+
/**
78+
* Remove one edge definition from the graph.
79+
*
80+
* @see <a href=
81+
* "https://www.arangodb.com/docs/stable/http/gharial-management.html#remove-an-edge-definition-from-the-graph">API
82+
* Documentation</a>
83+
*/
84+
void remove();
85+
86+
/**
87+
* Remove one edge definition from the graph.
88+
*
89+
* @param options options
90+
* @see <a href=
91+
* "https://www.arangodb.com/docs/stable/http/gharial-management.html#remove-an-edge-definition-from-the-graph">API
92+
* Documentation</a>
93+
*/
94+
void remove(EdgeCollectionRemoveOptions options);
95+
7196
/**
7297
* Creates a new edge in the collection
7398
*

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

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,14 +49,30 @@ public interface ArangoEdgeCollectionAsync extends ArangoSerdeAccessor {
4949

5050
/**
5151
* Asynchronous version of {@link ArangoEdgeCollection#drop()}
52+
*
53+
* @deprecated use {@link #remove()} instead
5254
*/
55+
@Deprecated
5356
CompletableFuture<Void> drop();
5457

5558
/**
5659
* Asynchronous version of {@link ArangoEdgeCollection#drop(EdgeCollectionDropOptions)}
60+
*
61+
* @deprecated use {@link #remove(EdgeCollectionRemoveOptions)} instead
5762
*/
63+
@Deprecated
5864
CompletableFuture<Void> drop(EdgeCollectionDropOptions options);
5965

66+
/**
67+
* Asynchronous version of {@link ArangoEdgeCollection#remove()}
68+
*/
69+
CompletableFuture<Void> remove();
70+
71+
/**
72+
* Asynchronous version of {@link ArangoEdgeCollection#remove(EdgeCollectionRemoveOptions)}
73+
*/
74+
CompletableFuture<Void> remove(EdgeCollectionRemoveOptions options);
75+
6076
/**
6177
* Asynchronous version of {@link ArangoEdgeCollection#insertEdge(Object)}
6278
*/

core/src/main/java/com/arangodb/ArangoVertexCollection.java

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,10 @@ public interface ArangoVertexCollection extends ArangoSerdeAccessor {
5454
*
5555
* @see <a href="https://www.arangodb.com/docs/stable/http/gharial-management.html#remove-vertex-collection">API
5656
* Documentation</a>
57+
*
58+
* @deprecated use {@link #remove()} instead
5759
*/
60+
@Deprecated
5861
void drop();
5962

6063
/**
@@ -63,9 +66,29 @@ public interface ArangoVertexCollection extends ArangoSerdeAccessor {
6366
* @param options options
6467
* @see <a href="https://www.arangodb.com/docs/stable/http/gharial-management.html#remove-vertex-collection">API
6568
* Documentation</a>
69+
*
70+
* @deprecated use {@link #remove(VertexCollectionRemoveOptions)} instead
6671
*/
72+
@Deprecated
6773
void drop(VertexCollectionDropOptions options);
6874

75+
/**
76+
* Remove a vertex collection form the graph.
77+
*
78+
* @see <a href="https://www.arangodb.com/docs/stable/http/gharial-management.html#remove-vertex-collection">API
79+
* Documentation</a>
80+
*/
81+
void remove();
82+
83+
/**
84+
* Remove a vertex collection form the graph.
85+
*
86+
* @param options options
87+
* @see <a href="https://www.arangodb.com/docs/stable/http/gharial-management.html#remove-vertex-collection">API
88+
* Documentation</a>
89+
*/
90+
void remove(VertexCollectionRemoveOptions options);
91+
6992
/**
7093
* Creates a new vertex in the collection
7194
*

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

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,14 +49,30 @@ public interface ArangoVertexCollectionAsync extends ArangoSerdeAccessor {
4949

5050
/**
5151
* Asynchronous version of {@link ArangoVertexCollection#drop()}
52+
*
53+
* @deprecated use {@link #remove()} instead
5254
*/
55+
@Deprecated
5356
CompletableFuture<Void> drop();
5457

5558
/**
5659
* Asynchronous version of {@link ArangoVertexCollection#drop(VertexCollectionDropOptions)}
60+
*
61+
* @deprecated use {@link #remove(VertexCollectionRemoveOptions)} instead
5762
*/
63+
@Deprecated
5864
CompletableFuture<Void> drop(VertexCollectionDropOptions options);
5965

66+
/**
67+
* Asynchronous version of {@link ArangoVertexCollection#remove()}
68+
*/
69+
CompletableFuture<Void> remove();
70+
71+
/**
72+
* Asynchronous version of {@link ArangoVertexCollection#remove(VertexCollectionRemoveOptions)}
73+
*/
74+
CompletableFuture<Void> remove(VertexCollectionRemoveOptions options);
75+
6076
/**
6177
* Asynchronous version of {@link ArangoVertexCollection#insertVertex(Object)}
6278
*/

core/src/main/java/com/arangodb/internal/ArangoEdgeCollectionAsyncImpl.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,16 +49,28 @@ public ArangoGraphAsync graph() {
4949
return graph;
5050
}
5151

52+
@Deprecated
5253
@Override
5354
public CompletableFuture<Void> drop() {
5455
return drop(new EdgeCollectionDropOptions());
5556
}
5657

58+
@Deprecated
5759
@Override
5860
public CompletableFuture<Void> drop(final EdgeCollectionDropOptions options) {
5961
return executorAsync().execute(() -> removeEdgeDefinitionRequest(options), Void.class);
6062
}
6163

64+
@Override
65+
public CompletableFuture<Void> remove() {
66+
return remove(new EdgeCollectionRemoveOptions());
67+
}
68+
69+
@Override
70+
public CompletableFuture<Void> remove(final EdgeCollectionRemoveOptions options) {
71+
return executorAsync().execute(() -> removeEdgeDefinitionRequest(options), Void.class);
72+
}
73+
6274
@Override
6375
public CompletableFuture<EdgeEntity> insertEdge(final Object value) {
6476
return executorAsync().execute(() -> insertEdgeRequest(value, new EdgeCreateOptions()),

core/src/main/java/com/arangodb/internal/ArangoEdgeCollectionImpl.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,16 +46,28 @@ public ArangoGraph graph() {
4646
return graph;
4747
}
4848

49+
@Deprecated
4950
@Override
5051
public void drop() {
5152
drop(new EdgeCollectionDropOptions());
5253
}
5354

55+
@Deprecated
5456
@Override
5557
public void drop(final EdgeCollectionDropOptions options) {
5658
executorSync().execute(removeEdgeDefinitionRequest(options), Void.class);
5759
}
5860

61+
@Override
62+
public void remove() {
63+
remove(new EdgeCollectionRemoveOptions());
64+
}
65+
66+
@Override
67+
public void remove(final EdgeCollectionRemoveOptions options) {
68+
executorSync().execute(removeEdgeDefinitionRequest(options), Void.class);
69+
}
70+
5971
@Override
6072
public EdgeEntity insertEdge(final Object value) {
6173
return executorSync().execute(insertEdgeRequest(value, new EdgeCreateOptions()),

core/src/main/java/com/arangodb/internal/ArangoVertexCollectionAsyncImpl.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,16 +49,28 @@ public ArangoGraphAsync graph() {
4949
return graph;
5050
}
5151

52+
@Deprecated
5253
@Override
5354
public CompletableFuture<Void> drop() {
5455
return drop(new VertexCollectionDropOptions());
5556
}
5657

58+
@Deprecated
5759
@Override
5860
public CompletableFuture<Void> drop(final VertexCollectionDropOptions options) {
5961
return executorAsync().execute(() -> dropRequest(options), Void.class);
6062
}
6163

64+
@Override
65+
public CompletableFuture<Void> remove() {
66+
return remove(new VertexCollectionRemoveOptions());
67+
}
68+
69+
@Override
70+
public CompletableFuture<Void> remove(final VertexCollectionRemoveOptions options) {
71+
return executorAsync().execute(() -> removeVertexCollectionRequest(options), Void.class);
72+
}
73+
6274
@Override
6375
public CompletableFuture<VertexEntity> insertVertex(final Object value) {
6476
return executorAsync().execute(() -> insertVertexRequest(value, new VertexCreateOptions()),

core/src/main/java/com/arangodb/internal/ArangoVertexCollectionImpl.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,16 +46,28 @@ public ArangoGraph graph() {
4646
return graph;
4747
}
4848

49+
@Deprecated
4950
@Override
5051
public void drop() {
5152
drop(new VertexCollectionDropOptions());
5253
}
5354

55+
@Deprecated
5456
@Override
5557
public void drop(final VertexCollectionDropOptions options) {
5658
executorSync().execute(dropRequest(options), Void.class);
5759
}
5860

61+
@Override
62+
public void remove() {
63+
remove(new VertexCollectionRemoveOptions());
64+
}
65+
66+
@Override
67+
public void remove(final VertexCollectionRemoveOptions options) {
68+
executorSync().execute(removeVertexCollectionRequest(options), Void.class);
69+
}
70+
5971
@Override
6072
public VertexEntity insertVertex(final Object value) {
6173
return executorSync().execute(insertVertexRequest(value, new VertexCreateOptions()),

core/src/main/java/com/arangodb/internal/InternalArangoEdgeCollection.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,19 @@ public String name() {
5555
return name;
5656
}
5757

58+
@Deprecated
5859
protected InternalRequest removeEdgeDefinitionRequest(final EdgeCollectionDropOptions options) {
5960
return request(dbName, RequestType.DELETE, PATH_API_GHARIAL, graphName, "edge", name)
6061
.putQueryParam("waitForSync", options.getWaitForSync())
6162
.putQueryParam("dropCollections", options.getDropCollections());
6263
}
6364

65+
protected InternalRequest removeEdgeDefinitionRequest(final EdgeCollectionRemoveOptions options) {
66+
return request(dbName, RequestType.DELETE, PATH_API_GHARIAL, graphName, "edge", name)
67+
.putQueryParam("waitForSync", options.getWaitForSync())
68+
.putQueryParam("dropCollections", options.getDropCollections());
69+
}
70+
6471
protected <T> InternalRequest insertEdgeRequest(final T value, final EdgeCreateOptions options) {
6572
final InternalRequest request = request(dbName, RequestType.POST, PATH_API_GHARIAL, graphName, EDGE_PATH,
6673
name);

core/src/main/java/com/arangodb/internal/InternalArangoVertexCollection.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,17 @@ public String name() {
5555
return name;
5656
}
5757

58+
@Deprecated
5859
protected InternalRequest dropRequest(final VertexCollectionDropOptions options) {
5960
return request(dbName, RequestType.DELETE, PATH_API_GHARIAL, graphName, VERTEX_PATH, name)
6061
.putQueryParam("dropCollection", options.getDropCollection());
6162
}
6263

64+
protected InternalRequest removeVertexCollectionRequest(final VertexCollectionRemoveOptions options) {
65+
return request(dbName, RequestType.DELETE, PATH_API_GHARIAL, graphName, VERTEX_PATH, name)
66+
.putQueryParam("dropCollection", options.getDropCollection());
67+
}
68+
6369
protected <T> InternalRequest insertVertexRequest(final T value, final VertexCreateOptions options) {
6470
final InternalRequest request = request(dbName, RequestType.POST, PATH_API_GHARIAL, graphName, VERTEX_PATH,
6571
name);

core/src/main/java/com/arangodb/model/EdgeCollectionDropOptions.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
package com.arangodb.model;
22

3+
/**
4+
* @deprecated use {@link EdgeCollectionRemoveOptions} instead
5+
*/
6+
@Deprecated
37
public class EdgeCollectionDropOptions {
48
private Boolean waitForSync;
59
private Boolean dropCollections;
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
package com.arangodb.model;
2+
3+
public class EdgeCollectionRemoveOptions {
4+
private Boolean waitForSync;
5+
private Boolean dropCollections;
6+
7+
public Boolean getWaitForSync() {
8+
return waitForSync;
9+
}
10+
11+
/**
12+
* @param waitForSync Define if the request should wait until synced to disk.
13+
* @return this
14+
*/
15+
public EdgeCollectionRemoveOptions waitForSync(Boolean waitForSync) {
16+
this.waitForSync = waitForSync;
17+
return this;
18+
}
19+
20+
public Boolean getDropCollections() {
21+
return dropCollections;
22+
}
23+
24+
/**
25+
* @param dropCollections Drop the collection as well. Collection will only be dropped if it is not used in other
26+
* graphs.
27+
* @return this
28+
*/
29+
public EdgeCollectionRemoveOptions dropCollections(Boolean dropCollections) {
30+
this.dropCollections = dropCollections;
31+
return this;
32+
}
33+
}

core/src/main/java/com/arangodb/model/VertexCollectionDropOptions.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,10 @@
33
/**
44
* @see <a href="https://www.arangodb.com/docs/stable/http/gharial-management.html#remove-vertex-collection">API
55
* Documentation</a>
6+
*
7+
* @deprecated use {@link VertexCollectionRemoveOptions} instead
68
*/
9+
@Deprecated
710
public class VertexCollectionDropOptions {
811
private Boolean dropCollection;
912

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
package com.arangodb.model;
2+
3+
/**
4+
* @see <a href="https://www.arangodb.com/docs/stable/http/gharial-management.html#remove-vertex-collection">API
5+
* Documentation</a>
6+
*/
7+
public class VertexCollectionRemoveOptions {
8+
private Boolean dropCollection;
9+
10+
public Boolean getDropCollection() {
11+
return dropCollection;
12+
}
13+
14+
/**
15+
* @param dropCollection Drop the collection as well. Collection will only be dropped if it is not used in other
16+
* graphs.
17+
* @return this
18+
*/
19+
public VertexCollectionRemoveOptions dropCollection(Boolean dropCollection) {
20+
this.dropCollection = dropCollection;
21+
return this;
22+
}
23+
}

0 commit comments

Comments
 (0)