From 9ec80bfe1877692460e71840bff54cf9d38db982 Mon Sep 17 00:00:00 2001 From: prabathabey Date: Fri, 20 May 2016 12:43:47 +0530 Subject: [PATCH] Fixing build failures caused by changed introduced to Operation Management APIs --- .../mqtt/InvalidConfigurationException.java | 22 +++++++++++++++++++ .../device/mgt/jaxrs/api/Operation.java | 6 ++++- .../mgt/jaxrs/api/impl/OperationImpl.java | 5 +++-- 3 files changed, 30 insertions(+), 3 deletions(-) create mode 100644 components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.mqtt/src/main/java/org/wso2/carbon/device/mgt/extensions/push/notification/provider/mqtt/InvalidConfigurationException.java diff --git a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.mqtt/src/main/java/org/wso2/carbon/device/mgt/extensions/push/notification/provider/mqtt/InvalidConfigurationException.java b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.mqtt/src/main/java/org/wso2/carbon/device/mgt/extensions/push/notification/provider/mqtt/InvalidConfigurationException.java new file mode 100644 index 0000000000..337ef72644 --- /dev/null +++ b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.mqtt/src/main/java/org/wso2/carbon/device/mgt/extensions/push/notification/provider/mqtt/InvalidConfigurationException.java @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. + * + * WSO2 Inc. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * + */ +package org.wso2.carbon.device.mgt.extensions.push.notification.provider.mqtt; + +public class InvalidConfigurationException { +} diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/api/Operation.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/api/Operation.java index 3004378df4..759046bff8 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/api/Operation.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/api/Operation.java @@ -186,7 +186,11 @@ public interface Operation { @ApiResponses(value = {@ApiResponse(code = 200, message = "Activity details provided successfully.."), @ApiResponse(code = 500, message = "Error occurred while fetching the activity for the supplied id.")}) @Permission(scope = "operation-view", permissions = {"/permission/admin/device-mgt/admin/devices/view"}) - Response getActivity(@ApiParam(name = "id", value = "Provide activity id {id} as ACTIVITY_(number)", + Response getActivity( + @ApiParam(name = "type", value = "Provide device {type} upon which the activity was performed", + required = true) @PathParam("type") String type, + @ApiParam(name = "id", value = "Provide activity id {id} as ACTIVITY_(number)", required = true) @PathParam("id") String id) throws MDMAPIException; + } diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/api/impl/OperationImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/api/impl/OperationImpl.java index f4631514c9..2fb043bfd3 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/api/impl/OperationImpl.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/api/impl/OperationImpl.java @@ -235,13 +235,13 @@ public class OperationImpl implements org.wso2.carbon.device.mgt.jaxrs.api.Opera @Override @GET @Path("activity/{id}") - public Response getActivity(@PathParam("id") String id) + public Response getActivity(@PathParam("type") String type, @PathParam("id") String id) throws MDMAPIException { org.wso2.carbon.device.mgt.common.operation.mgt.Operation operation; DeviceManagementProviderService dmService; try { dmService = DeviceMgtAPIUtils.getDeviceManagementService(); - operation = dmService.getOperationByActivityId(id); + operation = dmService.getOperationByActivityId(type, id); } catch (OperationManagementException e) { String msg = "Error occurred while fetching the activity for the supplied id."; log.error(msg, e); @@ -249,4 +249,5 @@ public class OperationImpl implements org.wso2.carbon.device.mgt.jaxrs.api.Opera } return Response.status(Response.Status.OK).entity(operation).build(); } + } \ No newline at end of file