|
22 | 22 |
|
23 | 23 | /**
|
24 | 24 | * @author Mark Vollmary
|
25 |
| - * |
26 |
| - * @see <a href= |
27 |
| - * "https://www.arangodb.com/docs/stable/http/database-database-management.html#information-of-the-database">API |
28 |
| - * Documentation</a> |
| 25 | + * @see <a href="https://www.arangodb.com/docs/stable/http/database-database-management.html">API Documentation</a> |
29 | 26 | */
|
30 | 27 | public class DatabaseEntity implements Entity {
|
31 | 28 |
|
32 |
| - private String id; |
33 |
| - private String name; |
34 |
| - private String path; |
35 |
| - private Boolean isSystem; |
| 29 | + private String id; |
| 30 | + private String name; |
| 31 | + private String path; |
| 32 | + private Boolean isSystem; |
| 33 | + private final ReplicationFactor replicationFactor; |
| 34 | + private Integer writeConcern; |
| 35 | + private String sharding; |
36 | 36 |
|
37 |
| - /** |
38 |
| - * @return the id of the database |
39 |
| - */ |
40 |
| - public String getId() { |
41 |
| - return id; |
42 |
| - } |
| 37 | + public DatabaseEntity() { |
| 38 | + super(); |
| 39 | + replicationFactor = new ReplicationFactor(); |
| 40 | + } |
43 | 41 |
|
44 |
| - /** |
45 |
| - * @return the name of the database |
46 |
| - */ |
47 |
| - public String getName() { |
48 |
| - return name; |
49 |
| - } |
| 42 | + /** |
| 43 | + * @return the id of the database |
| 44 | + */ |
| 45 | + public String getId() { |
| 46 | + return id; |
| 47 | + } |
50 | 48 |
|
51 |
| - /** |
52 |
| - * @return the filesystem path of the database |
53 |
| - */ |
54 |
| - public String getPath() { |
55 |
| - return path; |
56 |
| - } |
| 49 | + /** |
| 50 | + * @return the name of the database |
| 51 | + */ |
| 52 | + public String getName() { |
| 53 | + return name; |
| 54 | + } |
57 | 55 |
|
58 |
| - /** |
59 |
| - * @return whether or not the database is the _system database |
60 |
| - */ |
61 |
| - public Boolean getIsSystem() { |
62 |
| - return isSystem; |
63 |
| - } |
| 56 | + /** |
| 57 | + * @return the filesystem path of the database |
| 58 | + */ |
| 59 | + public String getPath() { |
| 60 | + return path; |
| 61 | + } |
64 | 62 |
|
| 63 | + /** |
| 64 | + * @return whether or not the database is the _system database |
| 65 | + */ |
| 66 | + public Boolean getIsSystem() { |
| 67 | + return isSystem; |
| 68 | + } |
| 69 | + |
| 70 | + /** |
| 71 | + * @return the default replication factor for collections in this database |
| 72 | + * @since ArangoDB 3.6.0 |
| 73 | + */ |
| 74 | + public Integer getReplicationFactor() { |
| 75 | + return replicationFactor.getReplicationFactor(); |
| 76 | + } |
| 77 | + |
| 78 | + /** |
| 79 | + * Default write concern for new collections created in this database. It determines how many copies of each shard |
| 80 | + * are required to be in sync on the different DBServers. If there are less then these many copies in the cluster a |
| 81 | + * shard will refuse to write. Writes to shards with enough up-to-date copies will succeed at the same time however. |
| 82 | + * The value of writeConcern can not be larger than replicationFactor. (cluster only) |
| 83 | + * |
| 84 | + * @since ArangoDB 3.6.0 |
| 85 | + */ |
| 86 | + public Integer getWriteConcern() { |
| 87 | + return writeConcern; |
| 88 | + } |
| 89 | + |
| 90 | + /** |
| 91 | + * @return whether the collection is a satellite collection. Only in an enterprise cluster setup (else returning null). |
| 92 | + * @since ArangoDB 3.6.0 |
| 93 | + */ |
| 94 | + public Boolean getSatellite() { |
| 95 | + return this.replicationFactor.getSatellite(); |
| 96 | + } |
| 97 | + |
| 98 | + /** |
| 99 | + * @return information about the default sharding method for collections created in this database |
| 100 | + * @since ArangoDB 3.6.0 |
| 101 | + */ |
| 102 | + public String getSharding() { |
| 103 | + return sharding; |
| 104 | + } |
65 | 105 | }
|
0 commit comments