Improving swagger annotations of CDM-F core APIs further

revert-70aa11f8
prabathabey 9 years ago
parent 95458ce9b0
commit 425c0e7498

@ -32,6 +32,7 @@ import javax.ws.rs.core.Response;
* Activity related REST-API implementation. * Activity related REST-API implementation.
*/ */
@API(name = "Activities", version = "1.0.0", context = "/devicemgt_admin/activities", tags = {"devicemgt_admin"}) @API(name = "Activities", version = "1.0.0", context = "/devicemgt_admin/activities", tags = {"devicemgt_admin"})
@Path("/activities") @Path("/activities")
@Api(value = "Activity Info Provider", description = "Activity related information manipulation. For example operation details " + @Api(value = "Activity Info Provider", description = "Activity related information manipulation. For example operation details " +
"and responses from devices.") "and responses from devices.")
@ -48,7 +49,8 @@ public interface ActivityInfoProviderService {
response = Activity.class, response = Activity.class,
value = "Retrieve details of a particular activity.", value = "Retrieve details of a particular activity.",
notes = "This will return information of a particular activity i.e. meta information of an operation, " + notes = "This will return information of a particular activity i.e. meta information of an operation, " +
"etc; including the responses from the devices.") "etc; including the responses from the devices.",
tags = "Activity Info Provider")
@ApiResponses(value = { @ApiResponses(value = {
@ApiResponse( @ApiResponse(
code = 200, code = 200,

@ -45,7 +45,8 @@ public interface ConfigurationManagementService {
httpMethod = "GET", httpMethod = "GET",
value = "Get the general platform configurations.", value = "Get the general platform configurations.",
notes = "Get the general platform level configuration details.", notes = "Get the general platform level configuration details.",
response = PlatformConfiguration.class) response = PlatformConfiguration.class,
tags = "Configuration Management")
@ApiResponses(value = { @ApiResponses(value = {
@ApiResponse( @ApiResponse(
code = 200, code = 200,
@ -90,7 +91,8 @@ public interface ConfigurationManagementService {
produces = MediaType.APPLICATION_JSON, produces = MediaType.APPLICATION_JSON,
httpMethod = "PUT", httpMethod = "PUT",
value = "Update General Platform Configurations.", value = "Update General Platform Configurations.",
notes = "This resource is used to update the general platform configuration.") notes = "This resource is used to update the general platform configuration.",
tags = "Configuration Management")
@ApiResponses(value = { @ApiResponses(value = {
@ApiResponse( @ApiResponse(
code = 200, code = 200,

@ -7,75 +7,75 @@ import javax.ws.rs.Path;
import javax.ws.rs.QueryParam; import javax.ws.rs.QueryParam;
import javax.ws.rs.core.Response; import javax.ws.rs.core.Response;
@Path("/dashboard") //@Path("/dashboard")
@Api(value = "Dashboard", description = "Dashboard related operations are described here.") //@Api(value = "Dashboard", description = "Dashboard related operations are described here.")
@SuppressWarnings("NonJaxWsWebServices") @SuppressWarnings("NonJaxWsWebServices")
public interface Dashboard { public interface Dashboard {
String CONNECTIVITY_STATUS = "connectivity-status"; // String CONNECTIVITY_STATUS = "connectivity-status";
String POTENTIAL_VULNERABILITY = "potential-vulnerability"; // String POTENTIAL_VULNERABILITY = "potential-vulnerability";
String NON_COMPLIANT_FEATURE_CODE = "non-compliant-feature-code"; // String NON_COMPLIANT_FEATURE_CODE = "non-compliant-feature-code";
String PLATFORM = "platform"; // String PLATFORM = "platform";
String OWNERSHIP = "ownership"; // String OWNERSHIP = "ownership";
// Constants related to pagination // // Constants related to pagination
String PAGINATION_ENABLED = "pagination-enabled"; // String PAGINATION_ENABLED = "pagination-enabled";
String START_INDEX = "start"; // String START_INDEX = "start";
String RESULT_COUNT = "length"; // String RESULT_COUNT = "length";
//
@GET // @GET
@Path("device-count-overview") // @Path("device-count-overview")
Response getOverviewDeviceCounts(); // Response getOverviewDeviceCounts();
//
@GET // @GET
@Path("device-counts-by-potential-vulnerabilities") // @Path("device-counts-by-potential-vulnerabilities")
Response getDeviceCountsByPotentialVulnerabilities(); // Response getDeviceCountsByPotentialVulnerabilities();
//
@GET // @GET
@Path("non-compliant-device-counts-by-features") // @Path("non-compliant-device-counts-by-features")
Response getNonCompliantDeviceCountsByFeatures(@QueryParam(START_INDEX) int startIndex, // Response getNonCompliantDeviceCountsByFeatures(@QueryParam(START_INDEX) int startIndex,
@QueryParam(RESULT_COUNT) int resultCount); // @QueryParam(RESULT_COUNT) int resultCount);
//
@GET // @GET
@Path("device-counts-by-groups") // @Path("device-counts-by-groups")
Response getDeviceCountsByGroups(@QueryParam(CONNECTIVITY_STATUS) String connectivityStatus, // Response getDeviceCountsByGroups(@QueryParam(CONNECTIVITY_STATUS) String connectivityStatus,
@QueryParam(POTENTIAL_VULNERABILITY) String potentialVulnerability, // @QueryParam(POTENTIAL_VULNERABILITY) String potentialVulnerability,
@QueryParam(PLATFORM) String platform, // @QueryParam(PLATFORM) String platform,
@QueryParam(OWNERSHIP) String ownership); // @QueryParam(OWNERSHIP) String ownership);
//
@GET // @GET
@Path("feature-non-compliant-device-counts-by-groups") // @Path("feature-non-compliant-device-counts-by-groups")
Response getFeatureNonCompliantDeviceCountsByGroups(@QueryParam(NON_COMPLIANT_FEATURE_CODE) String nonCompliantFeatureCode, // Response getFeatureNonCompliantDeviceCountsByGroups(@QueryParam(NON_COMPLIANT_FEATURE_CODE) String nonCompliantFeatureCode,
@QueryParam(PLATFORM) String platform, // @QueryParam(PLATFORM) String platform,
@QueryParam(OWNERSHIP) String ownership); // @QueryParam(OWNERSHIP) String ownership);
@GET // @GET
@Path("filtered-device-count-over-total") // @Path("filtered-device-count-over-total")
Response getFilteredDeviceCountOverTotal(@QueryParam(CONNECTIVITY_STATUS) String connectivityStatus, // Response getFilteredDeviceCountOverTotal(@QueryParam(CONNECTIVITY_STATUS) String connectivityStatus,
@QueryParam(POTENTIAL_VULNERABILITY) String potentialVulnerability, // @QueryParam(POTENTIAL_VULNERABILITY) String potentialVulnerability,
@QueryParam(PLATFORM) String platform, // @QueryParam(PLATFORM) String platform,
@QueryParam(OWNERSHIP) String ownership); // @QueryParam(OWNERSHIP) String ownership);
//
@GET // @GET
@Path("feature-non-compliant-device-count-over-total") // @Path("feature-non-compliant-device-count-over-total")
Response getFeatureNonCompliantDeviceCountOverTotal(@QueryParam(NON_COMPLIANT_FEATURE_CODE) String nonCompliantFeatureCode, // Response getFeatureNonCompliantDeviceCountOverTotal(@QueryParam(NON_COMPLIANT_FEATURE_CODE) String nonCompliantFeatureCode,
@QueryParam(PLATFORM) String platform, // @QueryParam(PLATFORM) String platform,
@QueryParam(OWNERSHIP) String ownership); // @QueryParam(OWNERSHIP) String ownership);
//
@GET // @GET
@Path("devices-with-details") // @Path("devices-with-details")
Response getDevicesWithDetails(@QueryParam(CONNECTIVITY_STATUS) String connectivityStatus, // Response getDevicesWithDetails(@QueryParam(CONNECTIVITY_STATUS) String connectivityStatus,
@QueryParam(POTENTIAL_VULNERABILITY) String potentialVulnerability, // @QueryParam(POTENTIAL_VULNERABILITY) String potentialVulnerability,
@QueryParam(PLATFORM) String platform, // @QueryParam(PLATFORM) String platform,
@QueryParam(OWNERSHIP) String ownership, // @QueryParam(OWNERSHIP) String ownership,
@QueryParam(PAGINATION_ENABLED) String paginationEnabled, // @QueryParam(PAGINATION_ENABLED) String paginationEnabled,
@QueryParam(START_INDEX) int startIndex, // @QueryParam(START_INDEX) int startIndex,
@QueryParam(RESULT_COUNT) int resultCount); // @QueryParam(RESULT_COUNT) int resultCount);
//
@GET // @GET
@Path("feature-non-compliant-devices-with-details") // @Path("feature-non-compliant-devices-with-details")
Response getFeatureNonCompliantDevicesWithDetails(@QueryParam(NON_COMPLIANT_FEATURE_CODE) String nonCompliantFeatureCode, // Response getFeatureNonCompliantDevicesWithDetails(@QueryParam(NON_COMPLIANT_FEATURE_CODE) String nonCompliantFeatureCode,
@QueryParam(PLATFORM) String platform, // @QueryParam(PLATFORM) String platform,
@QueryParam(OWNERSHIP) String ownership, // @QueryParam(OWNERSHIP) String ownership,
@QueryParam(PAGINATION_ENABLED) String paginationEnabled, // @QueryParam(PAGINATION_ENABLED) String paginationEnabled,
@QueryParam(START_INDEX) int startIndex, // @QueryParam(START_INDEX) int startIndex,
@QueryParam(RESULT_COUNT) int resultCount); // @QueryParam(RESULT_COUNT) int resultCount);
} }

@ -42,6 +42,7 @@ import java.util.List;
* Device related REST-API. This can be used to manipulated device related details. * Device related REST-API. This can be used to manipulated device related details.
*/ */
@API(name = "Device", version = "1.0.0", context = "/api/device-mgt/admin/devices", tags = {"devicemgt_admin"}) @API(name = "Device", version = "1.0.0", context = "/api/device-mgt/admin/devices", tags = {"devicemgt_admin"})
@Path("/devices") @Path("/devices")
@Api(value = "Device Management", description = "This API carries all device management related operations " + @Api(value = "Device Management", description = "This API carries all device management related operations " +
"such as get all the available devices, etc.") "such as get all the available devices, etc.")
@ -56,7 +57,8 @@ public interface DeviceManagementService {
value = "Get the list of devices enrolled with the system.", value = "Get the list of devices enrolled with the system.",
notes = "Returns all devices enrolled with the system.", notes = "Returns all devices enrolled with the system.",
response = Device.class, response = Device.class,
responseContainer = "List") responseContainer = "List",
tags = "Device Management")
@ApiResponses(value = { @ApiResponses(value = {
@ApiResponse(code = 200, message = "OK. \n Successfully fetched the list of devices.", @ApiResponse(code = 200, message = "OK. \n Successfully fetched the list of devices.",
response = Device.class, response = Device.class,
@ -136,7 +138,8 @@ public interface DeviceManagementService {
notes = "This will return device information such as CPU usage, memory usage etc for supplied device " + notes = "This will return device information such as CPU usage, memory usage etc for supplied device " +
"identifiers.", "identifiers.",
response = DeviceInfo.class, response = DeviceInfo.class,
responseContainer = "List") responseContainer = "List",
tags = "Device Management")
@ApiResponses( @ApiResponses(
value = { value = {
@ApiResponse( @ApiResponse(
@ -198,7 +201,8 @@ public interface DeviceManagementService {
httpMethod = "GET", httpMethod = "GET",
value = "Get information of the requested device.", value = "Get information of the requested device.",
notes = "Returns information of the requested device.", notes = "Returns information of the requested device.",
response = Device.class) response = Device.class,
tags = "Device Management")
@ApiResponses( @ApiResponses(
value = { value = {
@ApiResponse( @ApiResponse(
@ -259,7 +263,8 @@ public interface DeviceManagementService {
value = "Get the device location of a given device and a device type.", value = "Get the device location of a given device and a device type.",
notes = "This will return the device location including latitude and longitude as well the " notes = "This will return the device location including latitude and longitude as well the "
+ "physical address.", + "physical address.",
response = DeviceLocation.class) response = DeviceLocation.class,
tags = "Device Management")
@ApiResponses( @ApiResponses(
value = { value = {
@ApiResponse( @ApiResponse(
@ -306,7 +311,8 @@ public interface DeviceManagementService {
"Using this REST API you can get the features that can be carried out on a preferred device type," + "Using this REST API you can get the features that can be carried out on a preferred device type," +
" such as iOS, Android or Windows.", " such as iOS, Android or Windows.",
response = Feature.class, response = Feature.class,
responseContainer = "List") responseContainer = "List",
tags = "Device Management")
@ApiResponses( @ApiResponses(
value = { value = {
@ApiResponse( @ApiResponse(
@ -380,7 +386,8 @@ public interface DeviceManagementService {
value = "Advanced search for devices.", value = "Advanced search for devices.",
notes = "Carry out an advanced search of devices.", notes = "Carry out an advanced search of devices.",
response = DeviceWrapper.class, response = DeviceWrapper.class,
responseContainer = "List") responseContainer = "List",
tags = "Device Management")
@ApiResponses( @ApiResponses(
value = { value = {
@ApiResponse( @ApiResponse(
@ -421,10 +428,6 @@ public interface DeviceManagementService {
}) })
@Permission(scope = "device-search", permissions = {"/permission/admin/device-mgt/admin/devices/list"}) @Permission(scope = "device-search", permissions = {"/permission/admin/device-mgt/admin/devices/list"})
Response searchDevices( Response searchDevices(
@ApiParam(
name = "searchContext",
value = "List of search conditions.",
required = true) SearchContext searchContext,
@ApiParam( @ApiParam(
name = "offset", name = "offset",
value = "Starting point within the complete list of items qualified.", value = "Starting point within the complete list of items qualified.",
@ -434,7 +437,12 @@ public interface DeviceManagementService {
name = "limit", name = "limit",
value = "Maximum size of resource array to return.", value = "Maximum size of resource array to return.",
required = false) required = false)
@QueryParam("limit") int limit); @QueryParam("limit") int limit,
@ApiParam(
name = "searchContext",
value = "List of search conditions.",
required = true)
SearchContext searchContext);
@GET @GET
@Path("/{type}/{id}/applications") @Path("/{type}/{id}/applications")
@ -444,7 +452,8 @@ public interface DeviceManagementService {
value = "Getting installed application details of a device.", value = "Getting installed application details of a device.",
responseContainer = "List", responseContainer = "List",
notes = "Get the list of applications that a device has subscribed.", notes = "Get the list of applications that a device has subscribed.",
response = Application.class) response = Application.class,
tags = "Device Management")
@ApiResponses( @ApiResponses(
value = { value = {
@ApiResponse( @ApiResponse(
@ -530,7 +539,9 @@ public interface DeviceManagementService {
notes = "You will carry out many operations on a device. In a situation where you wish to view the all" + notes = "You will carry out many operations on a device. In a situation where you wish to view the all" +
" the operations carried out on a device it is not feasible to show all the details on one page" + " the operations carried out on a device it is not feasible to show all the details on one page" +
" therefore the details are paginated.", " therefore the details are paginated.",
response = Operation.class) response = Operation.class,
responseContainer = "List",
tags = "Device Management")
@ApiResponses( @ApiResponses(
value = { value = {
@ApiResponse( @ApiResponse(
@ -615,7 +626,8 @@ public interface DeviceManagementService {
notes = "When a device registers with WSO2 EMM a policy is enforced on the device. Initially the EMM " + notes = "When a device registers with WSO2 EMM a policy is enforced on the device. Initially the EMM " +
"filters the policies based on the Platform (device type), filters based on the device ownership" + "filters the policies based on the Platform (device type), filters based on the device ownership" +
" type , filters based on the user role or name and finally the policy is enforced on the device.", " type , filters based on the user role or name and finally the policy is enforced on the device.",
response = Policy.class) response = Policy.class,
tags = "Device Management")
@ApiResponses( @ApiResponses(
value = { value = {
@ApiResponse( @ApiResponse(

@ -26,79 +26,77 @@ import javax.ws.rs.*;
import javax.ws.rs.core.MediaType; import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response; import javax.ws.rs.core.Response;
//@Path("/groups")
@Path("/groups") //@Produces(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON) //@Consumes(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_JSON)
public interface GroupManagementService { public interface GroupManagementService {
@GET // @GET
@Permission(scope = "group-view", permissions = {"/permission/admin/device-mgt/user/groups/list"}) // @Permission(scope = "group-view", permissions = {"/permission/admin/device-mgt/user/groups/list"})
Response getGroups(@QueryParam("offset") int offset, @QueryParam("limit") int limit); // Response getGroups(@QueryParam("user") String user, @QueryParam("offset") int offset,
// @QueryParam("limit") int limit);
@POST //
@Permission(scope = "group-add", permissions = {"/permission/admin/device-mgt/user/groups/add"}) // @POST
Response createGroup(DeviceGroup group); // @Permission(scope = "group-add", permissions = {"/permission/admin/device-mgt/user/groups/add"})
// Response createGroup(DeviceGroup group);
@Path("/{groupName}") //
@GET // @Path("/{groupName}")
@Permission(scope = "group-view", permissions = {"/permission/admin/device-mgt/user/groups/view"}) // @GET
Response getGroup(@PathParam("groupName") String groupName); // @Permission(scope = "group-view", permissions = {"/permission/admin/device-mgt/user/groups/view"})
// Response getGroup(@PathParam("groupName") String groupName);
@Path("/{groupName}") //
@PUT // @Path("/{groupName}")
@Permission(scope = "group-modify", permissions = {"/permission/admin/device-mgt/user/groups/update"}) // @PUT
Response updateGroup(@PathParam("groupName") String groupName, DeviceGroup deviceGroup); // @Permission(scope = "group-modify", permissions = {"/permission/admin/device-mgt/user/groups/update"})
// Response updateGroup(@PathParam("groupName") String groupName, DeviceGroup deviceGroup);
@Path("/{groupName}") //
@DELETE // @Path("/{groupName}")
@Permission(scope = "group-remove", permissions = {"/permission/admin/device-mgt/user/groups/remove"}) // @DELETE
Response deleteGroup(@PathParam("groupName") String groupName); // @Permission(scope = "group-remove", permissions = {"/permission/admin/device-mgt/user/groups/remove"})
// Response deleteGroup(@PathParam("groupName") String groupName);
@Path("/share-group-with-user") //
@POST // @Path("/{groupName}/share-with-user")
@Permission(scope = "group-share", permissions = {"/permission/admin/device-mgt/user/groups/share"}) // @POST
Response shareGroupWithUser(String groupName, String targetUser); // @Permission(scope = "group-share", permissions = {"/permission/admin/device-mgt/user/groups/share"})
// Response shareGroupWithUser(@PathParam("groupName") String groupName, String targetUser);
@Path("/share-group-with-role") //
@POST // @Path("/{groupName}/share-with-role")
@Permission(scope = "group-share", permissions = {"/permission/admin/device-mgt/user/groups/share"}) // @POST
Response shareGroupWithRole(String groupName, String targetRole); // @Permission(scope = "group-share", permissions = {"/permission/admin/device-mgt/user/groups/share"})
// Response shareGroupWithRole(@PathParam("groupName") String groupName, String targetRole);
@Path("/remove-share-with-user") //
@POST // @Path("/{groupName}/remove-share-with-user")
@Permission(scope = "group-share", permissions = {"/permission/admin/device-mgt/user/groups/unshare"}) // @POST
Response removeShareWithUser(@PathParam("groupName") String groupName, @QueryParam("username") String targetUser); // @Permission(scope = "group-share", permissions = {"/permission/admin/device-mgt/user/groups/unshare"})
// Response removeShareWithUser(@PathParam("groupName") String groupName, String targetUser);
@Path("/remove-share-with-role") //
@POST // @Path("/{groupName}/remove-share-with-role")
@Permission(scope = "group-share", permissions = {"/permission/admin/device-mgt/user/groups/unshare"}) // @POST
Response removeShareWithRole(@PathParam("groupName") String groupName, @QueryParam("roleName") String targetUser); // @Permission(scope = "group-share", permissions = {"/permission/admin/device-mgt/user/groups/unshare"})
// Response removeShareWithRole(@PathParam("groupName") String groupName, String targetUser);
@GET //
@Path("/{groupName}/users") // @GET
@Permission(scope = "group-view", permissions = {"/permission/admin/device-mgt/user/groups/list"}) // @Path("/{groupName}/users")
Response getUsersOfGroup(@PathParam("groupName") String groupName); // @Permission(scope = "group-view", permissions = {"/permission/admin/device-mgt/user/groups/list"})
// Response getUsersOfGroup(@PathParam("groupName") String groupName);
@GET //
@Path("/{groupName}/devices") // @GET
@Permission(scope = "group-view", permissions = {"/permission/admin/device-mgt/admin/groups/roles"}) // @Path("/{groupName}/devices")
Response getDevicesOfGroup(@PathParam("groupName") String groupName, @QueryParam("offset") int offset, // @Permission(scope = "group-view", permissions = {"/permission/admin/device-mgt/admin/groups/roles"})
@QueryParam("limit") int limit); // Response getDevicesOfGroup(@PathParam("groupName") String groupName, @QueryParam("offset") int offset,
// @QueryParam("limit") int limit);
@POST //
@Path("/{groupName}/devices") // @POST
@Produces("application/json") // @Path("/{groupName}/devices")
@Permission(scope = "group-add", permissions = {"/permission/admin/device-mgt/user/groups/devices/add"}) // @Produces("application/json")
Response addDeviceToGroup(@PathParam("groupName") String groupName, DeviceIdentifier deviceIdentifier); // @Permission(scope = "group-add", permissions = {"/permission/admin/device-mgt/user/groups/devices/add"})
// Response addDeviceToGroup(@PathParam("groupName") String groupName, DeviceIdentifier deviceIdentifier);
@DELETE //
@Path("/{groupName}/devices") // @DELETE
@Permission(scope = "group-remove", permissions = {"/permission/admin/device-mgt/user/groups/devices/remove"}) // @Path("/{groupName}/devices")
Response removeDeviceFromGroup(@PathParam("groupName") String groupName, @QueryParam("type") String type, // @Permission(scope = "group-remove", permissions = {"/permission/admin/device-mgt/user/groups/devices/remove"})
@QueryParam("id") String id); // Response removeDeviceFromGroup(@PathParam("groupName") String groupName, @QueryParam("type") String type,
// @QueryParam("id") String id);
@GET
Response getGroupsByUser(@QueryParam("user") String user);
} }

@ -46,7 +46,8 @@ public interface NotificationManagementService {
notes = "Get the details of all notifications that were pushed to the device in WSO2 EMM using " notes = "Get the details of all notifications that were pushed to the device in WSO2 EMM using "
+ "this REST API", + "this REST API",
response = Notification.class, response = Notification.class,
responseContainer = "List") responseContainer = "List",
tags = "Device Notification Management")
@ApiResponses( @ApiResponses(
value = { value = {
@ApiResponse( @ApiResponse(
@ -112,7 +113,8 @@ public interface NotificationManagementService {
httpMethod = "PUT", httpMethod = "PUT",
value = "Update the device notification status", value = "Update the device notification status",
notes = "When a user has read the the device notifications, the device notification status must " notes = "When a user has read the the device notifications, the device notification status must "
+ "change from NEW to CHECKED. Update the device notification status using this REST API.") + "change from NEW to CHECKED. Update the device notification status using this REST API.",
tags = "Device Notification Management")
@ApiResponses( @ApiResponses(
value = { value = {
@ApiResponse( @ApiResponse(
@ -167,7 +169,8 @@ public interface NotificationManagementService {
produces = MediaType.APPLICATION_JSON, produces = MediaType.APPLICATION_JSON,
httpMethod = "POST", httpMethod = "POST",
value = "Add a device notification.", value = "Add a device notification.",
notes = "Add a device notification, which will then be sent to a device.") notes = "Add a device notification, which will then be sent to a device.",
tags = "Device Notification Management")
@ApiResponses( @ApiResponses(
value = { value = {
@ApiResponse(code = 201, message = "Created. \n Notification has been added successfully.", @ApiResponse(code = 201, message = "Created. \n Notification has been added successfully.",

@ -45,7 +45,8 @@ public interface PolicyManagementService {
produces = MediaType.APPLICATION_JSON, produces = MediaType.APPLICATION_JSON,
httpMethod = "POST", httpMethod = "POST",
value = "Add a new policy.", value = "Add a new policy.",
notes = "This particular resource can be used to add a new policy, which will be created in in-active state.") notes = "This particular resource can be used to add a new policy, which will be created in in-active state.",
tags = "Device Policy Management")
@ApiResponses( @ApiResponses(
value = { value = {
@ApiResponse( @ApiResponse(
@ -97,7 +98,8 @@ public interface PolicyManagementService {
value = "Get details of policies.", value = "Get details of policies.",
responseContainer = "List", responseContainer = "List",
notes = "Retrieve the details of all the policies that have been created in EMM.", notes = "Retrieve the details of all the policies that have been created in EMM.",
response = Policy.class) response = Policy.class,
tags = "Device Policy Management")
@ApiResponses( @ApiResponses(
value = { value = {
@ApiResponse( @ApiResponse(
@ -153,7 +155,8 @@ public interface PolicyManagementService {
httpMethod = "GET", httpMethod = "GET",
value = "Get details of a policy.", value = "Get details of a policy.",
notes = "Retrieve the details of a given policy that has been created in EMM.", notes = "Retrieve the details of a given policy that has been created in EMM.",
response = Policy.class) response = Policy.class,
tags = "Device Policy Management")
@ApiResponses( @ApiResponses(
value = { value = {
@ApiResponse( @ApiResponse(
@ -207,7 +210,8 @@ public interface PolicyManagementService {
httpMethod = "PUT", httpMethod = "PUT",
value = "Update a policy.", value = "Update a policy.",
notes = "If you wish to make changes to an existing policy, that can be done by updating the policy using " + notes = "If you wish to make changes to an existing policy, that can be done by updating the policy using " +
"this resource.") "this resource.",
tags = "Device Policy Management")
@ApiResponses( @ApiResponses(
value = { value = {
@ApiResponse( @ApiResponse(
@ -259,7 +263,8 @@ public interface PolicyManagementService {
produces = MediaType.APPLICATION_JSON, produces = MediaType.APPLICATION_JSON,
httpMethod = "POST", httpMethod = "POST",
value = "Remove multiple policies.", value = "Remove multiple policies.",
notes = "In situations where you need to delete more than one policy you can do so using this API.") notes = "In situations where you need to delete more than one policy you can do so using this API.",
tags = "Device Policy Management")
@ApiResponses( @ApiResponses(
value = { value = {
@ApiResponse( @ApiResponse(
@ -294,7 +299,8 @@ public interface PolicyManagementService {
httpMethod = "PUT", httpMethod = "PUT",
value = "Activating policies.", value = "Activating policies.",
notes = "Using the REST API command you are able to publish a policy in order to bring a policy that is " + notes = "Using the REST API command you are able to publish a policy in order to bring a policy that is " +
"in the inactive state to the active state.") "in the inactive state to the active state.",
tags = "Device Policy Management")
@ApiResponses( @ApiResponses(
value = { value = {
@ApiResponse(code = 200, message = "Policies have been successfully activated."), @ApiResponse(code = 200, message = "Policies have been successfully activated."),
@ -315,7 +321,8 @@ public interface PolicyManagementService {
httpMethod = "PUT", httpMethod = "PUT",
value = "Deactivating policies.", value = "Deactivating policies.",
notes = "Using the REST API command you are able to unpublish a policy in order to bring a policy that " + notes = "Using the REST API command you are able to unpublish a policy in order to bring a policy that " +
"is in the active state to the inactive state.") "is in the active state to the inactive state.",
tags = "Device Policy Management")
@ApiResponses(value = { @ApiResponses(value = {
@ApiResponse(code = 200, message = "Policies have been successfully deactivated."), @ApiResponse(code = 200, message = "Policies have been successfully deactivated."),
@ApiResponse(code = 500, message = "Error in deactivating policies.") @ApiResponse(code = 500, message = "Error in deactivating policies.")

@ -31,6 +31,7 @@ import javax.ws.rs.core.Response;
import java.util.List; import java.util.List;
@API(name = "Role", version = "1.0.0", context = "/devicemgt_admin/roles", tags = {"devicemgt_admin"}) @API(name = "Role", version = "1.0.0", context = "/devicemgt_admin/roles", tags = {"devicemgt_admin"})
@Path("/roles") @Path("/roles")
@Api(value = "Role Management", description = "Role management related operations can be found here.") @Api(value = "Role Management", description = "Role management related operations can be found here.")
@Produces(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON)
@ -45,7 +46,8 @@ public interface RoleManagementService {
responseContainer = "List", responseContainer = "List",
notes = "If you wish to get the details of all the roles in EMM, you can do so using this REST API. All " + notes = "If you wish to get the details of all the roles in EMM, you can do so using this REST API. All " +
"internal roles, roles created for Service-providers and application related roles are omitted.", "internal roles, roles created for Service-providers and application related roles are omitted.",
response = String.class) response = String.class,
tags = "Role Management")
@ApiResponses( @ApiResponses(
value = { value = {
@ApiResponse( @ApiResponse(
@ -119,7 +121,8 @@ public interface RoleManagementService {
"out by a role. Therefore if you wish to retrieve the permission details of a role, you can do " + "out by a role. Therefore if you wish to retrieve the permission details of a role, you can do " +
"so using this REST API.", "so using this REST API.",
response = UIPermissionNode.class, response = UIPermissionNode.class,
responseContainer = "List" responseContainer = "List",
tags = "Role Management"
) )
@ApiResponses( @ApiResponses(
value = { value = {
@ -174,7 +177,8 @@ public interface RoleManagementService {
httpMethod = "GET", httpMethod = "GET",
value = "Get details of a role.", value = "Get details of a role.",
notes = "If you wish to get the details of a role in EMM, you can do so using this REST API.", notes = "If you wish to get the details of a role in EMM, you can do so using this REST API.",
response = RoleWrapper.class) response = RoleWrapper.class,
tags = "Role Management")
@ApiResponses( @ApiResponses(
value = { value = {
@ApiResponse( @ApiResponse(
@ -226,7 +230,8 @@ public interface RoleManagementService {
produces = MediaType.APPLICATION_JSON, produces = MediaType.APPLICATION_JSON,
httpMethod = "POST", httpMethod = "POST",
value = "Add a role.", value = "Add a role.",
notes = "You are able to add a new role to EMM using the REST API.") notes = "You are able to add a new role to EMM using the REST API.",
tags = "Role Management")
@ApiResponses(value = { @ApiResponses(value = {
@ApiResponse( @ApiResponse(
code = 201, code = 201,
@ -279,7 +284,8 @@ public interface RoleManagementService {
httpMethod = "PUT", httpMethod = "PUT",
value = "Update a role.", value = "Update a role.",
notes = "There will be situations where you will need to update the role details, such as the permissions" + notes = "There will be situations where you will need to update the role details, such as the permissions" +
" or the role name. In such situation you can update the role details.") " or the role name. In such situation you can update the role details.",
tags = "Role Management")
@ApiResponses(value = { @ApiResponses(value = {
@ApiResponse( @ApiResponse(
code = 200, code = 200,
@ -331,7 +337,8 @@ public interface RoleManagementService {
httpMethod = "DELETE", httpMethod = "DELETE",
value = "Delete a role.", value = "Delete a role.",
notes = "In a situation when your Organization identifies that a specific role is no longer required you " + notes = "In a situation when your Organization identifies that a specific role is no longer required you " +
"will need to remove the role details from EMM.") "will need to remove the role details from EMM.",
tags = "Role Management")
@ApiResponses(value = { @ApiResponses(value = {
@ApiResponse( @ApiResponse(
code = 200, code = 200,
@ -364,7 +371,8 @@ public interface RoleManagementService {
"a role using this REST API." + "a role using this REST API." +
"Example: Your Organization hires 30 new engineers. Updating the role details for each user can " + "Example: Your Organization hires 30 new engineers. Updating the role details for each user can " +
"be cumbersome, therefore you can define all the new employees that belong to the engineering " + "be cumbersome, therefore you can define all the new employees that belong to the engineering " +
"role using this API.") "role using this API.",
tags = "Role Management")
@ApiResponses( @ApiResponses(
value = { value = {
@ApiResponse( @ApiResponse(

@ -31,6 +31,7 @@ import java.util.Date;
@API(name = "User Management API", version = "1.0.0", context = "/devicemgt_admin/users", tags = {"devicemgt_admin"}) @API(name = "User Management API", version = "1.0.0", context = "/devicemgt_admin/users", tags = {"devicemgt_admin"})
@Path("/users") @Path("/users")
@Api(value = "User Management", description = "User management related operations can be found here.") @Api(value = "User Management", description = "User management related operations can be found here.")
@Produces(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON)
@ -43,7 +44,8 @@ public interface UserManagementService {
produces = MediaType.APPLICATION_JSON, produces = MediaType.APPLICATION_JSON,
httpMethod = "POST", httpMethod = "POST",
value = "Add a user.", value = "Add a user.",
notes = "A new user can be added to the user management system via this resource") notes = "A new user can be added to the user management system via this resource",
tags = "User Management")
@ApiResponses( @ApiResponses(
value = { value = {
@ApiResponse( @ApiResponse(
@ -92,13 +94,13 @@ public interface UserManagementService {
@GET @GET
@Path("/{username}") @Path("/{username}")
@ApiOperation( @ApiOperation(
consumes = MediaType.APPLICATION_JSON,
produces = MediaType.APPLICATION_JSON, produces = MediaType.APPLICATION_JSON,
httpMethod = "GET", httpMethod = "GET",
value = "Getting details of a user.", value = "Getting details of a user.",
notes = "If you wish to get the details of a specific user that is registered with EMM," notes = "If you wish to get the details of a specific user that is registered with EMM,"
+ " you can do so using the REST API.", + " you can do so using the REST API.",
response = UserWrapper.class) response = UserWrapper.class,
tags = "User Management")
@ApiResponses(value = { @ApiResponses(value = {
@ApiResponse( @ApiResponse(
code = 200, code = 200,
@ -151,7 +153,8 @@ public interface UserManagementService {
httpMethod = "PUT", httpMethod = "PUT",
value = "Update details of a user", value = "Update details of a user",
notes = "There will be situations where you will want to update the user details. In such " notes = "There will be situations where you will want to update the user details. In such "
+ "situation you can update the user details using this REST API.") + "situation you can update the user details using this REST API.",
tags = "User Management")
@ApiResponses(value = { @ApiResponses(value = {
@ApiResponse( @ApiResponse(
code = 200, code = 200,
@ -203,7 +206,8 @@ public interface UserManagementService {
httpMethod = "DELETE", httpMethod = "DELETE",
value = "Deleting a user.", value = "Deleting a user.",
notes = "In a situation where an employee leaves the organization you will need to remove the" notes = "In a situation where an employee leaves the organization you will need to remove the"
+ " user details from EMM. In such situations you can use this REST API to remove a user.") + " user details from EMM. In such situations you can use this REST API to remove a user.",
tags = "User Management")
@ApiResponses(value = { @ApiResponses(value = {
@ApiResponse( @ApiResponse(
code = 200, code = 200,
@ -230,7 +234,8 @@ public interface UserManagementService {
notes = "A user can be assigned to one or more role in EMM. Using this REST API you are " notes = "A user can be assigned to one or more role in EMM. Using this REST API you are "
+ "able to get the role/roles a user is assigned to.", + "able to get the role/roles a user is assigned to.",
response = String.class, response = String.class,
responseContainer = "List") responseContainer = "List",
tags = "User Management")
@ApiResponses(value = { @ApiResponses(value = {
@ApiResponse( @ApiResponse(
code = 200, code = 200,
@ -276,7 +281,8 @@ public interface UserManagementService {
notes = "If you wish to get the details of all the users registered with EMM, you can do so " notes = "If you wish to get the details of all the users registered with EMM, you can do so "
+ "using the REST API", + "using the REST API",
response = UserWrapper.class, response = UserWrapper.class,
responseContainer = "List") responseContainer = "List",
tags = "User Management")
@ApiResponses(value = { @ApiResponses(value = {
@ApiResponse( @ApiResponse(
code = 200, code = 200,
@ -341,7 +347,8 @@ public interface UserManagementService {
+ "You will be given a list of users having the user name with the exact order of the " + "You will be given a list of users having the user name with the exact order of the "
+ "characters you provided.", + "characters you provided.",
response = String.class, response = String.class,
responseContainer = "List") responseContainer = "List",
tags = "User Management")
@ApiResponses(value = { @ApiResponses(value = {
@ApiResponse( @ApiResponse(
code = 200, code = 200,
@ -401,7 +408,8 @@ public interface UserManagementService {
produces = MediaType.APPLICATION_JSON, produces = MediaType.APPLICATION_JSON,
httpMethod = "POST", httpMethod = "POST",
value = "Changing the user password.", value = "Changing the user password.",
notes = "A user is able to change the password to secure their EMM profile via this REST API.") notes = "A user is able to change the password to secure their EMM profile via this REST API.",
tags = "User Management")
@ApiResponses(value = { @ApiResponses(value = {
@ApiResponse( @ApiResponse(
code = 200, code = 200,

@ -46,7 +46,8 @@ public interface ApplicationManagementAdminService {
produces = MediaType.APPLICATION_JSON, produces = MediaType.APPLICATION_JSON,
httpMethod = "POST", httpMethod = "POST",
value = "Application installation API.(Internal API)", value = "Application installation API.(Internal API)",
notes = "This is an internal API used for application installation on a device.") notes = "This is an internal API used for application installation on a device.",
tags = "Application Management Administrative Service")
@ApiResponses(value = { @ApiResponses(value = {
@ApiResponse( @ApiResponse(
code = 200, code = 200,
@ -79,7 +80,8 @@ public interface ApplicationManagementAdminService {
produces = MediaType.APPLICATION_JSON, produces = MediaType.APPLICATION_JSON,
httpMethod = "POST", httpMethod = "POST",
value = "Application un-installation API.(Internal API)", value = "Application un-installation API.(Internal API)",
notes = "This is an internal API used for application uninstallation on a device.") notes = "This is an internal API used for application un-installation on a device.",
tags = "Application Management Administrative Service")
@ApiResponses(value = { @ApiResponses(value = {
@ApiResponse( @ApiResponse(
code = 200, code = 200,

@ -43,7 +43,8 @@ public interface DeviceManagementAdminService {
value = "Get devices by name.", value = "Get devices by name.",
notes = "Get devices by name of the device and tenant that they belong to.", notes = "Get devices by name of the device and tenant that they belong to.",
response = Device.class, response = Device.class,
responseContainer = "List") responseContainer = "List",
tags = "Device Management Administrative Service")
@ApiResponses(value = { @ApiResponses(value = {
@ApiResponse(code = 200, message = "OK. \n Successfully fetched the list of devices.", @ApiResponse(code = 200, message = "OK. \n Successfully fetched the list of devices.",
response = Device.class, response = Device.class,

@ -42,7 +42,8 @@ public interface GroupManagementAdminService {
value = "Get groups by the name.", value = "Get groups by the name.",
notes = "Get devices the name of device and tenant.", notes = "Get devices the name of device and tenant.",
response = DeviceGroupWrapper.class, response = DeviceGroupWrapper.class,
responseContainer = "List") responseContainer = "List",
tags = "Group Management Administrative Service")
@ApiResponses(value = { @ApiResponses(value = {
@ApiResponse(code = 200, message = "OK. \n Successfully fetched the list of groups.", @ApiResponse(code = 200, message = "OK. \n Successfully fetched the list of groups.",
response = DeviceGroupWrapper.class, response = DeviceGroupWrapper.class,

@ -41,7 +41,8 @@ public interface UserManagementAdminService {
produces = MediaType.APPLICATION_JSON, produces = MediaType.APPLICATION_JSON,
httpMethod = "POST", httpMethod = "POST",
value = "Change the user password.", value = "Change the user password.",
notes = "A user is able to change the password to secure their EMM profile via this REST API.") notes = "A user is able to change the password to secure their EMM profile via this REST API.",
tags = "User Management Administrative Service")
@ApiResponses(value = { @ApiResponses(value = {
@ApiResponse( @ApiResponse(
code = 200, code = 200,

@ -42,11 +42,14 @@ import org.wso2.carbon.policy.mgt.common.PolicyManagementException;
import org.wso2.carbon.policy.mgt.core.PolicyManagerService; import org.wso2.carbon.policy.mgt.core.PolicyManagerService;
import javax.ws.rs.*; import javax.ws.rs.*;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response; import javax.ws.rs.core.Response;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
@Path("/devices") @Path("/devices")
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_JSON)
public class DeviceManagementServiceImpl implements DeviceManagementService{ public class DeviceManagementServiceImpl implements DeviceManagementService{
private static final Log log = LogFactory.getLog(DeviceManagementServiceImpl.class); private static final Log log = LogFactory.getLog(DeviceManagementServiceImpl.class);
@ -177,7 +180,7 @@ public class DeviceManagementServiceImpl implements DeviceManagementService{
@POST @POST
@Path("/search-devices") @Path("/search-devices")
@Override @Override
public Response searchDevices(SearchContext searchContext, @QueryParam("offset") int offset, int limit) { public Response searchDevices(@QueryParam("offset") int offset, int limit, SearchContext searchContext) {
SearchManagerService searchManagerService; SearchManagerService searchManagerService;
List<DeviceWrapper> devices; List<DeviceWrapper> devices;
try { try {

@ -33,106 +33,105 @@ import org.wso2.carbon.device.mgt.jaxrs.service.api.GroupManagementService;
import org.wso2.carbon.device.mgt.jaxrs.util.DeviceMgtAPIUtils; import org.wso2.carbon.device.mgt.jaxrs.util.DeviceMgtAPIUtils;
import org.wso2.carbon.policy.mgt.common.DeviceGroupWrapper; import org.wso2.carbon.policy.mgt.common.DeviceGroupWrapper;
import javax.ws.rs.PathParam; import javax.ws.rs.*;
import javax.ws.rs.QueryParam; import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response; import javax.ws.rs.core.Response;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
//@Path("/groups")
//@Produces(MediaType.APPLICATION_JSON)
//@Consumes(MediaType.APPLICATION_JSON)
public class GroupManagementServiceImpl implements GroupManagementService { public class GroupManagementServiceImpl implements GroupManagementService {
private static final Log log = LogFactory.getLog(GroupManagementServiceImpl.class); // private static final Log log = LogFactory.getLog(GroupManagementServiceImpl.class);
//
@Override // @Override
public Response getGroups(@QueryParam("offset") int offset, @QueryParam("limit") int limit) { // public Response getGroups(@QueryParam("user") String user, @QueryParam("offset") int offset,
return null; // @QueryParam("limit") int limit) {
} // try {
// List<DeviceGroupWrapper> groupWrappers = new ArrayList<>();
@Override // GroupManagementProviderService service = DeviceMgtAPIUtils.getGroupManagementProviderService();
public Response createGroup(DeviceGroup group) { // List<DeviceGroup> deviceGroups = service.getGroups(user);
return null; // int tenantId = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId();
} // for (DeviceGroup dg : deviceGroups) {
// DeviceGroupWrapper gw = new DeviceGroupWrapper();
@Override // gw.setId(dg.getId());
public Response getGroup(@PathParam("groupName") String groupName) { // gw.setOwner(dg.getOwner());
return null; // gw.setName(dg.getName());
} // gw.setTenantId(tenantId);
// groupWrappers.add(gw);
@Override // }
public Response updateGroup(@PathParam("groupName") String groupName, DeviceGroup deviceGroup) { // return Response.status(Response.Status.OK).entity(groupWrappers).build();
return null; // } catch (GroupManagementException e) {
} // String error = "Error occurred while getting the groups related to users for policy.";
// log.error(error, e);
@Override // return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(error).build();
public Response deleteGroup(@PathParam("groupName") String groupName) { // }
return null; // }
} //
// @Override
@Override // public Response createGroup(DeviceGroup group) {
public Response shareGroupWithUser(String groupName, String targetUser) { // return null;
return null; // }
} //
// @Override
@Override // public Response getGroup(@PathParam("groupName") String groupName) {
public Response shareGroupWithRole(String groupName, String targetRole) { // return null;
return null; // }
} //
// @Override
@Override // public Response updateGroup(@PathParam("groupName") String groupName, DeviceGroup deviceGroup) {
public Response removeShareWithUser(@PathParam("groupName") String groupName, // return null;
@QueryParam("username") String targetUser) { // }
return null; //
} // @Override
// public Response deleteGroup(@PathParam("groupName") String groupName) {
@Override // return null;
public Response removeShareWithRole(@PathParam("groupName") String groupName, // }
@QueryParam("roleName") String targetUser) { //
return null; // @Override
} // public Response shareGroupWithUser(String groupName, String targetUser) {
// return null;
@Override // }
public Response getUsersOfGroup(@PathParam("groupName") String groupName) { //
return null; // @Override
} // public Response shareGroupWithRole(String groupName, String targetRole) {
// return null;
@Override // }
public Response getDevicesOfGroup(@PathParam("groupName") String groupName, @QueryParam("offset") int offset, //
@QueryParam("limit") int limit) { // @Override
return null; // public Response removeShareWithUser(@PathParam("groupName") String groupName,
} // @QueryParam("username") String targetUser) {
// return null;
@Override // }
public Response addDeviceToGroup(@PathParam("groupName") String groupName, DeviceIdentifier deviceIdentifier) { //
return null; // @Override
} // public Response removeShareWithRole(@PathParam("groupName") String groupName,
// @QueryParam("roleName") String targetUser) {
@Override // return null;
public Response removeDeviceFromGroup(@PathParam("groupName") String groupName, @QueryParam("type") String type, // }
@QueryParam("id") String id) { //
return null; // @Override
} // public Response getUsersOfGroup(@PathParam("groupName") String groupName) {
// return null;
@Override // }
public Response getGroupsByUser(@QueryParam("user") String user) { //
try { // @Override
List<DeviceGroupWrapper> groupWrappers = new ArrayList<>(); // public Response getDevicesOfGroup(@PathParam("groupName") String groupName, @QueryParam("offset") int offset,
GroupManagementProviderService service = DeviceMgtAPIUtils.getGroupManagementProviderService(); // @QueryParam("limit") int limit) {
List<DeviceGroup> deviceGroups = service.getGroups(user); // return null;
int tenantId = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId(); // }
for (DeviceGroup dg : deviceGroups) { //
DeviceGroupWrapper gw = new DeviceGroupWrapper(); // @Override
gw.setId(dg.getId()); // public Response addDeviceToGroup(@PathParam("groupName") String groupName, DeviceIdentifier deviceIdentifier) {
gw.setOwner(dg.getOwner()); // return null;
gw.setName(dg.getName()); // }
gw.setTenantId(tenantId); //
groupWrappers.add(gw); // @Override
} // public Response removeDeviceFromGroup(@PathParam("groupName") String groupName, @QueryParam("type") String type,
return Response.status(Response.Status.OK).entity(groupWrappers).build(); // @QueryParam("id") String id) {
} catch (GroupManagementException e) { // return null;
String error = "Error occurred while getting the groups related to users for policy."; // }
log.error(error, e);
return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(error).build();
}
}
} }

@ -36,10 +36,13 @@ import org.wso2.carbon.policy.mgt.common.PolicyManagementException;
import org.wso2.carbon.policy.mgt.core.PolicyManagerService; import org.wso2.carbon.policy.mgt.core.PolicyManagerService;
import javax.ws.rs.*; import javax.ws.rs.*;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response; import javax.ws.rs.core.Response;
import java.util.List; import java.util.List;
@Path("/policies") @Path("/policies")
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_JSON)
public class PolicyManagementServiceImpl implements PolicyManagementService { public class PolicyManagementServiceImpl implements PolicyManagementService {
private static final Log log = LogFactory.getLog(PolicyManagementServiceImpl.class); private static final Log log = LogFactory.getLog(PolicyManagementServiceImpl.class);

@ -33,11 +33,15 @@ import org.wso2.carbon.user.mgt.common.UIPermissionNode;
import org.wso2.carbon.user.mgt.common.UserAdminException; import org.wso2.carbon.user.mgt.common.UserAdminException;
import javax.ws.rs.*; import javax.ws.rs.*;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response; import javax.ws.rs.core.Response;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.List; import java.util.List;
@Path("/roles")
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_JSON)
public class RoleManagementServiceImpl implements RoleManagementService { public class RoleManagementServiceImpl implements RoleManagementService {
private static final Log log = LogFactory.getLog(RoleManagementServiceImpl.class); private static final Log log = LogFactory.getLog(RoleManagementServiceImpl.class);

@ -35,7 +35,7 @@
<ref bean="roleManagementService"/> <ref bean="roleManagementService"/>
<ref bean="userManagementService"/> <ref bean="userManagementService"/>
<ref bean="userManagementAdminService"/> <ref bean="userManagementAdminService"/>
<ref bean="groupManagementService"/> <!--<ref bean="groupManagementService"/>-->
<ref bean="groupManagementAdminService"/> <ref bean="groupManagementAdminService"/>
<ref bean="applicationManagementAdminService"/> <ref bean="applicationManagementAdminService"/>
<ref bean="dashboardServiceBean"/> <ref bean="dashboardServiceBean"/>
@ -70,7 +70,7 @@
<bean id="policyManagementService" class="org.wso2.carbon.device.mgt.jaxrs.service.impl.PolicyManagementServiceImpl"/> <bean id="policyManagementService" class="org.wso2.carbon.device.mgt.jaxrs.service.impl.PolicyManagementServiceImpl"/>
<bean id="roleManagementService" class="org.wso2.carbon.device.mgt.jaxrs.service.impl.RoleManagementServiceImpl"/> <bean id="roleManagementService" class="org.wso2.carbon.device.mgt.jaxrs.service.impl.RoleManagementServiceImpl"/>
<bean id="userManagementService" class="org.wso2.carbon.device.mgt.jaxrs.service.impl.UserManagementServiceImpl"/> <bean id="userManagementService" class="org.wso2.carbon.device.mgt.jaxrs.service.impl.UserManagementServiceImpl"/>
<bean id="groupManagementService" class="org.wso2.carbon.device.mgt.jaxrs.service.impl.GroupManagementServiceImpl"/> <!--<bean id="groupManagementService" class="org.wso2.carbon.device.mgt.jaxrs.service.impl.GroupManagementServiceImpl"/>-->
<bean id="deviceManagementAdminService" class="org.wso2.carbon.device.mgt.jaxrs.service.impl.admin.DeviceManagementAdminServiceImpl"/> <bean id="deviceManagementAdminService" class="org.wso2.carbon.device.mgt.jaxrs.service.impl.admin.DeviceManagementAdminServiceImpl"/>
<bean id="applicationManagementAdminService" class="org.wso2.carbon.device.mgt.jaxrs.service.impl.admin.ApplicationManagementAdminServiceImpl"/> <bean id="applicationManagementAdminService" class="org.wso2.carbon.device.mgt.jaxrs.service.impl.admin.ApplicationManagementAdminServiceImpl"/>
<bean id="groupManagementAdminService" class="org.wso2.carbon.device.mgt.jaxrs.service.impl.admin.GroupManagementAdminServiceImpl"/> <bean id="groupManagementAdminService" class="org.wso2.carbon.device.mgt.jaxrs.service.impl.admin.GroupManagementAdminServiceImpl"/>

@ -19,18 +19,44 @@
package org.wso2.carbon.device.mgt.common.operation.mgt; package org.wso2.carbon.device.mgt.common.operation.mgt;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.util.List; import java.util.List;
@ApiModel(value = "Activity", description = "An activity instance carries a unique identifier that can be " +
"used to identify a particular operation instance uniquely")
public class Activity { public class Activity {
public enum Type { public enum Type {
CONFIG, MESSAGE, INFO, COMMAND, PROFILE, POLICY CONFIG, MESSAGE, INFO, COMMAND, PROFILE, POLICY
} }
@ApiModelProperty(
name = "activityId",
value = "Activity identifier",
required = true)
private String activityId; private String activityId;
@ApiModelProperty(
name = "code",
value = "Activity code",
required = true)
private String code; private String code;
@ApiModelProperty(
name = "type",
value = "Activity type",
required = true,
allowableValues = "CONFIG, MESSAGE, INFO, COMMAND, PROFILE, POLICY")
private Type type; private Type type;
@ApiModelProperty(
name = "createdTimeStamp",
value = "Timestamp recorded when the activity took place",
required = true)
private String createdTimeStamp; private String createdTimeStamp;
@ApiModelProperty(
name = "activityStatuses",
value = "Collection of statuses corresponding to the activity",
required = true)
private List<ActivityStatus> activityStatus; private List<ActivityStatus> activityStatus;
public String getActivityId() { public String getActivityId() {

Loading…
Cancel
Save