refactor(manager-api): placeholder URLs for events and notifications (NB: NOT final).
At the moment, in the UI we don't use these but in the future for email notifications, etc, they
will become more important.
MODIFY
manager/api/rest-impl/src/main/java/io/apiman/manager/api/notifications/producers/ClientAppStatusNotificationProducer.java
manager/api/rest-impl/src/main/java/io/apiman/manager/api/notifications/producers/ClientAppStatusNotificationProducer.java
@@ -54,7 +54,7 @@ public class ClientAppStatusNotificationProducer implements INotificationProduce
.setReason(APIMAN_CLIENT_STATUS_CHANGE)
.setReasonMessage("Client was published")
.setCategory(NotificationCategory.API_ADMINISTRATION)
- .setSource("/resources/something/here/")
+ .setSource("/apiman/notifications/clients/status")
.setPayload(signupEvent);
LOGGER.debug("Sending notification for client app registration: {0}", newNotification);

MODIFY
manager/api/rest-impl/src/main/java/io/apiman/manager/api/notifications/producers/ContractApprovalNotificationProducer.java
manager/api/rest-impl/src/main/java/io/apiman/manager/api/notifications/producers/ContractApprovalNotificationProducer.java
@@ -51,7 +51,7 @@ public class ContractApprovalNotificationProducer implements INotificationProduc
CreateNotificationDto newNotification = new CreateNotificationDto()
.setRecipient(List.of(planAdmins))
.setCategory(NotificationCategory.API_ADMINISTRATION)
- .setSource("http://somepage/here/")
+ .setSource("/apiman/notifications/contracts/approvals")
.setPayload(approvalEvent);
if (approvalEvent.isApproved()) {

MODIFY
manager/api/rest-impl/src/main/java/io/apiman/manager/api/notifications/producers/ContractApprovalRequestNotificationProducer.java
manager/api/rest-impl/src/main/java/io/apiman/manager/api/notifications/producers/ContractApprovalRequestNotificationProducer.java
@@ -52,7 +52,7 @@ public class ContractApprovalRequestNotificationProducer implements INotificatio
.setReason(APIMAN_CLIENT_CONTRACT_REASON)
.setReasonMessage("Signup request for API")
.setCategory(NotificationCategory.API_ADMINISTRATION)
- .setSource("http://somepage/here/")
+ .setSource("/apiman/notifications/contracts/approvals")
.setPayload(signupEvent);
LOGGER.debug("Sending notification for approval of contract {0} from client {1} version {2}",

MODIFY
manager/api/rest-impl/src/main/java/io/apiman/manager/api/notifications/producers/NewAccountNotificationProducer.java
manager/api/rest-impl/src/main/java/io/apiman/manager/api/notifications/producers/NewAccountNotificationProducer.java
@@ -48,7 +48,7 @@ public class NewAccountNotificationProducer implements INotificationProducer {
.setReason(APIMAN_ACCOUNT_APPROVAL_REQUEST)
.setReasonMessage("A new account needs approval to gain access " + signupEvent.getUsername())
.setCategory(NotificationCategory.USER_ADMINISTRATION)
- .setSource("http://somepage/here/")
+ .setSource("/apiman/notifications/account/approvals")
.setPayload(signupEvent);
notificationService.sendNotification(newNotification);

MODIFY
manager/api/rest-impl/src/main/java/io/apiman/manager/api/service/ActionService.java
manager/api/rest-impl/src/main/java/io/apiman/manager/api/service/ActionService.java
@@ -178,7 +178,7 @@ public class ActionService implements DataAccessUtilMixin {
ApimanEventHeaders headers = ApimanEventHeaders
.builder()
.setId(UUID.randomUUID().toString().substring(8))
- .setSource(URI.create("/a/b/c"))
+ .setSource(URI.create("/apiman/events/contracts/approvals"))
.setSubject("approval")
.build();
@@ -310,8 +310,7 @@ public class ActionService implements DataAccessUtilMixin {
if (gateway == null) {
throw new GatewayNotFoundException();
}
- IGatewayLink link = gatewayLinkFactory.create(gateway);
- return link;
+ return gatewayLinkFactory.create(gateway);
} catch (GatewayNotFoundException e) {
throw e;
} catch (Exception e) {

MODIFY
manager/api/rest-impl/src/main/java/io/apiman/manager/api/service/ClientAppService.java
manager/api/rest-impl/src/main/java/io/apiman/manager/api/service/ClientAppService.java
@@ -532,7 +532,7 @@ public class ClientAppService implements DataAccessUtilMixin {
ApimanEventHeaders headers = ApimanEventHeaders
.builder()
.setId(UUID.randomUUID().toString().substring(8))
- .setSource(URI.create("/a/b/c"))
+ .setSource(URI.create("/apiman/events/clients"))
.setSubject("status.change")
.build();

MODIFY
manager/api/rest-impl/src/main/java/io/apiman/manager/api/service/ContractService.java
manager/api/rest-impl/src/main/java/io/apiman/manager/api/service/ContractService.java
@@ -442,7 +442,7 @@ public class ContractService implements DataAccessUtilMixin {
ApimanEventHeaders headers = ApimanEventHeaders
.builder()
.setId(UUID.randomUUID().toString())
- .setSource(URI.create("/a/b/c"))
+ .setSource(URI.create("/apiman/events/contracts/approvals"))
.setSubject("request")
.build();

MODIFY
manager/test/api/src/test/resources/test-plan-data/approvals/notifications/001_approver-notifications.resttest
manager/test/api/src/test/resources/test-plan-data/approvals/notifications/001_approver-notifications.resttest
@@ -23,10 +23,10 @@ Content-Type: application/json
"fullName": "Admin",
"email": "admin@example.org"
},
- "source": "http://somepage/here/",
+ "source": "/apiman/notifications/contracts/approvals",
"payload": {
"headers": {
- "source": "/a/b/c",
+ "source": "/apiman/events/contracts/approvals",
"type": "io.apiman.manager.api.beans.events.ContractCreatedEvent",
"subject": "request",
"eventVersion": 1,
@@ -59,10 +59,10 @@ Content-Type: application/json
"fullName": "Admin",
"email": "admin@example.org"
},
- "source": "http://somepage/here/",
+ "source": "/apiman/notifications/contracts/approvals",
"payload": {
"headers": {
- "source": "/a/b/c",
+ "source": "/apiman/events/contracts/approvals",
"type": "io.apiman.manager.api.beans.events.ContractCreatedEvent",
"subject": "request",
"eventVersion": 1,

MODIFY
manager/test/api/src/test/resources/test-plan-data/approvals/notifications/002_bwayne-notifications.resttest
manager/test/api/src/test/resources/test-plan-data/approvals/notifications/002_bwayne-notifications.resttest
@@ -23,10 +23,10 @@ Content-Type: application/json
"fullName": "Bruce Wayne",
"email": "bwayne@wayne-enterprises.com"
},
- "source": "/resources/something/here/",
+ "source": "/apiman/notifications/clients/status",
"payload": {
"headers": {
- "source": "/a/b/c",
+ "source": "/apiman/events/clients",
"type": "io.apiman.manager.api.beans.events.ClientVersionStatusEvent",
"subject": "status.change",
"eventVersion": 1,
@@ -49,10 +49,10 @@ Content-Type: application/json
"fullName": "Bruce Wayne",
"email": "bwayne@wayne-enterprises.com"
},
- "source": "http://somepage/here/",
+ "source": "/apiman/notifications/contracts/approvals",
"payload": {
"headers": {
- "source": "/a/b/c",
+ "source": "/apiman/events/contracts/approvals",
"type": "io.apiman.manager.api.beans.events.ContractApprovalEvent",
"subject": "approval",
"eventVersion": 1,
@@ -86,10 +86,10 @@ Content-Type: application/json
"fullName": "Bruce Wayne",
"email": "bwayne@wayne-enterprises.com"
},
- "source": "http://somepage/here/",
+ "source": "/apiman/notifications/contracts/approvals",
"payload": {
"headers": {
- "source": "/a/b/c",
+ "source": "/apiman/events/contracts/approvals",
"type": "io.apiman.manager.api.beans.events.ContractApprovalEvent",
"subject": "approval",
"eventVersion": 1,

refactor(manager-api): placeholder URLs for events and notifications (NB: NOT final).

At the moment, in the UI we don't use these but in the future for email notifications, etc, they
will become more important.