Skip to content

Commit 817fa3d

Browse files
author
Mark
committed
Merge remote-tracking branch 'origin/3.0'
2 parents 944eb00 + 5eb6e31 commit 817fa3d

35 files changed

+1350
-140
lines changed

ChangeLog

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
1-
v3.0.0 (2016-XX-XX)
1+
v3.0.0 (2016-06-17)
22
---------------------------
33
* removed ArangoDriver.EdgeEntity() (/_api/edge withdrawn in Server)
44
* removed CAP-Index (Cap-constraints are withdrawn in Server)
5+
* removed Param database in User-Methods (in 3.0 users are managed in _users Collection in _system Database only)
6+
* added User-Method grantDatabaseAccess(username, database)
7+
* replaced Graph-Functions (graph_edge, graph_vertices, graph_shortes_path) with AQL
8+
* removed deprecated Methods
9+
* added Transaction attribute allowImplicit
10+
* refactored QueryCachePropertiesEntity, TransactionResultEntity
511

612
v2.7.4 (2016-04-15)
713
---------------------------

pom.xml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
<groupId>com.arangodb</groupId>
66
<artifactId>arangodb-java-driver</artifactId>
7-
<version>3.0.0-SNAPSHOT</version>
7+
<version>3.0.1-SNAPSHOT</version>
88
<inceptionYear>2012</inceptionYear>
99
<packaging>jar</packaging>
1010

@@ -41,6 +41,11 @@
4141
<name>a-brandt</name>
4242
<url>https://github.com/a-brandt</url>
4343
</developer>
44+
<developer>
45+
<id>mpv1989</id>
46+
<name>Mark</name>
47+
<url>https://github.com/mpv1989</url>
48+
</developer>
4449
</developers>
4550

4651
<distributionManagement>

src/main/java/com/arangodb/ArangoClient.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@ private void importDocumentsImpl(String collectionName, List<String> values, Imp
4242
total.setCreated(total.getCreated() + result.getCreated());
4343
total.setErrors(total.getErrors() + result.getErrors());
4444
total.setEmpty(total.getEmpty() + result.getEmpty());
45+
total.setUpdated(total.getUpdated() + result.getUpdated());
46+
total.setIgnored(total.getIgnored() + result.getIgnored());
47+
total.getDetails().addAll(result.getDetails());
4548
}
4649

4750
public ImportResultEntity importRawJsonDocuments(String collectionName, Iterator<String> itr, int bufferCount)

src/main/java/com/arangodb/ArangoDriver.java

Lines changed: 158 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,9 @@
8181
import com.arangodb.util.GraphEdgesOptions;
8282
import com.arangodb.util.GraphQueryUtil;
8383
import com.arangodb.util.GraphVerticesOptions;
84+
import com.arangodb.util.ImportOptions;
85+
import com.arangodb.util.ImportOptionsJson;
86+
import com.arangodb.util.ImportOptionsRaw;
8487
import com.arangodb.util.MapBuilder;
8588
import com.arangodb.util.ShortestPathOptions;
8689
import com.arangodb.util.TraversalQueryOptions;
@@ -947,8 +950,6 @@ public <T> DocumentEntity<T> createDocument(final String collectionName, final T
947950
* the desired document key
948951
* @param value
949952
* An object containing the documents attributes
950-
* @param createCollection
951-
* if set to true the collection is created if it does not exist
952953
* @param waitForSync
953954
* if set to true the response is returned when the server has
954955
* finished.
@@ -975,8 +976,6 @@ public DocumentEntity<?> createDocument(
975976
* the desired document key
976977
* @param value
977978
* An object containing the documents attributes
978-
* @param createCollection
979-
* if set to true the collection is created if it does not exist
980979
* @param waitForSync
981980
* if set to true the response is returned when the server has
982981
* finished.
@@ -2936,7 +2935,7 @@ public UserEntity getUser(final String username) throws ArangoException {
29362935
* @param username
29372936
* the username as string
29382937
* @param database
2939-
* @return
2938+
* @return a DefaultEntity object
29402939
* @throws ArangoException
29412940
*/
29422941
public DefaultEntity grantDatabaseAccess(String username, String database) throws ArangoException {
@@ -2968,7 +2967,7 @@ public List<UserEntity> getUsers() throws ArangoException {
29682967
}
29692968

29702969
/**
2971-
* Creates documents in the collection.
2970+
* Creates documents in a collection.
29722971
*
29732972
* @param collection
29742973
* the collection as a string
@@ -2979,11 +2978,49 @@ public List<UserEntity> getUsers() throws ArangoException {
29792978
*/
29802979
public ImportResultEntity importDocuments(final String collection, final Collection<?> values)
29812980
throws ArangoException {
2982-
return importDriver.importDocuments(getDefaultDatabase(), collection, values);
2981+
return importDriver.importDocuments(getDefaultDatabase(), collection, values, new ImportOptionsJson());
2982+
}
2983+
2984+
/**
2985+
* Creates documents in a collection.
2986+
*
2987+
* @param collection
2988+
* the collection as a string
2989+
* @param values
2990+
* a list of Objects that will be stored as documents
2991+
* @param importOptionsJson
2992+
* options for importing documents
2993+
* @return ImportResultEntity
2994+
* @throws ArangoException
2995+
*/
2996+
public ImportResultEntity importDocuments(
2997+
final String collection,
2998+
final Collection<?> values,
2999+
final ImportOptionsJson importOptionsJson) throws ArangoException {
3000+
return importDriver.importDocuments(getDefaultDatabase(), collection, values, importOptionsJson);
3001+
}
3002+
3003+
/**
3004+
* Creates documents in a collection.
3005+
*
3006+
* @param collection
3007+
* the collection as a string
3008+
* @param values
3009+
* a raw string containing JSON data
3010+
* @param importOptions
3011+
* options for importing documents
3012+
* @return ImportResultEntity
3013+
* @throws ArangoException
3014+
*/
3015+
public ImportResultEntity importDocumentsRaw(
3016+
final String collection,
3017+
final String values,
3018+
final ImportOptionsRaw importOptionsRaw) throws ArangoException {
3019+
return importDriver.importDocumentsRaw(getDefaultDatabase(), collection, values, importOptionsRaw);
29833020
}
29843021

29853022
/**
2986-
* Creates documents in the collection.
3023+
* Creates documents in a collection.
29873024
*
29883025
* @param collection
29893026
* the collection as a string
@@ -2995,7 +3032,49 @@ public ImportResultEntity importDocuments(final String collection, final Collect
29953032
public ImportResultEntity importDocumentsByHeaderValues(
29963033
final String collection,
29973034
final Collection<? extends Collection<?>> headerValues) throws ArangoException {
2998-
return importDriver.importDocumentsByHeaderValues(getDefaultDatabase(), collection, headerValues);
3035+
return importDriver.importDocumentsByHeaderValues(getDefaultDatabase(), collection, headerValues,
3036+
new ImportOptions());
3037+
}
3038+
3039+
/**
3040+
* Creates documents in a collection.
3041+
*
3042+
* @param collection
3043+
* the collection as a string
3044+
* @param headerValues
3045+
* a list of lists that will be stored as documents
3046+
* @param importOptions
3047+
* options for importing documents
3048+
* @return ImportResultEntity
3049+
* @throws ArangoException
3050+
*/
3051+
public ImportResultEntity importDocumentsByHeaderValues(
3052+
final String collection,
3053+
final Collection<? extends Collection<?>> headerValues,
3054+
ImportOptions importOptions) throws ArangoException {
3055+
return importDriver.importDocumentsByHeaderValues(getDefaultDatabase(), collection, headerValues,
3056+
importOptions);
3057+
}
3058+
3059+
/**
3060+
* Creates documents in a collection.
3061+
*
3062+
* @param collection
3063+
* the collection as a string
3064+
* @param headerValues
3065+
* raw JSON data that contains a list of lists that will be
3066+
* stored as documents
3067+
* @param importOptions
3068+
* options for importing documents
3069+
* @return ImportResultEntity
3070+
* @throws ArangoException
3071+
*/
3072+
public ImportResultEntity importDocumentsByHeaderValuesRaw(
3073+
final String collection,
3074+
String headerValues,
3075+
ImportOptions importOptions) throws ArangoException {
3076+
return importDriver.importDocumentsByHeaderValuesRaw(getDefaultDatabase(), collection, headerValues,
3077+
importOptions);
29993078
}
30003079

30013080
/**
@@ -4369,6 +4448,7 @@ public <T> VertexCursor<T> executeVertexQuery(
43694448
/**
43704449
* Returns an EdgeCursor by a given vertex example and some options
43714450
*
4451+
* @deprecated use AQL instead
43724452
* @param graphName
43734453
* The name of the graph.
43744454
* @param clazz
@@ -4381,6 +4461,7 @@ public <T> VertexCursor<T> executeVertexQuery(
43814461
* @return EdgeCursor<T>
43824462
* @throws ArangoException
43834463
*/
4464+
@Deprecated
43844465
@SuppressWarnings("unchecked")
43854466
public <T> EdgeCursor<T> graphGetEdgeCursor(
43864467
final String graphName,
@@ -4415,6 +4496,7 @@ public <T> EdgeCursor<T> graphGetEdgeCursor(
44154496
/**
44164497
* Returns a VertexCursor by a given vertex example and some options
44174498
*
4499+
* @deprecated use AQL instead
44184500
* @param graphName
44194501
* The name of the graph.
44204502
* @param clazz
@@ -4427,6 +4509,7 @@ public <T> EdgeCursor<T> graphGetEdgeCursor(
44274509
* @return VertexCursor<T>
44284510
* @throws ArangoException
44294511
*/
4512+
@Deprecated
44304513
public <T> VertexCursor<T> graphGetVertexCursor(
44314514
final String graphName,
44324515
final Class<T> clazz,
@@ -4481,6 +4564,10 @@ public <T> EdgeCursor<T> graphGetEdgeCursorByExample(
44814564
return graphGetEdgeCursor(graphName, clazz, vertexExample, new GraphEdgesOptions(), null);
44824565
}
44834566

4567+
/**
4568+
* @deprecated use AQL instead
4569+
*/
4570+
@Deprecated
44844571
public <V, E> ShortestPathEntity<V, E> graphGetShortestPath(
44854572
final String graphName,
44864573
final Object startVertexExample,
@@ -4564,6 +4651,64 @@ public TransactionResultEntity executeTransaction(final TransactionEntity transa
45644651
return this.transactionDriver.executeTransaction(getDefaultDatabase(), transactionEntity);
45654652
}
45664653

4654+
/**
4655+
* Create an edge in an edge collection.
4656+
*
4657+
* @param collectionName
4658+
* name of the edge collection
4659+
* @param value
4660+
* the edge object
4661+
* @param fromHandle
4662+
* id of document 'from'
4663+
* @param toHandle
4664+
* id of document 'to'
4665+
* @param waitForSync
4666+
* wait for sync
4667+
* @return the new created EdgeEntity object
4668+
* @throws ArangoException
4669+
*/
4670+
public <T> EdgeEntity<T> createEdge(
4671+
final String collectionName,
4672+
final T value,
4673+
final String fromHandle,
4674+
final String toHandle,
4675+
final Boolean waitForSync) throws ArangoException {
4676+
4677+
return createEdge(collectionName, null, value, fromHandle, toHandle, waitForSync);
4678+
}
4679+
4680+
/**
4681+
* Create an edge in an edge collection. This method allows to define to
4682+
* documents key. Note that the collection's property
4683+
* CollectionKeyOption.allowUserKeys has to be set accordingly.
4684+
*
4685+
* @param collectionName
4686+
* name of the edge collection
4687+
* @param documentKey
4688+
* the desired document key
4689+
* @param value
4690+
* the edge object
4691+
* @param fromHandle
4692+
* id of document 'from'
4693+
* @param toHandle
4694+
* id of document 'to'
4695+
* @param waitForSync
4696+
* wait for sync
4697+
* @return the new created EdgeEntity object
4698+
* @throws ArangoException
4699+
*/
4700+
public <T> EdgeEntity<T> createEdge(
4701+
final String collectionName,
4702+
final String documentKey,
4703+
final T value,
4704+
final String fromHandle,
4705+
final String toHandle,
4706+
final Boolean waitForSync) throws ArangoException {
4707+
4708+
return documentDriver.createEdge(getDefaultDatabase(), collectionName, documentKey, value, fromHandle, toHandle,
4709+
waitForSync);
4710+
}
4711+
45674712
/**
45684713
* Do a graph traversal.
45694714
*
@@ -4688,7 +4833,7 @@ public QueriesResultEntity getSlowQueries(final String database) throws ArangoEx
46884833
/**
46894834
* Clears the list of slow AQL queries of the default database
46904835
*
4691-
* @return
4836+
* @return a DefaultEntity object
46924837
* @throws ArangoException
46934838
*/
46944839
public DefaultEntity deleteSlowQueries() throws ArangoException {
@@ -4700,7 +4845,7 @@ public DefaultEntity deleteSlowQueries() throws ArangoException {
47004845
*
47014846
* @param database
47024847
* the database name or null
4703-
* @return
4848+
* @return a DefaultEntity object
47044849
* @throws ArangoException
47054850
*/
47064851
public DefaultEntity deleteSlowQueries(final String database) throws ArangoException {
@@ -4712,7 +4857,7 @@ public DefaultEntity deleteSlowQueries(final String database) throws ArangoExcep
47124857
*
47134858
* @param id
47144859
* the identifier of a query
4715-
* @return
4860+
* @return a DefaultEntity object
47164861
* @throws ArangoException
47174862
*/
47184863
public DefaultEntity killQuery(final String id) throws ArangoException {
@@ -4726,7 +4871,7 @@ public DefaultEntity killQuery(final String id) throws ArangoException {
47264871
* the identifier of a query
47274872
* @param database
47284873
* the database name or null
4729-
* @return
4874+
* @return a DefaultEntity object
47304875
* @throws ArangoException
47314876
*/
47324877
public DefaultEntity killQuery(final String database, final String id) throws ArangoException {
@@ -4749,8 +4894,6 @@ public HttpManager getHttpManager() {
47494894
* The name of the collection
47504895
* @param rawJsonString
47514896
* A string containing a JSON object
4752-
* @param createCollection
4753-
* if set to true the collection is created if it does not exist
47544897
* @param waitForSync
47554898
* if set to true the response is returned when the server has
47564899
* finished.

src/main/java/com/arangodb/InternalDocumentDriver.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import java.util.List;
44

55
import com.arangodb.entity.DocumentEntity;
6+
import com.arangodb.entity.EdgeEntity;
67
import com.arangodb.impl.BaseDriverInterface;
78

89
/**
@@ -67,4 +68,14 @@ String getDocumentRaw(String database, String documentHandle, Long ifNoneMatchRe
6768
throws ArangoException;
6869

6970
DocumentEntity<?> deleteDocument(String database, String documentHandle, Long rev) throws ArangoException;
71+
72+
<T> EdgeEntity<T> createEdge(
73+
String database,
74+
String collectionName,
75+
String documentKey,
76+
T value,
77+
String fromHandle,
78+
String toHandle,
79+
Boolean waitForSync) throws ArangoException;
80+
7081
}

0 commit comments

Comments
 (0)