Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed issues in event subscription Implementation #30

Merged
merged 4 commits into from
Oct 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
CREATE TABLE OB_NOTIFICATION (
NOTIFICATION_ID varchar(36) NOT NULL,
CLIENT_ID varchar(255) NOT NULL,
RESOURCE_ID varchar(255) NOT NULL,
STATUS varchar(10) NOT NULL,
UPDATED_TIMESTAMP DATETIME2(0) DEFAULT GETDATE(),
PRIMARY KEY (NOTIFICATION_ID)
);

CREATE TABLE OB_NOTIFICATION_EVENT (
EVENT_ID int NOT NULL IDENTITY,
NOTIFICATION_ID varchar(36) NOT NULL,
EVENT_TYPE varchar(200) NOT NULL,
EVENT_INFO varchar(1000) NOT NULL,
PRIMARY KEY (EVENT_ID),
CONSTRAINT FK_NotificationEvent FOREIGN KEY (NOTIFICATION_ID) REFERENCES OB_NOTIFICATION(NOTIFICATION_ID)
);

CREATE TABLE OB_NOTIFICATION_ERROR (
NOTIFICATION_ID varchar(36) NOT NULL,
ERROR_CODE varchar(255) NOT NULL,
DESCRIPTION varchar(255) NOT NULL,
PRIMARY KEY (NOTIFICATION_ID),
CONSTRAINT FK_NotificationError FOREIGN KEY (NOTIFICATION_ID) REFERENCES OB_NOTIFICATION(NOTIFICATION_ID)
);

CREATE TABLE OB_NOTIFICATION_SUBSCRIPTION (
SUBSCRIPTION_ID varchar(36) NOT NULL,
CLIENT_ID varchar(255) NOT NULL,
REQUEST JSON NOT NULL,
CALLBACK_URL varchar(255),
TIMESTAMP BIGINT NOT NULL,
SPEC_VERSION varchar(255),
STATUS varchar(255) NOT NULL,
PRIMARY KEY (SUBSCRIPTION_ID)
);

CREATE TABLE OB_NOTIFICATION_SUBSCRIBED_EVENTS (
SUBSCRIPTION_ID varchar(36) NOT NULL,
EVENT_TYPE varchar(255) NOT NULL,
PRIMARY KEY (SUBSCRIPTION_ID, EVENT_TYPE),
CONSTRAINT FK_NotificationSubEvents FOREIGN KEY (SUBSCRIPTION_ID) REFERENCES OB_NOTIFICATION_SUBSCRIPTION(SUBSCRIPTION_ID)
);
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
-- For event notifications feature run the following queries against the openbank_openbankingdb--

CREATE TABLE IF NOT EXISTS OB_NOTIFICATION (
NOTIFICATION_ID varchar(36) NOT NULL,
CLIENT_ID varchar(255) NOT NULL,
RESOURCE_ID varchar(255) NOT NULL,
STATUS varchar(10) NOT NULL,
UPDATED_TIMESTAMP TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (NOTIFICATION_ID)
)
ENGINE=InnoDB;

CREATE TABLE IF NOT EXISTS OB_NOTIFICATION_EVENT (
EVENT_ID int(11) NOT NULL AUTO_INCREMENT,
NOTIFICATION_ID varchar(36) NOT NULL,
EVENT_TYPE varchar(200) NOT NULL,
EVENT_INFO varchar(1000) NOT NULL,
PRIMARY KEY (EVENT_ID),
CONSTRAINT FK_NotificationEvent FOREIGN KEY (NOTIFICATION_ID) REFERENCES OB_NOTIFICATION(NOTIFICATION_ID)
)
ENGINE=InnoDB;

CREATE TABLE IF NOT EXISTS OB_NOTIFICATION_ERROR (
NOTIFICATION_ID varchar(36) NOT NULL,
ERROR_CODE varchar(255) NOT NULL,
DESCRIPTION varchar(255) NOT NULL,
PRIMARY KEY (NOTIFICATION_ID),
CONSTRAINT FK_NotificationError FOREIGN KEY (NOTIFICATION_ID) REFERENCES OB_NOTIFICATION(NOTIFICATION_ID)
)
ENGINE=InnoDB;

CREATE TABLE IF NOT EXISTS OB_NOTIFICATION_SUBSCRIPTION (
SUBSCRIPTION_ID varchar(36) NOT NULL,
CLIENT_ID varchar(255) NOT NULL,
REQUEST JSON NOT NULL,
CALLBACK_URL varchar(255),
TIMESTAMP BIGINT NOT NULL,
SPEC_VERSION varchar(255),
STATUS varchar(255) NOT NULL,
PRIMARY KEY (SUBSCRIPTION_ID)
)
ENGINE=InnoDB;

CREATE TABLE IF NOT EXISTS OB_NOTIFICATION_SUBSCRIBED_EVENTS (
SUBSCRIPTION_ID varchar(36) NOT NULL,
EVENT_TYPE varchar(255) NOT NULL,
PRIMARY KEY (SUBSCRIPTION_ID, EVENT_TYPE),
CONSTRAINT FK_NotificationSubEvents FOREIGN KEY (SUBSCRIPTION_ID) REFERENCES OB_NOTIFICATION_SUBSCRIPTION(SUBSCRIPTION_ID)
)
ENGINE=InnoDB;
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
CREATE TABLE OB_NOTIFICATION (
NOTIFICATION_ID varchar2(36) NOT NULL,
CLIENT_ID varchar2(255) NOT NULL,
RESOURCE_ID varchar2(255) NOT NULL,
STATUS varchar2(10) NOT NULL,
UPDATED_TIMESTAMP TIMESTAMP(0) DEFAULT SYSTIMESTAMP,
PRIMARY KEY (NOTIFICATION_ID)
);

CREATE TABLE OB_NOTIFICATION_EVENT (
EVENT_ID number(10) NOT NULL,
NOTIFICATION_ID varchar2(36) NOT NULL,
EVENT_TYPE varchar2(200) NOT NULL,
EVENT_INFO varchar2(1000) NOT NULL,
PRIMARY KEY (EVENT_ID),
CONSTRAINT FK_NotificationEvent FOREIGN KEY (NOTIFICATION_ID) REFERENCES OB_NOTIFICATION(NOTIFICATION_ID)
);

-- Generate ID using sequence and trigger
CREATE SEQUENCE OB_NOTIFICATION_EVENT_seq START WITH 1 INCREMENT BY 1;

CREATE OR REPLACE TRIGGER OB_NOTIFICATION_EVENT_seq_tr
BEFORE INSERT ON OB_NOTIFICATION_EVENT FOR EACH ROW
WHEN (NEW.EVENT_ID IS NULL)
BEGIN
SELECT OB_NOTIFICATION_EVENT_seq.NEXTVAL INTO :NEW.EVENT_ID FROM DUAL;
END;


CREATE TABLE OB_NOTIFICATION_ERROR (
NOTIFICATION_ID varchar2(36) NOT NULL,
ERROR_CODE varchar2(255) NOT NULL,
DESCRIPTION varchar2(255) NOT NULL,
PRIMARY KEY (NOTIFICATION_ID),
CONSTRAINT FK_NotificationError FOREIGN KEY (NOTIFICATION_ID) REFERENCES OB_NOTIFICATION(NOTIFICATION_ID)
)

CREATE TABLE OB_NOTIFICATION_SUBSCRIPTION (
SUBSCRIPTION_ID varchar(36) NOT NULL,
CLIENT_ID varchar(255) NOT NULL,
REQUEST JSON NOT NULL,
CALLBACK_URL varchar(255),
TIMESTAMP BIGINT NOT NULL,
SPEC_VERSION varchar(255),
STATUS varchar(255) NOT NULL,
PRIMARY KEY (SUBSCRIPTION_ID)
);

CREATE TABLE OB_NOTIFICATION_SUBSCRIBED_EVENTS (
SUBSCRIPTION_ID varchar(36) NOT NULL,
EVENT_TYPE varchar(255) NOT NULL,
PRIMARY KEY (SUBSCRIPTION_ID, EVENT_TYPE),
CONSTRAINT FK_NotificationSubEvents FOREIGN KEY (SUBSCRIPTION_ID) REFERENCES OB_NOTIFICATION_SUBSCRIPTION(SUBSCRIPTION_ID)
);


Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
-- For event notifications feature run the following queries against the openbank_openbankingdb--

CREATE TABLE IF NOT EXISTS OB_NOTIFICATION (
NOTIFICATION_ID varchar(36) NOT NULL,
CLIENT_ID varchar(255) NOT NULL,
RESOURCE_ID varchar(255) NOT NULL,
STATUS varchar(10) NOT NULL,
UPDATED_TIMESTAMP TIMESTAMP(0) DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (NOTIFICATION_ID)
);

CREATE TABLE IF NOT EXISTS OB_NOTIFICATION_EVENT (
EVENT_ID SERIAL PRIMARY KEY,
NOTIFICATION_ID varchar(36) NOT NULL,
EVENT_TYPE varchar(200) NOT NULL,
EVENT_INFO varchar(1000) NOT NULL,
CONSTRAINT FK_NotificationEvent FOREIGN KEY (NOTIFICATION_ID) REFERENCES OB_NOTIFICATION(NOTIFICATION_ID)
);

CREATE TABLE IF NOT EXISTS OB_NOTIFICATION_ERROR (
NOTIFICATION_ID varchar(36) NOT NULL,
ERROR_CODE varchar(255) NOT NULL,
DESCRIPTION varchar(255) NOT NULL,
PRIMARY KEY (NOTIFICATION_ID),
CONSTRAINT FK_NotificationError FOREIGN KEY (NOTIFICATION_ID) REFERENCES OB_NOTIFICATION(NOTIFICATION_ID)
);

CREATE TABLE IF NOT EXISTS OB_NOTIFICATION_SUBSCRIPTION (
SUBSCRIPTION_ID varchar(36) NOT NULL,
CLIENT_ID varchar(255) NOT NULL,
REQUEST JSON NOT NULL,
CALLBACK_URL varchar(255),
TIMESTAMP BIGINT NOT NULL,
SPEC_VERSION varchar(255),
STATUS varchar(255) NOT NULL,
PRIMARY KEY (SUBSCRIPTION_ID)
);

CREATE TABLE IF NOT EXISTS OB_NOTIFICATION_SUBSCRIBED_EVENTS (
SUBSCRIPTION_ID varchar(36) NOT NULL,
EVENT_TYPE varchar(255) NOT NULL,
PRIMARY KEY (SUBSCRIPTION_ID, EVENT_TYPE),
CONSTRAINT FK_NotificationSubEvents FOREIGN KEY (SUBSCRIPTION_ID) REFERENCES OB_NOTIFICATION_SUBSCRIPTION(SUBSCRIPTION_ID)
);
Original file line number Diff line number Diff line change
Expand Up @@ -24,48 +24,48 @@
public class EventSubscriptionSqlStatements {

public String storeEventSubscriptionQuery() {
return "INSERT INTO NOTIFICATION_SUBSCRIPTION (SUBSCRIPTION_ID, CLIENT_ID, CALLBACK_URL, TIMESTAMP, " +
return "INSERT INTO OB_NOTIFICATION_SUBSCRIPTION (SUBSCRIPTION_ID, CLIENT_ID, CALLBACK_URL, TIMESTAMP, " +
"SPEC_VERSION, STATUS, REQUEST) VALUES (?,?,?,?,?,?,?)";
}

public String storeSubscribedEventTypesQuery() {
return "INSERT INTO NOTIFICATION_SUBSCRIPTION_EVENTS (SUBSCRIPTION_ID, EVENT_TYPE) VALUES (?,?)";
return "INSERT INTO OB_NOTIFICATION_SUBSCRIBED_EVENTS (SUBSCRIPTION_ID, EVENT_TYPE) VALUES (?,?)";
}

public String getEventSubscriptionBySubscriptionIdQuery() {
return "SELECT ns.SUBSCRIPTION_ID, ns.CLIENT_ID, ns.REQUEST, ns.CALLBACK_URL, ns.TIMESTAMP, ns.SPEC_VERSION, " +
"ns.STATUS, nse.EVENT_TYPE FROM NOTIFICATION_SUBSCRIPTION ns LEFT JOIN " +
"NOTIFICATION_SUBSCRIPTION_EVENTS nse ON ns.SUBSCRIPTION_ID = nse.SUBSCRIPTION_ID WHERE " +
"ns.STATUS, nse.EVENT_TYPE FROM OB_NOTIFICATION_SUBSCRIPTION ns LEFT JOIN " +
"OB_NOTIFICATION_SUBSCRIBED_EVENTS nse ON ns.SUBSCRIPTION_ID = nse.SUBSCRIPTION_ID WHERE " +
"ns.SUBSCRIPTION_ID = ? AND ns.STATUS = 'CREATED'";
}

public String getEventSubscriptionsByClientIdQuery() {
return "SELECT ns.SUBSCRIPTION_ID, ns.CLIENT_ID, ns.REQUEST, ns.CALLBACK_URL, ns.TIMESTAMP, ns.SPEC_VERSION, " +
"ns.STATUS, nse.EVENT_TYPE FROM NOTIFICATION_SUBSCRIPTION ns LEFT JOIN " +
"NOTIFICATION_SUBSCRIPTION_EVENTS nse ON ns.SUBSCRIPTION_ID = nse.SUBSCRIPTION_ID WHERE " +
"ns.STATUS, nse.EVENT_TYPE FROM OB_NOTIFICATION_SUBSCRIPTION ns LEFT JOIN " +
"OB_NOTIFICATION_SUBSCRIBED_EVENTS nse ON ns.SUBSCRIPTION_ID = nse.SUBSCRIPTION_ID WHERE " +
"ns.CLIENT_ID = ? AND ns.STATUS = 'CREATED'";
}

public String getEventSubscriptionsByEventTypeQuery() {
return "SELECT ns.SUBSCRIPTION_ID, ns.CLIENT_ID, ns.REQUEST, ns.CALLBACK_URL, ns.TIMESTAMP, ns.SPEC_VERSION, " +
"ns.STATUS, nse.EVENT_TYPE FROM NOTIFICATION_SUBSCRIPTION ns LEFT JOIN " +
"NOTIFICATION_SUBSCRIPTION_EVENTS nse ON ns.SUBSCRIPTION_ID = nse.SUBSCRIPTION_ID WHERE " +
"ns.SUBSCRIPTION_ID IN (SELECT ns.SUBSCRIPTION_ID FROM NOTIFICATION_SUBSCRIPTION ns LEFT " +
"JOIN NOTIFICATION_SUBSCRIPTION_EVENTS nse ON ns.SUBSCRIPTION_ID = nse.SUBSCRIPTION_ID WHERE " +
"ns.STATUS, nse.EVENT_TYPE FROM OB_NOTIFICATION_SUBSCRIPTION ns LEFT JOIN " +
"OB_NOTIFICATION_SUBSCRIBED_EVENTS nse ON ns.SUBSCRIPTION_ID = nse.SUBSCRIPTION_ID WHERE " +
"ns.SUBSCRIPTION_ID IN (SELECT ns.SUBSCRIPTION_ID FROM OB_NOTIFICATION_SUBSCRIPTION ns LEFT " +
"JOIN OB_NOTIFICATION_SUBSCRIBED_EVENTS nse ON ns.SUBSCRIPTION_ID = nse.SUBSCRIPTION_ID WHERE " +
"nse.EVENT_TYPE = ? AND ns.STATUS = 'CREATED')";
}

public String updateEventSubscriptionQuery() {
return "UPDATE NOTIFICATION_SUBSCRIPTION SET CALLBACK_URL = ?, TIMESTAMP = ?, REQUEST = ?" +
return "UPDATE OB_NOTIFICATION_SUBSCRIPTION SET CALLBACK_URL = ?, TIMESTAMP = ?, REQUEST = ?" +
"WHERE SUBSCRIPTION_ID = ?";
}

public String updateEventSubscriptionStatusQuery() {
return "UPDATE NOTIFICATION_SUBSCRIPTION SET STATUS = ? WHERE SUBSCRIPTION_ID = ? && STATUS = 'CREATED'";
return "UPDATE OB_NOTIFICATION_SUBSCRIPTION SET STATUS = ? WHERE SUBSCRIPTION_ID = ? && STATUS = 'CREATED'";
}

public String deleteSubscribedEventTypesQuery() {
return "DELETE FROM NOTIFICATION_SUBSCRIPTION_EVENTS WHERE SUBSCRIPTION_ID = ?";
return "DELETE FROM OB_NOTIFICATION_SUBSCRIBED_EVENTS WHERE SUBSCRIPTION_ID = ?";
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
import net.minidev.json.JSONObject;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.eclipse.jetty.http.HttpStatus;
import org.springframework.http.HttpStatus;

import java.util.ArrayList;
import java.util.List;
Expand Down Expand Up @@ -65,13 +65,13 @@ public EventSubscriptionResponse createEventSubscription(EventSubscriptionDTO ev
try {
EventSubscription createEventSubscriptionResponse = eventSubscriptionService.
createEventSubscription(eventSubscription);
eventSubscriptionResponse.setStatus(HttpStatus.CREATED_201);
eventSubscriptionResponse.setStatus(HttpStatus.CREATED.value());
eventSubscriptionResponse.
setResponseBody(mapSubscriptionModelToResponseJson(createEventSubscriptionResponse));
return eventSubscriptionResponse;
} catch (OBEventNotificationException e) {
log.error("Error occurred while creating event subscription", e);
eventSubscriptionResponse.setStatus(HttpStatus.INTERNAL_SERVER_ERROR_500);
eventSubscriptionResponse.setStatus(HttpStatus.INTERNAL_SERVER_ERROR.value());
eventSubscriptionResponse.setErrorResponse(EventNotificationServiceUtil.getErrorDTO(
EventNotificationConstants.INVALID_REQUEST, e.getMessage()));
return eventSubscriptionResponse;
Expand Down Expand Up @@ -99,17 +99,17 @@ public EventSubscriptionResponse getEventSubscription(String clientId, String su
try {
EventSubscription eventSubscription = eventSubscriptionService.
getEventSubscriptionBySubscriptionId(subscriptionId);
eventSubscriptionResponse.setStatus(HttpStatus.OK_200);
eventSubscriptionResponse.setStatus(HttpStatus.OK.value());
eventSubscriptionResponse.setResponseBody(mapSubscriptionModelToResponseJson(eventSubscription));
return eventSubscriptionResponse;
} catch (OBEventNotificationException e) {
log.error("Error occurred while retrieving event subscription", e);
if (e.getMessage().equals(EventNotificationConstants.EVENT_SUBSCRIPTION_NOT_FOUND)) {
eventSubscriptionResponse.setStatus(HttpStatus.BAD_REQUEST_400);
eventSubscriptionResponse.setStatus(HttpStatus.BAD_REQUEST.value());
eventSubscriptionResponse.setErrorResponse(EventNotificationServiceUtil.getErrorDTO(
EventNotificationConstants.INVALID_REQUEST, e.getMessage()));
} else {
eventSubscriptionResponse.setStatus(HttpStatus.INTERNAL_SERVER_ERROR_500);
eventSubscriptionResponse.setStatus(HttpStatus.INTERNAL_SERVER_ERROR.value());
eventSubscriptionResponse.setErrorResponse(EventNotificationServiceUtil.getErrorDTO(
EventNotificationConstants.INVALID_REQUEST, e.getMessage()));
}
Expand Down Expand Up @@ -139,12 +139,12 @@ public EventSubscriptionResponse getAllEventSubscriptions(String clientId) {
for (EventSubscription eventSubscription : eventSubscriptionList) {
eventSubscriptionResponseList.add(mapSubscriptionModelToResponseJson(eventSubscription));
}
eventSubscriptionResponse.setStatus(HttpStatus.OK_200);
eventSubscriptionResponse.setStatus(HttpStatus.OK.value());
eventSubscriptionResponse.setResponseBody(eventSubscriptionResponseList);
return eventSubscriptionResponse;
} catch (OBEventNotificationException e) {
log.error("Error occurred while retrieving event subscriptions", e);
eventSubscriptionResponse.setStatus(HttpStatus.INTERNAL_SERVER_ERROR_500);
eventSubscriptionResponse.setStatus(HttpStatus.INTERNAL_SERVER_ERROR.value());
eventSubscriptionResponse.setErrorResponse(EventNotificationServiceUtil.getErrorDTO(
EventNotificationConstants.INVALID_REQUEST, e.getMessage()));
return eventSubscriptionResponse;
Expand Down Expand Up @@ -175,12 +175,12 @@ public EventSubscriptionResponse getEventSubscriptionsByEventType(String clientI
for (EventSubscription eventSubscription : eventSubscriptionList) {
eventSubscriptionResponseList.add(mapSubscriptionModelToResponseJson(eventSubscription));
}
eventSubscriptionResponse.setStatus(HttpStatus.OK_200);
eventSubscriptionResponse.setStatus(HttpStatus.OK.value());
eventSubscriptionResponse.setResponseBody(eventSubscriptionResponseList);
return eventSubscriptionResponse;
} catch (OBEventNotificationException e) {
log.error("Error occurred while retrieving event subscriptions", e);
eventSubscriptionResponse.setStatus(HttpStatus.INTERNAL_SERVER_ERROR_500);
eventSubscriptionResponse.setStatus(HttpStatus.INTERNAL_SERVER_ERROR.value());
eventSubscriptionResponse.setErrorResponse(EventNotificationServiceUtil.getErrorDTO(
EventNotificationConstants.INVALID_REQUEST, e.getMessage()));
return eventSubscriptionResponse;
Expand Down Expand Up @@ -208,21 +208,21 @@ public EventSubscriptionResponse updateEventSubscription(EventSubscriptionDTO ev
try {
Boolean isUpdated = eventSubscriptionService.updateEventSubscription(eventSubscription);
if (!isUpdated) {
eventSubscriptionResponse.setStatus(HttpStatus.BAD_REQUEST_400);
eventSubscriptionResponse.setStatus(HttpStatus.BAD_REQUEST.value());
eventSubscriptionResponse.setErrorResponse(EventNotificationServiceUtil.getErrorDTO(
EventNotificationConstants.INVALID_REQUEST,
"Event subscription not found."));
return eventSubscriptionResponse;
}
eventSubscriptionResponse.setStatus(HttpStatus.OK_200);
eventSubscriptionResponse.setStatus(HttpStatus.OK.value());
EventSubscription eventSubscriptionUpdateResponse = eventSubscriptionService.
getEventSubscriptionBySubscriptionId(eventSubscriptionUpdateRequestDto.getSubscriptionId());
eventSubscriptionResponse.
setResponseBody(mapSubscriptionModelToResponseJson(eventSubscriptionUpdateResponse));
return eventSubscriptionResponse;
} catch (OBEventNotificationException e) {
log.error("Error occurred while updating event subscription", e);
eventSubscriptionResponse.setStatus(HttpStatus.INTERNAL_SERVER_ERROR_500);
eventSubscriptionResponse.setStatus(HttpStatus.INTERNAL_SERVER_ERROR.value());
eventSubscriptionResponse.setErrorResponse(EventNotificationServiceUtil.getErrorDTO(
EventNotificationConstants.INVALID_REQUEST, e.getMessage()));
return eventSubscriptionResponse;
Expand All @@ -247,17 +247,17 @@ public EventSubscriptionResponse deleteEventSubscription(String clientId, String
try {
Boolean isDeleted = eventSubscriptionService.deleteEventSubscription(subscriptionId);
if (!isDeleted) {
eventSubscriptionResponse.setStatus(HttpStatus.BAD_REQUEST_400);
eventSubscriptionResponse.setStatus(HttpStatus.BAD_REQUEST.value());
eventSubscriptionResponse.setErrorResponse(EventNotificationServiceUtil.getErrorDTO(
EventNotificationConstants.INVALID_REQUEST,
"Event subscription not found"));
return eventSubscriptionResponse;
}
eventSubscriptionResponse.setStatus(HttpStatus.NO_CONTENT_204);
eventSubscriptionResponse.setStatus(HttpStatus.NO_CONTENT.value());
return eventSubscriptionResponse;
} catch (OBEventNotificationException e) {
log.error("Error occurred while deleting event subscription", e);
eventSubscriptionResponse.setStatus(HttpStatus.INTERNAL_SERVER_ERROR_500);
eventSubscriptionResponse.setStatus(HttpStatus.INTERNAL_SERVER_ERROR.value());
eventSubscriptionResponse.setErrorResponse(EventNotificationServiceUtil.getErrorDTO(
EventNotificationConstants.INVALID_REQUEST, e.getMessage()));
return eventSubscriptionResponse;
Expand All @@ -277,7 +277,7 @@ private EventSubscriptionResponse validateClientId(String clientId) {
} catch (OBEventNotificationException e) {
log.error("Invalid client ID", e);
EventSubscriptionResponse eventSubscriptionResponse = new EventSubscriptionResponse();
eventSubscriptionResponse.setStatus(HttpStatus.BAD_REQUEST_400);
eventSubscriptionResponse.setStatus(HttpStatus.BAD_REQUEST.value());
eventSubscriptionResponse.setErrorResponse(EventNotificationServiceUtil.getErrorDTO(
EventNotificationConstants.INVALID_REQUEST, e.getMessage()));
return eventSubscriptionResponse;
Expand Down
Loading
Loading