Skip to content

Commit d50fd8f

Browse files
committed
more apidocs and fixed bug in IndexEntity
1 parent 62c42e4 commit d50fd8f

9 files changed

+206
-17
lines changed

src/main/java/com/arangodb/entity/EntityDeserializers.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -643,8 +643,8 @@ public IndexEntity deserialize(JsonElement json, Type typeOfT, JsonDeserializati
643643
entity.fields = context.deserialize(obj.getAsJsonArray("fields"), fieldsType);
644644
}
645645

646-
if (obj.has("getJson")) {
647-
entity.getJson = obj.getAsJsonPrimitive("getJson").getAsBoolean();
646+
if (obj.has("geoJson")) {
647+
entity.geoJson = obj.getAsJsonPrimitive("geoJson").getAsBoolean();
648648
}
649649

650650
if (obj.has("isNewlyCreated")) {

src/main/java/com/arangodb/entity/IndexEntity.java

Lines changed: 41 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,20 +19,55 @@
1919
import java.util.List;
2020

2121
/**
22+
* An entity representing an index on a collection
23+
*
2224
* @author tamtam180 - kirscheless at gmail.com
2325
*
2426
*/
2527
public class IndexEntity extends BaseEntity {
2628

29+
/**
30+
* the index id
31+
*/
2732
String id;
33+
34+
/**
35+
* the type of the index
36+
* @see com.arangodb.entity.IndexType
37+
*/
2838
IndexType type;
39+
40+
/**
41+
* the fields the index is defined on
42+
*/
2943
List<String> fields;
30-
boolean getJson;
44+
45+
/**
46+
* if the index is a geoIndex and *geoJson* is true, then the order within the list is longitude followed by latitude.
47+
* This corresponds to the format described in http://geojson.org/geojson-spec.html#positions
48+
*/
49+
boolean geoJson;
50+
51+
/**
52+
* is a newly created index
53+
*/
3154
boolean isNewlyCreated;
55+
56+
/**
57+
* if true the index is a unique index.
58+
*/
3259
boolean unique;
60+
61+
/**
62+
* the maximum amount of documents in case the index type is capped
63+
*/
3364
int size;
65+
66+
/**
67+
* minimum character length of words to index in case the index type is a fulltext
68+
*/
3469
int minLength;
35-
70+
3671
public String getId() {
3772
return id;
3873
}
@@ -42,8 +77,8 @@ public IndexType getType() {
4277
public List<String> getFields() {
4378
return fields;
4479
}
45-
public boolean isGetJson() {
46-
return getJson;
80+
public boolean isGeoJson() {
81+
return geoJson;
4782
}
4883
public boolean isNewlyCreated() {
4984
return isNewlyCreated;
@@ -63,8 +98,8 @@ public void setType(IndexType type) {
6398
public void setFields(List<String> fields) {
6499
this.fields = fields;
65100
}
66-
public void setGetJson(boolean getJson) {
67-
this.getJson = getJson;
101+
public void setGeoJson(boolean getJson) {
102+
this.geoJson = getJson;
68103
}
69104
public void setNewlyCreated(boolean isNewlyCreated) {
70105
this.isNewlyCreated = isNewlyCreated;

src/main/java/com/arangodb/entity/IndexesEntity.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,21 @@
2020
import java.util.Map;
2121

2222
/**
23+
* An entity defining an index list
24+
*
2325
* @author tamtam180 - kirscheless at gmail.com
2426
*
2527
*/
2628
public class IndexesEntity extends BaseEntity {
2729

30+
/**
31+
* the list of index entites
32+
*/
2833
List<IndexEntity> indexes;
34+
35+
/**
36+
* a map containing the indices , there ids as keys.
37+
*/
2938
Map<String, IndexEntity> identifiers;
3039

3140
public List<IndexEntity> getIndexes() {

src/main/java/com/arangodb/entity/Policy.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,19 @@
1717
package com.arangodb.entity;
1818

1919
/**
20+
* Enumeration for update/replace policy
21+
*
2022
* @author tamtam180 - kirscheless at gmail.com
2123
*
2224
*/
2325
public enum Policy {
26+
/**
27+
* if ERROR an error is returned when there is a revision mismatch
28+
*/
2429
ERROR,
30+
31+
/**
32+
* if LAST the operation is performed even when there is a revision mismatch
33+
*/
2534
LAST
2635
}

src/main/java/com/arangodb/entity/ReplicationApplierConfigEntity.java

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,21 +17,67 @@
1717
package com.arangodb.entity;
1818

1919
/**
20+
* The configuration of the replication applier. The configuration can only be changed while the applier is not running.
21+
* The updated configuration will be saved immediately but only become active with the next start of the applier.
22+
*
2023
* @author tamtam180 - kirscheless at gmail.com
2124
*
2225
*/
2326
public class ReplicationApplierConfigEntity extends BaseEntity {
2427

28+
/**
29+
* the logger server to connect to (e.g. "tcp://192.168.173.13:8529"). The endpoint must be specified.
30+
*/
2531
String endpoint;
32+
33+
/**
34+
* the name of the database on the endpoint. If not specified, defaults to the current local database name.
35+
*/
2636
String database;
37+
38+
/**
39+
* an optional ArangoDB username to use when connecting to the endpoint.
40+
*/
2741
String username;
42+
43+
/**
44+
* the password to use when connecting to the endpoint.
45+
*/
2846
String password;
47+
48+
/**
49+
* the maximum number of connection attempts the applier will make in a row. If the applier cannot establish a
50+
* connection to the endpoint in this number of attempts, it will stop itself.
51+
*/
2952
Integer maxConnectRetries;
53+
54+
/**
55+
* the timeout (in seconds) when attempting to connect to the endpoint. This value is used for each connection attempt.
56+
*/
3057
Integer connectTimeout;
58+
59+
/**
60+
* the timeout (in seconds) for individual requests to the endpoint.
61+
*/
3162
Integer requestTimeout;
63+
64+
/**
65+
* the requested maximum size for log transfer packets that is used when the endpoint is contacted.
66+
*/
3267
Integer chunkSize;
68+
69+
/**
70+
* whether or not to auto-start the replication applier on (next and following) server starts
71+
*/
3372
Boolean autoStart;
73+
74+
/**
75+
* if set to true, the replication applier will fall to sleep for an increasingly long period in case the logger
76+
* server at the endpoint does not have any more replication events to apply.
77+
*/
3478
Boolean adaptivePolling;
79+
80+
3581

3682
public String getEndpoint() {
3783
return endpoint;

src/main/java/com/arangodb/entity/ReplicationApplierState.java

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,26 +20,80 @@
2020
import java.util.Date;
2121

2222
/**
23+
* the state of the replication applier, regardless of whether the applier is currently running or not.
24+
*
2325
* @author tamtam180 - kirscheless at gmail.com
2426
*
2527
*/
2628
public class ReplicationApplierState implements Serializable {
2729

30+
/**
31+
* whether or not the applier is active and running
32+
*/
2833
Boolean running;
34+
35+
/**
36+
* the last tick value from the continuous replication log the applier has applied
37+
*/
2938
Long lastAppliedContinuousTick;
39+
40+
/**
41+
* the last tick value from the continuous replication log the applier has processed.
42+
*/
3043
Long lastProcessedContinuousTick;
44+
45+
/**
46+
* the last tick value the logger server can provide.
47+
*/
3148
Long lastAvailableContinuousTick;
49+
50+
/**
51+
* the time on the applier server.
52+
*/
3253
Date time;
54+
55+
/**
56+
* the total number of requests the applier has made to the endpoint.
57+
*/
3358
Long totalRequests;
59+
60+
/**
61+
* the total number of failed connection attempts the applier has made.
62+
*/
3463
Long totalFailedConnects;
64+
65+
/**
66+
* the total number of log events the applier has processed.
67+
*/
3568
Long totalEvents;
69+
70+
/**
71+
* details about the last error that happened on the applier.
72+
*/
3673
LastError lastError;
74+
75+
/**
76+
* details about the replication applier progress.
77+
* @see com.arangodb.entity.ReplicationApplierState.Progress
78+
*/
3779
Progress progress;
3880

3981
public static class Progress implements Serializable {
82+
/**
83+
* the date and time the progress was logged
84+
*/
4085
Date time;
86+
87+
/**
88+
* a textual description of the progress
89+
*/
4190
String message;
91+
92+
/**
93+
* the current number of failed connection attempts
94+
*/
4295
Long failedConnects;
96+
4397
public Date getTime() {
4498
return time;
4599
}
@@ -61,9 +115,21 @@ public void setFailedConnects(Long failedConnects) {
61115
}
62116

63117
public static class LastError implements Serializable {
118+
/**
119+
* the date and time the error occurred In case no error has occurred, lastError will be empty.
120+
*/
64121
Date time;
122+
123+
/**
124+
* a textual error description
125+
*/
65126
String errorMessage;
127+
128+
/**
129+
* a numerical error code
130+
*/
66131
Integer errorNum;
132+
67133
public Date getTime() {
68134
return time;
69135
}

src/main/java/com/arangodb/entity/ReplicationApplierStateEntity.java

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,37 @@
1717
package com.arangodb.entity;
1818

1919
/**
20+
* An entity representing a ReplicationApplierState
21+
*
2022
* @author tamtam180 - kirscheless at gmail.com
2123
*
2224
*/
2325
public class ReplicationApplierStateEntity extends BaseEntity {
2426

27+
/**
28+
* The applier state
29+
* @see com.arangodb.entity.ReplicationApplierState
30+
*/
2531
ReplicationApplierState state;
32+
33+
/**
34+
* The version of the server
35+
*/
2636
String serverVersion;
37+
38+
/**
39+
* The server id
40+
*/
2741
String serverId;
42+
43+
/**
44+
* The endpoint
45+
*/
2846
String endpoint;
47+
48+
/**
49+
* The database
50+
*/
2951
String database;
3052

3153
public ReplicationApplierState getState() {

src/main/java/com/arangodb/entity/ReplicationDumpHeader.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
import java.io.Serializable;
2020

2121
/**
22+
*
23+
*
2224
* @author tamtam180 - kirscheless at gmail.com
2325
*
2426
*/

0 commit comments

Comments
 (0)