use of org.finra.herd.model.jpa.NotificationRegistrationEntity in project herd by FINRAOS.
the class NotificationRegistrationStatusServiceImpl method updateNotificationRegistrationStatus.
@NamespacePermission(fields = "#namespace", permissions = NamespacePermissionEnum.WRITE)
@Override
public NotificationRegistrationStatusUpdateResponse updateNotificationRegistrationStatus(String namespace, String notificationName, NotificationRegistrationStatusUpdateRequest notificationRegistrationStatusUpdateRequest) {
Assert.hasText(namespace, "The namespace must be specified");
Assert.hasText(notificationName, "The notification name must be specified");
String notificationRegistrationStatus = notificationRegistrationStatusUpdateRequest.getNotificationRegistrationStatus();
Assert.hasText(notificationRegistrationStatus, "The notification registration status must be specified");
NotificationRegistrationEntity notificationRegistration = notificationRegistrationDaoHelper.getNotificationRegistration(namespace.trim(), notificationName.trim());
NotificationRegistrationStatusEntity notificationRegistrationStatusEntity = notificationRegistrationStatusDaoHelper.getNotificationRegistrationStatusEntity(notificationRegistrationStatus.trim());
notificationRegistration.setNotificationRegistrationStatus(notificationRegistrationStatusEntity);
NotificationRegistrationStatusUpdateResponse notificationRegistrationStatusUpdateResponse = new NotificationRegistrationStatusUpdateResponse();
notificationRegistrationStatusUpdateResponse.setNotificationRegistrationKey(new NotificationRegistrationKey(notificationRegistration.getNamespace().getCode(), notificationRegistration.getName()));
notificationRegistrationStatusUpdateResponse.setNotificationRegistrationStatus(notificationRegistrationStatusEntity.getCode());
return notificationRegistrationStatusUpdateResponse;
}
Aggregations