merge-requests/7/head
mharindu 9 years ago
commit 8746c228f3

@ -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 {
}

@ -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;
}

@ -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();
}
}
Loading…
Cancel
Save