diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/services/EventReceiverService.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/services/EventReceiverService.java index 7dc619cd85..c488440906 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/services/EventReceiverService.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/services/EventReceiverService.java @@ -26,7 +26,9 @@ import javax.ws.rs.*; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; -@Api(value = "Event Receiver", description = "Event publishing/retrieving related APIs.") +@Api(value = "Event Receiver", description = "Event publishing/retrieving related APIs.To enable Eventing need to" + + " configure as ref-https://docs.wso2.com/display/EMM210/Managing+Event+Publishing+with+WSO2+Data+Analytics+Server, " + + "https://docs.wso2.com/display/EMM210/Creating+a+New+Event+Stream+and+Receiver") @Path("/events") @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/services/impl/EventReceiverServiceImpl.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/services/impl/EventReceiverServiceImpl.java index b7bb1e5dc0..d80b3606c5 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/services/impl/EventReceiverServiceImpl.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/services/impl/EventReceiverServiceImpl.java @@ -43,7 +43,7 @@ public class EventReceiverServiceImpl implements EventReceiverService { @POST @Path("/publish") @Override - public Response publishEvents(EventBeanWrapper eventBeanWrapper) { + public Response publishEvents(EventBeanWrapper eventBeanWrapper) { if (log.isDebugEnabled()) { log.debug("Invoking Android device even logging."); } @@ -62,7 +62,7 @@ public class EventReceiverServiceImpl implements EventReceiverService { entity(message).build(); } } 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); throw new UnexpectedServerErrorException( new ErrorResponse.ErrorResponseBuilder().setCode(500l).setMessage(msg).build()); @@ -150,7 +150,7 @@ public class EventReceiverServiceImpl implements EventReceiverService { deviceStates = AndroidAPIUtils.getAllEventsForDevice(EVENT_STREAM_DEFINITION, query); if (deviceStates == null) { 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(); } else { @@ -158,7 +158,7 @@ public class EventReceiverServiceImpl implements EventReceiverService { } } catch (AnalyticsException e) { 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); throw new UnexpectedServerErrorException( new ErrorResponse.ErrorResponseBuilder().setCode(500l).setMessage(msg).build()); diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/webapp/META-INF/permissions.xml b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/webapp/META-INF/permissions.xml index 9c6bded302..3251719277 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/webapp/META-INF/permissions.xml +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/webapp/META-INF/permissions.xml @@ -388,7 +388,7 @@ Event Retrieve /device-mgt/android/events/view - /events/* + /events GET emm_admin