81
81
import com .arangodb .util .GraphEdgesOptions ;
82
82
import com .arangodb .util .GraphQueryUtil ;
83
83
import com .arangodb .util .GraphVerticesOptions ;
84
+ import com .arangodb .util .ImportOptions ;
85
+ import com .arangodb .util .ImportOptionsJson ;
86
+ import com .arangodb .util .ImportOptionsRaw ;
84
87
import com .arangodb .util .MapBuilder ;
85
88
import com .arangodb .util .ShortestPathOptions ;
86
89
import com .arangodb .util .TraversalQueryOptions ;
@@ -947,8 +950,6 @@ public <T> DocumentEntity<T> createDocument(final String collectionName, final T
947
950
* the desired document key
948
951
* @param value
949
952
* An object containing the documents attributes
950
- * @param createCollection
951
- * if set to true the collection is created if it does not exist
952
953
* @param waitForSync
953
954
* if set to true the response is returned when the server has
954
955
* finished.
@@ -975,8 +976,6 @@ public DocumentEntity<?> createDocument(
975
976
* the desired document key
976
977
* @param value
977
978
* An object containing the documents attributes
978
- * @param createCollection
979
- * if set to true the collection is created if it does not exist
980
979
* @param waitForSync
981
980
* if set to true the response is returned when the server has
982
981
* finished.
@@ -2936,7 +2935,7 @@ public UserEntity getUser(final String username) throws ArangoException {
2936
2935
* @param username
2937
2936
* the username as string
2938
2937
* @param database
2939
- * @return
2938
+ * @return a DefaultEntity object
2940
2939
* @throws ArangoException
2941
2940
*/
2942
2941
public DefaultEntity grantDatabaseAccess (String username , String database ) throws ArangoException {
@@ -2968,7 +2967,7 @@ public List<UserEntity> getUsers() throws ArangoException {
2968
2967
}
2969
2968
2970
2969
/**
2971
- * Creates documents in the collection.
2970
+ * Creates documents in a collection.
2972
2971
*
2973
2972
* @param collection
2974
2973
* the collection as a string
@@ -2979,11 +2978,49 @@ public List<UserEntity> getUsers() throws ArangoException {
2979
2978
*/
2980
2979
public ImportResultEntity importDocuments (final String collection , final Collection <?> values )
2981
2980
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 );
2983
3020
}
2984
3021
2985
3022
/**
2986
- * Creates documents in the collection.
3023
+ * Creates documents in a collection.
2987
3024
*
2988
3025
* @param collection
2989
3026
* the collection as a string
@@ -2995,7 +3032,49 @@ public ImportResultEntity importDocuments(final String collection, final Collect
2995
3032
public ImportResultEntity importDocumentsByHeaderValues (
2996
3033
final String collection ,
2997
3034
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 );
2999
3078
}
3000
3079
3001
3080
/**
@@ -4369,6 +4448,7 @@ public <T> VertexCursor<T> executeVertexQuery(
4369
4448
/**
4370
4449
* Returns an EdgeCursor by a given vertex example and some options
4371
4450
*
4451
+ * @deprecated use AQL instead
4372
4452
* @param graphName
4373
4453
* The name of the graph.
4374
4454
* @param clazz
@@ -4381,6 +4461,7 @@ public <T> VertexCursor<T> executeVertexQuery(
4381
4461
* @return EdgeCursor<T>
4382
4462
* @throws ArangoException
4383
4463
*/
4464
+ @ Deprecated
4384
4465
@ SuppressWarnings ("unchecked" )
4385
4466
public <T > EdgeCursor <T > graphGetEdgeCursor (
4386
4467
final String graphName ,
@@ -4415,6 +4496,7 @@ public <T> EdgeCursor<T> graphGetEdgeCursor(
4415
4496
/**
4416
4497
* Returns a VertexCursor by a given vertex example and some options
4417
4498
*
4499
+ * @deprecated use AQL instead
4418
4500
* @param graphName
4419
4501
* The name of the graph.
4420
4502
* @param clazz
@@ -4427,6 +4509,7 @@ public <T> EdgeCursor<T> graphGetEdgeCursor(
4427
4509
* @return VertexCursor<T>
4428
4510
* @throws ArangoException
4429
4511
*/
4512
+ @ Deprecated
4430
4513
public <T > VertexCursor <T > graphGetVertexCursor (
4431
4514
final String graphName ,
4432
4515
final Class <T > clazz ,
@@ -4481,6 +4564,10 @@ public <T> EdgeCursor<T> graphGetEdgeCursorByExample(
4481
4564
return graphGetEdgeCursor (graphName , clazz , vertexExample , new GraphEdgesOptions (), null );
4482
4565
}
4483
4566
4567
+ /**
4568
+ * @deprecated use AQL instead
4569
+ */
4570
+ @ Deprecated
4484
4571
public <V , E > ShortestPathEntity <V , E > graphGetShortestPath (
4485
4572
final String graphName ,
4486
4573
final Object startVertexExample ,
@@ -4564,6 +4651,64 @@ public TransactionResultEntity executeTransaction(final TransactionEntity transa
4564
4651
return this .transactionDriver .executeTransaction (getDefaultDatabase (), transactionEntity );
4565
4652
}
4566
4653
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
+
4567
4712
/**
4568
4713
* Do a graph traversal.
4569
4714
*
@@ -4688,7 +4833,7 @@ public QueriesResultEntity getSlowQueries(final String database) throws ArangoEx
4688
4833
/**
4689
4834
* Clears the list of slow AQL queries of the default database
4690
4835
*
4691
- * @return
4836
+ * @return a DefaultEntity object
4692
4837
* @throws ArangoException
4693
4838
*/
4694
4839
public DefaultEntity deleteSlowQueries () throws ArangoException {
@@ -4700,7 +4845,7 @@ public DefaultEntity deleteSlowQueries() throws ArangoException {
4700
4845
*
4701
4846
* @param database
4702
4847
* the database name or null
4703
- * @return
4848
+ * @return a DefaultEntity object
4704
4849
* @throws ArangoException
4705
4850
*/
4706
4851
public DefaultEntity deleteSlowQueries (final String database ) throws ArangoException {
@@ -4712,7 +4857,7 @@ public DefaultEntity deleteSlowQueries(final String database) throws ArangoExcep
4712
4857
*
4713
4858
* @param id
4714
4859
* the identifier of a query
4715
- * @return
4860
+ * @return a DefaultEntity object
4716
4861
* @throws ArangoException
4717
4862
*/
4718
4863
public DefaultEntity killQuery (final String id ) throws ArangoException {
@@ -4726,7 +4871,7 @@ public DefaultEntity killQuery(final String id) throws ArangoException {
4726
4871
* the identifier of a query
4727
4872
* @param database
4728
4873
* the database name or null
4729
- * @return
4874
+ * @return a DefaultEntity object
4730
4875
* @throws ArangoException
4731
4876
*/
4732
4877
public DefaultEntity killQuery (final String database , final String id ) throws ArangoException {
@@ -4749,8 +4894,6 @@ public HttpManager getHttpManager() {
4749
4894
* The name of the collection
4750
4895
* @param rawJsonString
4751
4896
* A string containing a JSON object
4752
- * @param createCollection
4753
- * if set to true the collection is created if it does not exist
4754
4897
* @param waitForSync
4755
4898
* if set to true the response is returned when the server has
4756
4899
* finished.
0 commit comments