8000 api started · anderick/arangodb-java-driver@1ca67a8 · GitHub
[go: up one dir, main page]

Skip to content

Commit 1ca67a8

Browse files
author
Mark
committed
api started
1 parent 7a58bf9 commit 1ca67a8

File tree

5 files changed

+193
-2
lines changed

5 files changed

+193
-2
lines changed

pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,8 @@
116116
<artifactId>maven-compiler-plugin</artifactId>
117117
<version>3.2</version>
118118
<configuration>
119-
<source>1.6</source>
120-
<target>1.6</target>
119+
<source>1.8</source>
120+
<target>1.8</target>
121121
<compilerArgument></compilerArgument>
122122
</configuration>
123123
</plugin>
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
package com.arangodb;
2+
3+
import com.arangodb.model.Database;
4+
5+
/**
6+
* @author Mark - mark at arangodb.com
7+
*
8+
*/
9+
public class ArangoDB {
10+
11+
private static final String SYSTEM_DB = "_system";
12+
13+
public Database db() {
14+
return new Database(SYSTEM_DB);
15+
}
16+
17+
public Database db(final String name) {
18+
return new Database(name);
19+
}
20+
21+
public static void main(final String[] args) {
22+
new ArangoDB().db().collection("").document("").async().create(callback);
23+
}
24+
25+
}
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
package com.arangodb.model;
2+
3+
import java.util.List;
4+
import java.util.Optional;
5+
6+
import com.arangodb.ArangoException;
7+
import com.arangodb.entity.CollectionEntity;
8+
import com.arangodb.entity.CollectionType;
9+
10+
/**
11+
* @author Mark - mark at arangodb.com
12+
*
13+
*/
14+
public class Collection {
15+
16+
private final Database db;
17+
private final String name;
18+
19+
private final Optional<Boolean> waitForSync = Optional.empty();
20+
private final Optional<Boolean> doCompact = Optional.empty();
21+
private final Optional<Integer> journalSize = Optional.empty();
22+
private final Optional<Boolean> isSystem = Optional.empty();
23+
private final Optional<Boolean> isVolatile = Optional.empty();
24+
private final Optional<CollectionType> type = Optional.empty();
25+
// private CollectionKeyOption keyOptions;
26+
private final Optional<Integer> numberOfShards = Optional.empty();
27+
private final Optional<List<String>> shardKeys = Optional.empty();
28+
29+
protected Collection(final Database db, final String name) {
30+
super();
31+
this.db = db;
32+
this.name = name;
33+
}
34+
35+
public Document document(final String key) {
36+
return new Document(this, key);
37+
}
38+
39+
public CollectionEntity create() throws ArangoException {
40+
return null;
41+
}
42+
43+
public CollectionEntity get() throws ArangoException {
44+
return null;
45+
}
46+
47+
public CollectionEntity getProperties() throws ArangoException {
48+
return null;
49+
}
50+
51+
public CollectionEntity getRevision() throws ArangoException {
52+
return null;
53+
}
54+
55+
public CollectionEntity getCount() throws ArangoException {
56+
return null;
57+
}
58+
59+
public CollectionEntity getFigures() throws ArangoException {
60+
return null;
61+
}
62+
63+
public CollectionEntity getChecksum() throws ArangoException {
64+
return null;
65+
}
66+
67+
public CollectionEntity load() throws ArangoException {
68+
return null;
69+
}
70+
71+
public CollectionEntity unload() throws ArangoException {
72+
return null;
73+
}
74+
75+
public CollectionEntity truncate() throws ArangoException {
76+
return null;
77+
}
78+
79+
public CollectionEntity rename(final String newName) throws ArangoException {
80+
return null;
81+
}
82+
83+
public CollectionEntity delete() throws ArangoException {
84+
return null;
85+
}
86+
87+
}
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
package com.arangodb.model;
2+
3+
import com.arangodb.ArangoException;
4+
import com.arangodb.entity.BooleanResultEntity;
5+
6+
/**
7+
* @author Mark - mark at arangodb.com
8+
*
9+
*/
10+
public class Database {
11+
12+
private final String name;
13+
14+
public Database(final String name) {
15+
super();
16+
this.name = name;
17+
}
18+
19+
public Collection collection(final String name) {
20+
return new Collection(this, name);
21+
}
22+
23+
public BooleanResultEntity create() throws ArangoException {
24+
return null;
25+
}
26+
27+
public BooleanResultEntity delete() throws ArangoException {
28+
return null;
29+
}
30+
31+
}
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
package com.arangodb.model;
2+
3+
import java.util.Optional;
4+
5+
import com.arangodb.ArangoException;
6+
import com.arangodb.entity.DocumentEntity;
7+
8+
/**
9+
* @author Mark - mark at arangodb.com
10+
*
11+
*/
12+
public class Document {
13+
14+
private final Collection collection;
15+
private final String key;
16+
17+
private Optional<Boolean> waitForSync = Optional.empty();
18+
private Optional<String> rev = Optional.empty();
19+
private final Optional<Boolean> keepNull = Optional.empty();
20+
21+
protected Document(final Collection collection, final String key) {
22+
super();
23+
this.collection = collection;
24+
this.key = key;
25+
}
26+
27+
public <T> DocumentEntity<T> create(final T value) throws ArangoException {
28+
return null;
29+
}
30+
31+
public <T> DocumentEntity<T> replace(final T value) throws ArangoException {
32+
return null;
33+
}
34+
35+
public <T> DocumentEntity<T> update(final T value) throws ArangoException {
36+
return null;
37+
}
38+
39+
public Document rev(final String rev) {
40+
this.rev = Optional.of(rev);
41+
return this;
42+
}
43+
44+
public Document waitForSync(final Boolean waitForSync) {
45+
this.waitForSync = Optional.of(waitForSync);
46+
return this;
47+
}
48+
}

0 commit comments

Comments
 (0)
0