Skip to content

Commit

Permalink
Merge pull request datakaveri#519 from ankitmashu/enhancement/callbac…
Browse files Browse the repository at this point in the history
…k_subs

remove call back subscriptions
  • Loading branch information
pranavrd authored Jun 12, 2024
2 parents c46067c + 493e74c commit 0c6e08d
Show file tree
Hide file tree
Showing 11 changed files with 10 additions and 2,324 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
package iudx.resource.server.apiserver.subscription;

public enum SubsType {
CALLBACK("CALLBACK"),
STREAMING("STREAMING");

public final String type;

SubsType(String type) {
this.type = type;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,12 @@ public class SubscriptionService {
/**
* get the context of subscription according to the type passed in message body.
*
* @param type type of subscription either <strong>streaming</strong> or <strong>callback</strong>
* @param databroker databroker verticle object
* @return an object of Subscription class
*/
private Subscription getSubscriptionContext(SubsType type, DataBrokerService databroker) {
LOGGER.info("getSubscriptionContext() method started");
if (type != null && type.equals(SubsType.CALLBACK)) {
LOGGER.info("callback subscription context");
return new CallbackSubscription(databroker);
} else {
LOGGER.info("streaming subscription context");
return new StreamingSubscription(databroker);
}
private Subscription getSubscriptionContext(DataBrokerService databroker) {
LOGGER.info("streaming subscription context");
return new StreamingSubscription(databroker);
}

/**
Expand All @@ -62,7 +55,7 @@ public Future<JsonObject> createSubscription(
Promise<JsonObject> promise = Promise.promise();
SubsType subType = SubsType.valueOf(json.getString(SUB_TYPE));
if (subscription == null) {
subscription = getSubscriptionContext(subType, databroker);
subscription = getSubscriptionContext(databroker);
}
assertNotNull(subscription);
subscription
Expand Down Expand Up @@ -239,9 +232,8 @@ public Future<JsonObject> deleteSubscription(
JsonObject json, DataBrokerService databroker, PostgresService pgService) {
LOGGER.info("deleteSubscription() method started");
Promise<JsonObject> promise = Promise.promise();
SubsType subType = SubsType.valueOf(json.getString(SUB_TYPE));
if (subscription == null) {
subscription = getSubscriptionContext(subType, databroker);
subscription = getSubscriptionContext(databroker);
}
assertNotNull(subscription);
subscription
Expand Down Expand Up @@ -284,9 +276,8 @@ public Future<JsonObject> getSubscription(
JsonObject json, DataBrokerService databroker, PostgresService pgService) {
LOGGER.info("getSubscription() method started");
Promise<JsonObject> promise = Promise.promise();
SubsType subType = SubsType.valueOf(json.getString(SUB_TYPE));
if (subscription == null) {
subscription = getSubscriptionContext(subType, databroker);
subscription = getSubscriptionContext(databroker);
}
assertNotNull(subscription);
subscription
Expand Down Expand Up @@ -342,7 +333,7 @@ public Future<JsonObject> appendSubscription(
Promise<JsonObject> promise = Promise.promise();
SubsType subType = SubsType.valueOf(json.getString(SUB_TYPE));
if (subscription == null) {
subscription = getSubscriptionContext(subType, databroker);
subscription = getSubscriptionContext(databroker);
}
assertNotNull(subscription);
subscription
Expand Down
74 changes: 0 additions & 74 deletions src/main/java/iudx/resource/server/callback/CallbackService.java

This file was deleted.

Loading

0 comments on commit 0c6e08d

Please sign in to comment.