Skip to content

Commit

Permalink
Merge pull request #22 from kailash/refactoring/general
Browse files Browse the repository at this point in the history
Refactoring - rename method, add service unregister
  • Loading branch information
kailash authored Feb 2, 2023
2 parents 28f5954 + 13b2ae2 commit 66fcb15
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,9 @@ public void start() throws Exception {

LOGGER.info("Postgres Verticle deployed.");
}

@Override
public void stop() {
binder.unregister(consumer);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ private JsonObject queryBuilder(JsonObject request) {
AuditingServerStrategy serverStrategy = serverOriginContextFactory.create(serverOrigin);
String postgresWriteQuery = serverStrategy.buildPostgresWriteQuery(request);
String postgresDeleteQuery = serverStrategy.buildPostgresDeleteQuery(request);
String immudbWriteQuery = serverStrategy.buildImmudbDeleteQuery(request);
String immudbWriteQuery = serverStrategy.buildImmudbWriteQuery(request);
return new JsonObject()
.put(PG_INSERT_QUERY_KEY, postgresWriteQuery)
.put(PG_DELETE_QUERY_KEY, postgresDeleteQuery)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ public interface AuditingServerStrategy {

String buildPostgresDeleteQuery(JsonObject request);

String buildImmudbDeleteQuery(JsonObject request);
String buildImmudbWriteQuery(JsonObject request);
}
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public String buildPostgresDeleteQuery(JsonObject request) {
}

@Override
public String buildImmudbDeleteQuery(JsonObject request) {
public String buildImmudbWriteQuery(JsonObject request) {
String primaryKey = request.getString(PRIMARY_KEY);
String body = request.getJsonObject(BODY).toString();
String endPoint = request.getString(API);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public String buildPostgresDeleteQuery(JsonObject request) {
}

@Override
public String buildImmudbDeleteQuery(JsonObject request) {
public String buildImmudbWriteQuery(JsonObject request) {
String primaryKey = request.getString(PRIMARY_KEY);
String userRole = request.getString(USER_ROLE);
String userId = request.getString(USER_ID);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public String buildPostgresDeleteQuery(JsonObject request) {
}

@Override
public String buildImmudbDeleteQuery(JsonObject request) {
public String buildImmudbWriteQuery(JsonObject request) {
String userId = request.getString(USER_ID);
String primaryKey = request.getString(PRIMARY_KEY);
String resourceId = request.getString(ID);
Expand Down

0 comments on commit 66fcb15

Please sign in to comment.