|
|
@ -42,7 +42,7 @@ public class EventServiceImpl implements EventService {
|
|
|
|
|
|
|
|
|
|
|
|
@POST
|
|
|
|
@POST
|
|
|
|
public Response publishEvents(@HeaderParam(ACCEPT) String acceptHeader,
|
|
|
|
public Response publishEvents(@HeaderParam(ACCEPT) String acceptHeader,
|
|
|
|
EventBeanWrapper eventBeanWrapper) throws AndroidAgentException {
|
|
|
|
EventBeanWrapper eventBeanWrapper) {
|
|
|
|
|
|
|
|
|
|
|
|
if (log.isDebugEnabled()) {
|
|
|
|
if (log.isDebugEnabled()) {
|
|
|
|
log.debug("Invoking Android device even logging.");
|
|
|
|
log.debug("Invoking Android device even logging.");
|
|
|
@ -73,7 +73,7 @@ public class EventServiceImpl implements EventService {
|
|
|
|
@Produces("application/json")
|
|
|
|
@Produces("application/json")
|
|
|
|
@GET
|
|
|
|
@GET
|
|
|
|
public Response retrieveAlert(@HeaderParam(ACCEPT) String acceptHeader,
|
|
|
|
public Response retrieveAlert(@HeaderParam(ACCEPT) String acceptHeader,
|
|
|
|
@PathParam("deviceId") String deviceId) throws AndroidAgentException {
|
|
|
|
@PathParam("deviceId") String deviceId) {
|
|
|
|
|
|
|
|
|
|
|
|
if (log.isDebugEnabled()) {
|
|
|
|
if (log.isDebugEnabled()) {
|
|
|
|
log.debug("Retrieving events for given device Identifier.");
|
|
|
|
log.debug("Retrieving events for given device Identifier.");
|
|
|
@ -104,7 +104,7 @@ public class EventServiceImpl implements EventService {
|
|
|
|
@GET
|
|
|
|
@GET
|
|
|
|
public Response retrieveAlertFromDate(@HeaderParam(ACCEPT) String acceptHeader,
|
|
|
|
public Response retrieveAlertFromDate(@HeaderParam(ACCEPT) String acceptHeader,
|
|
|
|
@PathParam("deviceId") String deviceId, @QueryParam("from") long from,
|
|
|
|
@PathParam("deviceId") String deviceId, @QueryParam("from") long from,
|
|
|
|
@QueryParam("to") long to) throws AndroidAgentException {
|
|
|
|
@QueryParam("to") long to) {
|
|
|
|
String fromDate = String.valueOf(from);
|
|
|
|
String fromDate = String.valueOf(from);
|
|
|
|
String toDate = String.valueOf(to);
|
|
|
|
String toDate = String.valueOf(to);
|
|
|
|
if (log.isDebugEnabled()) {
|
|
|
|
if (log.isDebugEnabled()) {
|
|
|
@ -136,8 +136,7 @@ public class EventServiceImpl implements EventService {
|
|
|
|
@Path("{deviceId}/type/{type}")
|
|
|
|
@Path("{deviceId}/type/{type}")
|
|
|
|
@GET
|
|
|
|
@GET
|
|
|
|
public Response retrieveAlertType(@HeaderParam(ACCEPT) String acceptHeader,
|
|
|
|
public Response retrieveAlertType(@HeaderParam(ACCEPT) String acceptHeader,
|
|
|
|
@PathParam("deviceId") String deviceId, @PathParam("type") String type)
|
|
|
|
@PathParam("deviceId") String deviceId, @PathParam("type") String type) {
|
|
|
|
throws AndroidAgentException {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (log.isDebugEnabled()) {
|
|
|
|
if (log.isDebugEnabled()) {
|
|
|
|
log.debug("Retrieving events for given device identifier and type.");
|
|
|
|
log.debug("Retrieving events for given device identifier and type.");
|
|
|
@ -149,8 +148,8 @@ public class EventServiceImpl implements EventService {
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
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 + " on specific date.");
|
|
|
|
return Response.status(Response.Status.OK).entity(message).build();
|
|
|
|
return Response.status(Response.Status.OK).entity(message).build();
|
|
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|