Skip to content

Commit 02a64ff

Browse files
author
mpv1989
committed
Refactor
1 parent 540370f commit 02a64ff

7 files changed

+19
-23
lines changed

src/main/java/com/arangodb/internal/InternalArangoCollection.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
* @author Mark Vollmary
6868
*
6969
*/
70-
public class InternalArangoCollection<A extends InternalArangoDB<E>, D extends InternalArangoDatabase<A, E>, E extends ArangoExecutor>
70+
public abstract class InternalArangoCollection<A extends InternalArangoDB<E>, D extends InternalArangoDatabase<A, E>, E extends ArangoExecutor>
7171
extends ArangoExecuteable<E> {
7272

7373
private static final String COLLECTION = "collection";

src/main/java/com/arangodb/internal/InternalArangoDB.java

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
* @author Mark Vollmary
4949
*
5050
*/
51-
public class InternalArangoDB<E extends ArangoExecutor> extends ArangoExecuteable<E> {
51+
public abstract class InternalArangoDB<E extends ArangoExecutor> extends ArangoExecuteable<E> {
5252

5353
private static final String PATH_API_ADMIN_LOG = "/_admin/log";
5454
private static final String PATH_API_ADMIN_LOG_LEVEL = "/_admin/log/level";
@@ -173,15 +173,13 @@ protected Request replaceUserRequest(final String database, final String user, f
173173
}
174174

175175
protected Request updateUserDefaultDatabaseAccessRequest(final String user, final Permissions permissions) {
176-
return request(ArangoRequestParam.SYSTEM, RequestType.PUT, PATH_API_USER, user,
177-
ArangoRequestParam.DATABASE, "*")
178-
.setBody(util().serialize(OptionsBuilder.build(new UserAccessOptions(), permissions)));
176+
return request(ArangoRequestParam.SYSTEM, RequestType.PUT, PATH_API_USER, user, ArangoRequestParam.DATABASE,
177+
"*").setBody(util().serialize(OptionsBuilder.build(new UserAccessOptions(), permissions)));
179178
}
180179

181180
protected Request updateUserDefaultCollectionAccessRequest(final String user, final Permissions permissions) {
182-
return request(ArangoRequestParam.SYSTEM, RequestType.PUT, PATH_API_USER, user,
183-
ArangoRequestParam.DATABASE, "*", "*")
184-
.setBody(util().serialize(OptionsBuilder.build(new UserAccessOptions(), permissions)));
181+
return request(ArangoRequestParam.SYSTEM, RequestType.PUT, PATH_API_USER, user, ArangoRequestParam.DATABASE,
182+
"*", "*").setBody(util().serialize(OptionsBuilder.build(new UserAccessOptions(), permissions)));
185183
}
186184

187185
protected Request getLogsRequest(final LogOptions options) {

src/main/java/com/arangodb/internal/InternalArangoDBBuilder.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
* @author Mark Vollmary
5252
*
5353
*/
54-
public class InternalArangoDBBuilder {
54+
public abstract class InternalArangoDBBuilder {
5555

5656
private static final String PROPERTY_KEY_HOSTS = "arangodb.hosts";
5757
private static final String PROPERTY_KEY_HOST = "arangodb.host";

src/main/java/com/arangodb/internal/InternalArangoDatabase.java

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
* @author Mark Vollmary
6363
*
6464
*/
65-
public class InternalArangoDatabase<A extends InternalArangoDB<E>, E extends ArangoExecutor>
65+
public abstract class InternalArangoDatabase<A extends InternalArangoDB<E>, E extends ArangoExecutor>
6666
extends ArangoExecuteable<E> {
6767

6868
protected static final String PATH_API_DATABASE = "/_api/database";
@@ -148,25 +148,23 @@ public Boolean deserialize(final Response response) throws VPackException {
148148
}
149149

150150
protected Request grantAccessRequest(final String user, final Permissions permissions) {
151-
return request(ArangoRequestParam.SYSTEM, RequestType.PUT, PATH_API_USER, user,
152-
ArangoRequestParam.DATABASE, name)
153-
.setBody(util().serialize(OptionsBuilder.build(new UserAccessOptions(), permissions)));
151+
return request(ArangoRequestParam.SYSTEM, RequestType.PUT, PATH_API_USER, user, ArangoRequestParam.DATABASE,
152+
name).setBody(util().serialize(OptionsBuilder.build(new UserAccessOptions(), permissions)));
154153
}
155154

156155
protected Request resetAccessRequest(final String user) {
157-
return request(ArangoRequestParam.SYSTEM, RequestType.DELETE, PATH_API_USER, user,
158-
ArangoRequestParam.DATABASE, name);
156+
return request(ArangoRequestParam.SYSTEM, RequestType.DELETE, PATH_API_USER, user, ArangoRequestParam.DATABASE,
157+
name);
159158
}
160159

161160
protected Request updateUserDefaultCollectionAccessRequest(final String user, final Permissions permissions) {
162-
return request(ArangoRequestParam.SYSTEM, RequestType.PUT, PATH_API_USER, user,
163-
ArangoRequestParam.DATABASE, name, "*")
164-
.setBody(util().serialize(OptionsBuilder.build(new UserAccessOptions(), permissions)));
161+
return request(ArangoRequestParam.SYSTEM, RequestType.PUT, PATH_API_USER, user, ArangoRequestParam.DATABASE,
162+
name, "*").setBody(util().serialize(OptionsBuilder.build(new UserAccessOptions(), permissions)));
165163
}
166164

167165
protected Request getPermissionsRequest(final String user) {
168-
return request(ArangoRequestParam.SYSTEM, RequestType.GET, PATH_API_USER, user,
169-
ArangoRequestParam.DATABASE, name);
166+
return request(ArangoRequestParam.SYSTEM, RequestType.GET, PATH_API_USER, user, ArangoRequestParam.DATABASE,
167+
name);
170168
}
171169

172170
protected ResponseDeserializer<Permissions> getPermissionsResponseDeserialzer() {

src/main/java/com/arangodb/internal/InternalArangoEdgeCollection.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
* @author Mark Vollmary
4646
*
4747
*/
48-
public class InternalArangoEdgeCollection<A extends InternalArangoDB<E>, D extends InternalArangoDatabase<A, E>, G extends InternalArangoGraph<A, D, E>, E extends ArangoExecutor>
48+
public abstract class InternalArangoEdgeCollection<A extends InternalArangoDB<E>, D extends InternalArangoDatabase<A, E>, G extends InternalArangoGraph<A, D, E>, E extends ArangoExecutor>
4949
extends ArangoExecuteable<E> {
5050

5151
private static final String PATH_API_GHARIAL = "/_api/gharial";

src/main/java/com/arangodb/internal/InternalArangoGraph.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
* @author Mark Vollmary
3838
*
3939
*/
40-
public class InternalArangoGraph<A extends InternalArangoDB<E>, D extends InternalArangoDatabase<A, E>, E extends ArangoExecutor>
40+
public abstract class InternalArangoGraph<A extends InternalArangoDB<E>, D extends InternalArangoDatabase<A, E>, E extends ArangoExecutor>
4141
extends ArangoExecuteable<E> {
4242

4343
protected static final String PATH_API_GHARIAL = "/_api/gharial";

src/main/java/com/arangodb/internal/InternalArangoVertexCollection.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
* @author Mark Vollmary
4646
*
4747
*/
48-
public class InternalArangoVertexCollection<A extends InternalArangoDB<E>, D extends InternalArangoDatabase<A, E>, G extends InternalArangoGraph<A, D, E>, E extends ArangoExecutor>
48+
public abstract class InternalArangoVertexCollection<A extends InternalArangoDB<E>, D extends InternalArangoDatabase<A, E>, G extends InternalArangoGraph<A, D, E>, E extends ArangoExecutor>
4949
extends ArangoExecuteable<E> {
5050

5151
private static final String PATH_API_GHARIAL = "/_api/gharial";

0 commit comments

Comments
 (0)