import org.openecomp.portalapp.portal.ecomp.model.PortalRestResponse;
import org.openecomp.portalapp.portal.ecomp.model.PortalRestStatusEnum;
import org.openecomp.portalapp.portal.logging.aop.EPAuditLog;
+import org.openecomp.portalapp.portal.service.TicketEventService;
import org.openecomp.portalapp.portal.service.UserNotificationService;
import org.openecomp.portalapp.portal.transport.EpNotificationItem;
import org.openecomp.portalapp.portal.transport.EpRoleNotificationItem;
-import org.openecomp.portalapp.portal.utils.EPCommonSystemProperties;
import org.openecomp.portalapp.portal.utils.PortalConstants;
import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import org.openecomp.portalsdk.core.util.SystemProperties;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
@Autowired
private UserNotificationService userNotificationService;
+
+ @Autowired
+ private TicketEventService ticketEventService;
private EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(TicketEventController.class);
JsonNode event = ticketEventNotif.get("event");
JsonNode header = event.get("header");
JsonNode body = event.get("body");
+ JsonNode application = ticketEventNotif.get("application");
epItem.setMsgDescription(body.toString());
Long eventDate = System.currentTimeMillis();
if (body.get("eventDate") != null) {
String eventSource = header.get("eventSource").asText();
epItem.setMsgSource(eventSource);
String ticket = body.get("ticketNum").asText();
- String hyperlink = SystemProperties.getProperty(EPCommonSystemProperties.EXTERNAL_SYSTEM_NOTIFICATION_URL)+eventSource+"num="+ticket;
+ String hyperlink = ticketEventService.getNotificationHyperLink(application, ticket, eventSource);
if(body.get("notificationHyperlink")!=null){
hyperlink=body.get("notificationHyperlink").asText();
}
JsonNode application = ticketEventNotif.get("application");
JsonNode event = ticketEventNotif.get("event");
JsonNode header = event.get("header");
+ JsonNode eventSource=header.get("eventSource");
JsonNode body = event.get("body");
JsonNode SubscriberInfo = ticketEventNotif.get("SubscriberInfo");
JsonNode userList = SubscriberInfo.get("UserList");
- if (application == null)
+ if (application == null||application.asText().length()==0||application.asText().equalsIgnoreCase("null"))
return "Application is mandatory";
if (body == null)
return "body is mandatory";
- if (header.get("eventSource") == null)
+ if (eventSource == null||eventSource.asText().trim().length()==0||eventSource.asText().equalsIgnoreCase("null"))
return "Message Source is mandatory";
if (userList == null)
return "At least one user Id is mandatory";
.split(",");
List<EPUser> users = userNotificationService.getUsersByOrgIds(Arrays.asList(UserIds));
if(users==null||users.size()==0)
- return "Invalid Attuid";
+ return "Invalid Org User ID";
return null;
}