|
|
@ -62,7 +62,7 @@ public class EventReceiverServiceImpl implements EventReceiverService {
|
|
|
|
entity(message).build();
|
|
|
|
entity(message).build();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} catch (DataPublisherConfigurationException e) {
|
|
|
|
} catch (DataPublisherConfigurationException e) {
|
|
|
|
String msg = "Error occurred while getting the Data publisher Service.";
|
|
|
|
String msg = "Error occurred while getting the Data publisher Service instance.";
|
|
|
|
log.error(msg, e);
|
|
|
|
log.error(msg, e);
|
|
|
|
throw new UnexpectedServerErrorException(
|
|
|
|
throw new UnexpectedServerErrorException(
|
|
|
|
new ErrorResponse.ErrorResponseBuilder().setCode(500l).setMessage(msg).build());
|
|
|
|
new ErrorResponse.ErrorResponseBuilder().setCode(500l).setMessage(msg).build());
|
|
|
@ -150,7 +150,7 @@ public class EventReceiverServiceImpl implements EventReceiverService {
|
|
|
|
deviceStates = AndroidAPIUtils.getAllEventsForDevice(EVENT_STREAM_DEFINITION, query);
|
|
|
|
deviceStates = AndroidAPIUtils.getAllEventsForDevice(EVENT_STREAM_DEFINITION, query);
|
|
|
|
if (deviceStates == null) {
|
|
|
|
if (deviceStates == null) {
|
|
|
|
message.setResponseCode("No any alerts are published for given Device: " +
|
|
|
|
message.setResponseCode("No any alerts are published for given Device: " +
|
|
|
|
"" + deviceId + " on specific date.");
|
|
|
|
"" + deviceId + "and given specific Type.");
|
|
|
|
return Response.status(Response.Status.NOT_FOUND).entity(message).build();
|
|
|
|
return Response.status(Response.Status.NOT_FOUND).entity(message).build();
|
|
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
@ -158,7 +158,7 @@ public class EventReceiverServiceImpl implements EventReceiverService {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} catch (AnalyticsException e) {
|
|
|
|
} catch (AnalyticsException e) {
|
|
|
|
String msg = "Error occurred while getting published events for specific " +
|
|
|
|
String msg = "Error occurred while getting published events for specific " +
|
|
|
|
"Device: " + deviceId + "and given device Type.";
|
|
|
|
"Device: " + deviceId + "and given specific Type.";
|
|
|
|
log.error(msg, e);
|
|
|
|
log.error(msg, e);
|
|
|
|
throw new UnexpectedServerErrorException(
|
|
|
|
throw new UnexpectedServerErrorException(
|
|
|
|
new ErrorResponse.ErrorResponseBuilder().setCode(500l).setMessage(msg).build());
|
|
|
|
new ErrorResponse.ErrorResponseBuilder().setCode(500l).setMessage(msg).build());
|
|
|
|