Java Code Examples for org.apache.axis2.transport.http.HTTPConstants#HEADER_DELETE

The following examples show how to use org.apache.axis2.transport.http.HTTPConstants#HEADER_DELETE . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: GroupManagementService.java    From carbon-device-mgt with Apache License 2.0 4 votes vote down vote up
@Path("/id/{groupId}")
@DELETE
@ApiOperation(
        produces = MediaType.APPLICATION_JSON,
        httpMethod = HTTPConstants.HEADER_DELETE,
        value = "Delete a group.",
        notes = "If you wish to remove an existing group, that can be done by updating the group using " +
                "this resource.",
        tags = "Device Group Management",
        extensions = {
            @Extension(properties = {
                    @ExtensionProperty(name = Constants.SCOPE, value = "perm:groups:remove")
            })
        }
)
@ApiResponses(value = {
        @ApiResponse(code = 200, message = "OK. \n Group has been deleted successfully.",
                responseHeaders = {
                        @ResponseHeader(
                                name = "Content-Type",
                                description = "The content type of the body."),
                        @ResponseHeader(
                                name = "ETag",
                                description = "Entity Tag of the response resource.\n" +
                                              "Used by caches, or in conditional requests."),
                        @ResponseHeader(
                                name = "Last-Modified",
                                description = "Date and time the resource has been modified the last time.\n" +
                                              "Used by caches, or in conditional requests."),
                }),
        @ApiResponse(
                code = 304,
                message = "Not Modified. \n Empty body because the client has already the latest version of " +
                          "the requested resource."),
        @ApiResponse(
                code = 404,
                message = "Group not found.",
                response = ErrorResponse.class),
        @ApiResponse(
                code = 406,
                message = "Not Acceptable.\n The requested media type is not supported."),
        @ApiResponse(
                code = 500,
                message = "Internal Server Error. \n Server error occurred while removing the group.",
                response = ErrorResponse.class)
})
Response deleteGroup(@ApiParam(
                             name = "groupId",
                             value = "ID of the group to be deleted.",
                             required = true)
                     @PathParam("groupId") int groupId);
 
Example 2
Source File: GroupManagementService.java    From carbon-device-mgt with Apache License 2.0 4 votes vote down vote up
@Path("/id/{groupId}/devices/remove")
@POST
@ApiOperation(
        produces = MediaType.APPLICATION_JSON,
        httpMethod = HTTPConstants.HEADER_DELETE,
        value = "Remove devices from group.",
        notes = "Remove existing devices from the device group.",
        tags = "Device Group Management",
        extensions = {
            @Extension(properties = {
                    @ExtensionProperty(name = Constants.SCOPE, value = "perm:groups:devices-remove")
            })
        }
)
@ApiResponses(value = {
        @ApiResponse(code = 200, message = "OK. \n Successfully removed devices from the group.",
                responseHeaders = {
                        @ResponseHeader(
                                name = "Content-Type",
                                description = "The content type of the body"),
                        @ResponseHeader(
                                name = "ETag",
                                description = "Entity Tag of the response resource.\n" +
                                              "Used by caches, or in conditional requests."),
                        @ResponseHeader(
                                name = "Last-Modified",
                                description = "Date and time the resource has been modified the last time.\n" +
                                              "Used by caches, or in conditional requests."),
                }),
        @ApiResponse(
                code = 304,
                message = "Not Modified. \n Empty body because the client has already the latest version of " +
                          "the requested resource."),
        @ApiResponse(
                code = 404,
                message = "No groups found.",
                response = ErrorResponse.class),
        @ApiResponse(
                code = 406,
                message = "Not Acceptable.\n The requested media type is not supported."),
        @ApiResponse(
                code = 500,
                message = "Internal Server Error. \n Server error occurred while removing devices from the group.",
                response = ErrorResponse.class)
})
Response removeDevicesFromGroup(@ApiParam(
                                        name = "groupId",
                                        value = "ID of the group.",
                                        required = true)
                                @PathParam("groupId") int groupId,
                                @ApiParam(
                                        name = "deviceIdentifiers",
                                        value = "Device identifiers of the devices which needed to be removed.",
                                        required = true)
                                @Valid List<DeviceIdentifier> deviceIdentifiers);
 
Example 3
Source File: UserManagementAdminService.java    From carbon-device-mgt with Apache License 2.0 4 votes vote down vote up
@DELETE
@Path("/{username}/devices")
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_JSON)
@ApiOperation(
        consumes = MediaType.APPLICATION_JSON,
        produces = MediaType.APPLICATION_JSON,
        httpMethod = HTTPConstants.HEADER_DELETE,
        value = "Delete a users associated devices.",
        notes = "If you wish to remove an device details to comply with the privacy requirements, can be done with " +
                "this resource.",
        tags = "Device details remove",
        extensions = {
                @Extension(properties = {
                        @ExtensionProperty(name = Constants.SCOPE, value = "perm:admin-users:remove")
                })
        }
)
@ApiResponses(value = {
        @ApiResponse(code = 200, message = "OK. \n Users devices and details has been deleted successfully.",
                responseHeaders = {
                        @ResponseHeader(
                                name = "Content-Type",
                                description = "The content type of the body."),
                        @ResponseHeader(
                                name = "ETag",
                                description = "Entity Tag of the response resource.\n" +
                                        "Used by caches, or in conditional requests."),
                        @ResponseHeader(
                                name = "Last-Modified",
                                description = "Date and time the resource has been modified the last time.\n" +
                                        "Used by caches, or in conditional requests."),
                }),
        @ApiResponse(
                code = 304,
                message = "Not Modified. \n Empty body because the client has already the latest version of " +
                        "the requested resource."),
        @ApiResponse(
                code = 404,
                message = "Group not found.",
                response = ErrorResponse.class),
        @ApiResponse(
                code = 406,
                message = "Not Acceptable.\n The requested media type is not supported."),
        @ApiResponse(
                code = 500,
                message = "Internal Server Error. \n Server error occurred while removing the group.",
                response = ErrorResponse.class)
})
Response deleteDeviceOfUser(@ApiParam(
        name = "username",
        value = "Username of the users devices to be deleted.",
        required = true)
                     @PathParam("username") String username);
 
Example 4
Source File: GroupManagementService.java    From carbon-device-mgt with Apache License 2.0 4 votes vote down vote up
@Path("/id/{groupId}")
@DELETE
@ApiOperation(
        produces = MediaType.APPLICATION_JSON,
        httpMethod = HTTPConstants.HEADER_DELETE,
        value = "Deleting a Group",
        notes = "If you wish to remove an existing group, that can be done by updating the group using this API.",
        tags = "Device Group Management",
        extensions = {
                @Extension(properties = {
                        @ExtensionProperty(name = Constants.SCOPE, value = "perm:groups:remove")
                })
        }
)
@ApiResponses(value = {
        @ApiResponse(code = 200, message = "OK. \n Group has been deleted successfully.",
                responseHeaders = {
                        @ResponseHeader(
                                name = "Content-Type",
                                description = "The content type of the body."),
                        @ResponseHeader(
                                name = "ETag",
                                description = "Entity Tag of the response resource.\n" +
                                        "Used by caches, or in conditional requests."),
                        @ResponseHeader(
                                name = "Last-Modified",
                                description = "Date and time the resource has been modified the last time.\n" +
                                        "Used by caches, or in conditional requests."),
                }),
        @ApiResponse(
                code = 304,
                message = "Not Modified. \n Empty body because the client has already the latest version of " +
                        "the requested resource."),
        @ApiResponse(
                code = 404,
                message = "Group not found.",
                response = ErrorResponse.class),
        @ApiResponse(
                code = 406,
                message = "Not Acceptable.\n The requested media type is not supported."),
        @ApiResponse(
                code = 500,
                message = "Internal Server Error. \n Server error occurred while removing the group.",
                response = ErrorResponse.class)
})
Response deleteGroup(@ApiParam(
        name = "groupId",
        value = "ID of the group to be deleted.",
        required = true)
                     @PathParam("groupId") int groupId);
 
Example 5
Source File: GroupManagementService.java    From carbon-device-mgt with Apache License 2.0 4 votes vote down vote up
@Path("/id/{groupId}/devices/remove")
@POST
@ApiOperation(
        produces = MediaType.APPLICATION_JSON,
        httpMethod = HTTPConstants.HEADER_DELETE,
        value = "Removing Devices from a Group",
        notes = "Remove a device from a group using this API.",
        tags = "Device Group Management",
        extensions = {
                @Extension(properties = {
                        @ExtensionProperty(name = Constants.SCOPE, value = "perm:groups:devices-remove")
                })
        }
)
@ApiResponses(value = {
        @ApiResponse(code = 200, message = "OK. \n Successfully removed devices from the group.",
                responseHeaders = {
                        @ResponseHeader(
                                name = "Content-Type",
                                description = "The content type of the body"),
                        @ResponseHeader(
                                name = "ETag",
                                description = "Entity Tag of the response resource.\n" +
                                        "Used by caches, or in conditional requests."),
                        @ResponseHeader(
                                name = "Last-Modified",
                                description = "Date and time the resource has been modified the last time.\n" +
                                        "Used by caches, or in conditional requests."),
                }),
        @ApiResponse(
                code = 304,
                message = "Not Modified. \n Empty body because the client has already the latest version of " +
                        "the requested resource."),
        @ApiResponse(
                code = 404,
                message = "No groups found.",
                response = ErrorResponse.class),
        @ApiResponse(
                code = 406,
                message = "Not Acceptable.\n The requested media type is not supported."),
        @ApiResponse(
                code = 500,
                message = "Internal Server Error. \n Server error occurred while removing devices from the group.",
                response = ErrorResponse.class)
})
Response removeDevicesFromGroup(@ApiParam(
        name = "groupId",
        value = "ID of the group.",
        required = true)
                                @PathParam("groupId") int groupId,
                                @ApiParam(
                                        name = "deviceIdentifiers",
                                        value = "The device identifiers of the devices that needed to be removed."+
                                                "  You can define many device IDs as comma separated values.",
                                        required = true)
                                @Valid List<DeviceIdentifier> deviceIdentifiers);