@Controller @RequestMapping(value="/devicegroups") public class DeviceGroupsController extends RestController
| Constructor and Description |
|---|
DeviceGroupsController() |
| Modifier and Type | Method and Description |
|---|---|
com.sitewhere.spi.search.ISearchResults<com.sitewhere.spi.device.group.IDeviceGroupElement> |
addDeviceGroupElements(String groupToken,
List<com.sitewhere.rest.model.device.request.DeviceGroupElementCreateRequest> request,
javax.servlet.http.HttpServletRequest servletRequest)
Add a list of device group elements to an existing group.
|
com.sitewhere.spi.device.group.IDeviceGroup |
createDeviceGroup(com.sitewhere.rest.model.device.request.DeviceGroupCreateRequest request,
javax.servlet.http.HttpServletRequest servletRequest)
Create a device group.
|
com.sitewhere.spi.device.group.IDeviceGroup |
deleteDeviceGroup(String groupToken,
boolean force,
javax.servlet.http.HttpServletRequest servletRequest)
Delete an existing device group.
|
com.sitewhere.spi.search.ISearchResults<com.sitewhere.spi.device.group.IDeviceGroupElement> |
deleteDeviceGroupElements(String groupToken,
List<com.sitewhere.rest.model.device.request.DeviceGroupElementCreateRequest> request,
javax.servlet.http.HttpServletRequest servletRequest)
Delete a list of elements from an existing device group.
|
com.sitewhere.spi.device.group.IDeviceGroup |
getDeviceGroupByToken(String groupToken,
javax.servlet.http.HttpServletRequest servletRequest)
Get device group by unique token.
|
com.sitewhere.spi.search.ISearchResults<com.sitewhere.spi.device.group.IDeviceGroupElement> |
listDeviceGroupElements(String groupToken,
boolean includeDetails,
int page,
int pageSize,
javax.servlet.http.HttpServletRequest servletRequest)
List elements from a device group that meet the given criteria.
|
com.sitewhere.spi.search.ISearchResults<com.sitewhere.spi.device.group.IDeviceGroup> |
listDeviceGroups(String role,
boolean includeDeleted,
int page,
int pageSize,
javax.servlet.http.HttpServletRequest servletRequest)
List all device groups.
|
com.sitewhere.spi.device.group.IDeviceGroup |
updateDeviceGroup(String groupToken,
com.sitewhere.rest.model.device.request.DeviceGroupCreateRequest request,
javax.servlet.http.HttpServletRequest servletRequest)
Update an existing device group.
|
protected void |
validateDeviceGroupElements(List<com.sitewhere.rest.model.device.request.DeviceGroupElementCreateRequest> elements,
com.sitewhere.spi.device.IDeviceManagement devices)
Validate new elements to assure they reference real objects.
|
getTenant, getTenantAuthToken, handleAccessDenied, handleMissingContent, handleRuntimeException, handleSuccessfulAdd, handleSystemException@RequestMapping(method=POST) @ResponseBody @Secured(value="ROLE_REST") public com.sitewhere.spi.device.group.IDeviceGroup createDeviceGroup(@RequestBody com.sitewhere.rest.model.device.request.DeviceGroupCreateRequest request, javax.servlet.http.HttpServletRequest servletRequest) throws com.sitewhere.spi.SiteWhereException
request - com.sitewhere.spi.SiteWhereException@RequestMapping(value="/{groupToken}",
method=GET)
@ResponseBody
@Secured(value="ROLE_REST")
public com.sitewhere.spi.device.group.IDeviceGroup getDeviceGroupByToken(@PathVariable
String groupToken,
javax.servlet.http.HttpServletRequest servletRequest)
throws com.sitewhere.spi.SiteWhereException
groupToken - com.sitewhere.spi.SiteWhereException@RequestMapping(value="/{groupToken}",
method=PUT)
@ResponseBody
@Secured(value="ROLE_REST")
public com.sitewhere.spi.device.group.IDeviceGroup updateDeviceGroup(@PathVariable
String groupToken,
@RequestBody
com.sitewhere.rest.model.device.request.DeviceGroupCreateRequest request,
javax.servlet.http.HttpServletRequest servletRequest)
throws com.sitewhere.spi.SiteWhereException
groupToken - request - com.sitewhere.spi.SiteWhereException@RequestMapping(value="/{groupToken}",
method=DELETE)
@ResponseBody
@Secured(value="ROLE_REST")
public com.sitewhere.spi.device.group.IDeviceGroup deleteDeviceGroup(@PathVariable
String groupToken,
@RequestParam(defaultValue="false")
boolean force,
javax.servlet.http.HttpServletRequest servletRequest)
throws com.sitewhere.spi.SiteWhereException
groupToken - force - com.sitewhere.spi.SiteWhereException@RequestMapping(method=GET) @ResponseBody @Secured(value="ROLE_REST") public com.sitewhere.spi.search.ISearchResults<com.sitewhere.spi.device.group.IDeviceGroup> listDeviceGroups(@RequestParam(required=false) String role, @RequestParam(defaultValue="false") boolean includeDeleted, @RequestParam(required=false,defaultValue="1") int page, @RequestParam(required=false,defaultValue="100") int pageSize, javax.servlet.http.HttpServletRequest servletRequest) throws com.sitewhere.spi.SiteWhereException
role - includeDeleted - page - pageSize - com.sitewhere.spi.SiteWhereException@RequestMapping(value="/{groupToken}/elements",
method=GET)
@ResponseBody
@Secured(value="ROLE_REST")
public com.sitewhere.spi.search.ISearchResults<com.sitewhere.spi.device.group.IDeviceGroupElement> listDeviceGroupElements(@PathVariable
String groupToken,
@RequestParam(defaultValue="false")
boolean includeDetails,
@RequestParam(required=false,defaultValue="1")
int page,
@RequestParam(required=false,defaultValue="100")
int pageSize,
javax.servlet.http.HttpServletRequest servletRequest)
throws com.sitewhere.spi.SiteWhereException
groupToken - page - pageSize - com.sitewhere.spi.SiteWhereException@RequestMapping(value="/{groupToken}/elements",
method=PUT)
@ResponseBody
@Secured(value="ROLE_REST")
public com.sitewhere.spi.search.ISearchResults<com.sitewhere.spi.device.group.IDeviceGroupElement> addDeviceGroupElements(@PathVariable
String groupToken,
@RequestBody
List<com.sitewhere.rest.model.device.request.DeviceGroupElementCreateRequest> request,
javax.servlet.http.HttpServletRequest servletRequest)
throws com.sitewhere.spi.SiteWhereException
groupToken - request - com.sitewhere.spi.SiteWhereExceptionprotected void validateDeviceGroupElements(List<com.sitewhere.rest.model.device.request.DeviceGroupElementCreateRequest> elements, com.sitewhere.spi.device.IDeviceManagement devices) throws com.sitewhere.spi.SiteWhereException
elements - devices - com.sitewhere.spi.SiteWhereException@RequestMapping(value="/{groupToken}/elements",
method=DELETE)
@ResponseBody
@Secured(value="ROLE_REST")
public com.sitewhere.spi.search.ISearchResults<com.sitewhere.spi.device.group.IDeviceGroupElement> deleteDeviceGroupElements(@PathVariable
String groupToken,
@RequestBody
List<com.sitewhere.rest.model.device.request.DeviceGroupElementCreateRequest> request,
javax.servlet.http.HttpServletRequest servletRequest)
throws com.sitewhere.spi.SiteWhereException
groupToken - request - com.sitewhere.spi.SiteWhereExceptionCopyright © 2016 SiteWhere, LLC.. All rights reserved.