Skip to content

Commit 1ec1b58

Browse files
author
Mark
committed
added some javadoc
1 parent 7a1c016 commit 1ec1b58

File tree

4 files changed

+63
-3
lines changed

4 files changed

+63
-3
lines changed

src/main/java/com/arangodb/ArangoCursor.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,9 @@ public ArangoCursor(final InternalArangoDatabase<?, ?, ?> db, final ArangoCursor
6161
id = result.getId();
6262
}
6363

64+
/**
65+
* @return id of temporary cursor created on the server
66+
*/
6467
public String getId() {
6568
return id;
6669
}
@@ -69,6 +72,10 @@ public Class<T> getType() {
6972
return type;
7073
}
7174

75+
/**
76+
* @return the total number of result documents available (only available if the query was executed with the count
77+
* attribute set)
78+
*/
7279
public Integer getCount() {
7380
return count;
7481
}
@@ -81,6 +88,9 @@ public Collection<Warning> getWarnings() {
8188
return extra != null ? extra.getWarnings() : null;
8289
}
8390

91+
/**
92+
* @return indicating whether the query result was served from the query cache or not
93+
*/
8494
public boolean isCached() {
8595
return cached;
8696
}

src/main/java/com/arangodb/ArangoDB.java

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,12 @@
3131
import com.arangodb.entity.LogEntity;
3232
import com.arangodb.entity.UserEntity;
3333
import com.arangodb.internal.ArangoDBConstants;
34-
import com.arangodb.internal.InternalArangoDB;
3534
import com.arangodb.internal.ArangoExecutor.ResponseDeserializer;
3635
import com.arangodb.internal.ArangoExecutorSync;
3736
import com.arangodb.internal.CollectionCache;
3837
import com.arangodb.internal.CollectionCache.DBAccess;
3938
import com.arangodb.internal.DocumentCache;
39+
import com.arangodb.internal.InternalArangoDB;
4040
import com.arangodb.internal.velocypack.VPackConfigure;
4141
import com.arangodb.internal.velocystream.Communication;
4242
import com.arangodb.internal.velocystream.CommunicationSync;
@@ -209,10 +209,22 @@ public void shutdown() {
209209
executor.communication().disconnect();
210210
}
211211

212+
/**
213+
* Returns a handler of the system database
214+
*
215+
* @return database handler
216+
*/
212217
public ArangoDatabase db() {
213218
return db(ArangoDBConstants.SYSTEM);
214219
}
215220

221+
/**
222+
* Returns a handler of the database by the given name
223+
*
224+
* @param name
225+
* Name of the database
226+
* @return database handler
227+
*/
216228
public ArangoDatabase db(final String name) {
217229
return new ArangoDatabase(this, name);
218230
}
@@ -371,7 +383,15 @@ public UserEntity replaceUser(final String user, final UserUpdateOptions options
371383
return executor.execute(replaceUserRequest(db().name(), user, options), UserEntity.class);
372384
}
373385

374-
public Response execute(final Request request) {
386+
/**
387+
* Generic Execute. Use this method to execute custom FOXX services.
388+
*
389+
* @param request
390+
* VelocyStream request
391+
* @return VelocyStream response
392+
* @throws ArangoDBException
393+
*/
394+
public Response execute(final Request request) throws ArangoDBException {
375395
return executor.execute(request, new ResponseDeserializer<Response>() {
376396
@Override
377397
public Response deserialize(final Response response) throws VPackException {

src/main/java/com/arangodb/ArangoDatabase.java

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,10 @@
3737
import com.arangodb.entity.QueryTrackingPropertiesEntity;
3838
import com.arangodb.entity.TraversalEntity;
3939
import com.arangodb.internal.ArangoCursorExecute;
40-
import com.arangodb.internal.InternalArangoDatabase;
4140
import com.arangodb.internal.ArangoExecutorSync;
4241
import com.arangodb.internal.CollectionCache;
4342
import com.arangodb.internal.DocumentCache;
43+
import com.arangodb.internal.InternalArangoDatabase;
4444
import com.arangodb.internal.velocystream.Communication;
4545
import com.arangodb.internal.velocystream.ConnectionSync;
4646
import com.arangodb.model.AqlFunctionCreateOptions;
@@ -81,6 +81,13 @@ protected ArangoExecutorSync executor() {
8181
return executor;
8282
}
8383

84+
/**
85+
* Returns a handler of the collection by the given name
86+
*
87+
* @param name
88+
* Name of the collection
89+
* @return collection handler
90+
*/
8491
public ArangoCollection collection(final String name) {
8592
return new ArangoCollection(this, name);
8693
}
@@ -233,10 +240,12 @@ public <T> ArangoCursor<T> query(
233240
final Request request = queryRequest(query, bindVars, options);
234241
final CursorEntity result = executor.execute(request, CursorEntity.class);
235242
return new ArangoCursor<T>(this, new ArangoCursorExecute() {
243+
@Override
236244
public CursorEntity next(final String id) {
237245
return executor.execute(queryNextRequest(id), CursorEntity.class);
238246
}
239247

248+
@Override
240249
public void close(final String id) {
241250
executor.execute(queryCloseRequest(id), Void.class);
242251
}
@@ -453,6 +462,13 @@ public Collection<AqlFunctionEntity> getAqlFunctions(final AqlFunctionGetOptions
453462
}.getType());
454463
}
455464

465+
/**
466+
* Returns a handler of the graph by the given name
467+
*
468+
* @param name
469+
* Name of the graph
470+
* @return graph handler
471+
*/
456472
public ArangoGraph graph(final String name) {
457473
return new ArangoGraph(this, name);
458474
}

src/main/java/com/arangodb/ArangoGraph.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,10 +91,24 @@ public GraphEntity addVertexCollection(final String name) throws ArangoDBExcepti
9191
return executor.execute(addVertexCollectionRequest(name), addVertexCollectionResponseDeserializer());
9292
}
9393

94+
/**
95+
* Returns a handler of the vertex collection by the given name
96+
*
97+
* @param name
98+
* Name of the vertex collection
99+
* @return collection handler
100+
*/
94101
public ArangoVertexCollection vertexCollection(final String name) {
95102
return new ArangoVertexCollection(this, name);
96103
}
97104

105+
/**
106+
* Returns a handler of the edge collection by the given name
107+
*
108+
* @param name
109+
* Name of the edge collection
110+
* @return collection handler
111+
*/
98112
public ArangoEdgeCollection edgeCollection(final String name) {
99113
return new ArangoEdgeCollection(this, name);
100114
}

0 commit comments

Comments
 (0)