package au.gov.ga.geodesy.domain.service;

import org.springframework.stereotype.Component;

import au.gov.ga.geodesy.domain.model.event.Event;
import au.gov.ga.geodesy.domain.model.event.SiteLogReceived;

@Component
public class SiteLogReceivedNotificationService extends EventNotificationService<SiteLogReceived> {

    @Override
    public boolean canHandle(Event e) {
        return e instanceof SiteLogReceived;
    }
}

@@ -52,43 +52,464 @@
 rg.s
-pringframework.stereotype.Component
+lf4j.Logger;%0Aimport org.slf4j.LoggerFactory;%0Aimport org.springframework.stereotype.Component;%0A%0Aimport com.fasterxml.jackson.annotation.JsonFilter;%0Aimport com.fasterxml.jackson.core.JsonProcessingException;%0Aimport com.fasterxml.jackson.databind.ObjectMapper;%0Aimport com.fasterxml.jackson.databind.ser.FilterProvider;%0Aimport com.fasterxml.jackson.databind.ser.impl.SimpleBeanPropertyFilter;%0Aimport com.fasterxml.jackson.databind.ser.impl.SimpleFilterProvider
 ;%0A%0Ai
@@ -618,16 +618,60 @@
 eceived;
+%0Aimport au.gov.ga.geodesy.port.Notification;
 %0A%0A@Compo
@@ -784,101 +784,1533 @@
     
-@Override%0A    public boolean canHandle(Event e) %7B%0A        return e instanceof SiteLogReceived
+private static final Logger log = LoggerFactory.getLogger(SiteLogReceivedNotificationService.class);%0A%0A    private ObjectMapper filteredJson;%0A%0A    @Override%0A    public boolean canHandle(Event e) %7B%0A        return e instanceof SiteLogReceived;%0A    %7D%0A%0A    @JsonFilter(%22excludeSiteLogText%22)%0A    public static class SiteLogReceivedFiltered %7B%7D%0A%0A    public SiteLogReceivedNotificationService() %7B%0A        super();%0A        this.filteredJson = json.copy();%0A%0A        FilterProvider filterProvider = new SimpleFilterProvider()%0A            .addFilter(%22excludeSiteLogText%22,%0A                       SimpleBeanPropertyFilter.serializeAllExcept(%22siteLogText%22));%0A%0A        filteredJson.addMixIn(SiteLogReceived.class, SiteLogReceivedFiltered.class);%0A        filteredJson.setFilterProvider(filterProvider);%0A    %7D%0A%0A    @Override%0A    protected Notification toNotification(SiteLogReceived event) %7B%0A        return new Notification() %7B%0A%0A            public String getSubject() %7B%0A                return event.getName();%0A            %7D%0A%0A            public String getBody() %7B%0A                try %7B%0A                    StringBuilder body = new StringBuilder();%0A                    body.append(filteredJson.writeValueAsString(event));%0A                    return body.toString();%0A                %7D catch (JsonProcessingException e) %7B%0A                    String errorMessage = %22Failed to serialise event with id %22 + event.getId();%0A                    log.error(errorMessage, e);%0A                    return errorMessage;%0A                %7D%0A            %7D%0A        %7D
 ;%0A  

Drop siteLogText from SiteLogReceived SNS msg