@Controller @RequestMapping(value="/devices") public class DevicesController extends RestController
| Constructor and Description |
|---|
DevicesController() |
| Modifier and Type | Method and Description |
|---|---|
com.sitewhere.spi.device.IDevice |
addDeviceElementMapping(String hardwareId,
com.sitewhere.rest.model.device.DeviceElementMapping request,
javax.servlet.http.HttpServletRequest servletRequest)
Create a new device element mapping.
|
com.sitewhere.spi.device.event.IDeviceEventBatchResponse |
addDeviceEventBatch(String hardwareId,
com.sitewhere.rest.model.device.event.DeviceEventBatch batch,
javax.servlet.http.HttpServletRequest servletRequest)
Add a batch of events for the current assignment of the given device.
|
protected com.sitewhere.spi.device.IDevice |
assertDeviceByHardwareId(String hardwareId,
javax.servlet.http.HttpServletRequest servletRequest)
Gets a device by unique hardware id and throws an exception if not found.
|
com.sitewhere.spi.device.IDevice |
createDevice(com.sitewhere.rest.model.device.request.DeviceCreateRequest request,
javax.servlet.http.HttpServletRequest servletRequest)
Create a device.
|
com.sitewhere.spi.device.IDevice |
deleteDevice(String hardwareId,
boolean force,
javax.servlet.http.HttpServletRequest servletRequest)
Delete device identified by hardware id.
|
com.sitewhere.spi.device.IDevice |
deleteDeviceElementMapping(String hardwareId,
String path,
javax.servlet.http.HttpServletRequest servletRequest) |
com.sitewhere.spi.device.IDevice |
getDeviceByHardwareId(String hardwareId,
boolean includeSpecification,
boolean includeAssignment,
boolean includeSite,
boolean includeAsset,
boolean includeNested,
javax.servlet.http.HttpServletRequest servletRequest)
Used by AJAX calls to find a device by hardware id.
|
com.sitewhere.spi.device.IDeviceAssignment |
getDeviceCurrentAssignment(String hardwareId,
boolean includeAsset,
boolean includeDevice,
boolean includeSite,
javax.servlet.http.HttpServletRequest servletRequest)
List device assignment history for a given device hardware id.
|
org.springframework.http.ResponseEntity<byte[]> |
getDeviceDefaultSymbol(String hardwareId,
javax.servlet.http.HttpServletRequest servletRequest,
javax.servlet.http.HttpServletResponse response)
Get default symbol for device.
|
com.sitewhere.spi.search.ISearchResults<com.sitewhere.spi.device.IDeviceAssignment> |
listDeviceAssignmentHistory(String hardwareId,
boolean includeAsset,
boolean includeDevice,
boolean includeSite,
int page,
int pageSize,
javax.servlet.http.HttpServletRequest servletRequest)
List device assignment history for a given device hardware id.
|
com.sitewhere.spi.search.ISearchResults<com.sitewhere.spi.device.IDevice> |
listDevices(String specification,
String site,
boolean includeDeleted,
boolean excludeAssigned,
boolean includeSpecification,
boolean includeAssignment,
int page,
int pageSize,
Date startDate,
Date endDate,
javax.servlet.http.HttpServletRequest servletRequest)
List devices that match given criteria.
|
com.sitewhere.spi.search.ISearchResults<com.sitewhere.spi.device.IDevice> |
listDevicesForGroup(String groupToken,
String specification,
String site,
boolean includeDeleted,
boolean excludeAssigned,
boolean includeSpecification,
boolean includeAssignment,
int page,
int pageSize,
Date startDate,
Date endDate,
javax.servlet.http.HttpServletRequest servletRequest) |
com.sitewhere.spi.search.ISearchResults<com.sitewhere.spi.device.IDevice> |
listDevicesForGroupsWithRole(String role,
String specification,
String site,
boolean includeDeleted,
boolean excludeAssigned,
boolean includeSpecification,
boolean includeAssignment,
int page,
int pageSize,
Date startDate,
Date endDate,
javax.servlet.http.HttpServletRequest servletRequest) |
com.sitewhere.spi.search.ISearchResults<com.sitewhere.spi.device.IDevice> |
listDevicesForSpecification(String token,
String site,
boolean includeDeleted,
boolean excludeAssigned,
boolean includeSpecification,
boolean includeAssignment,
int page,
int pageSize,
Date startDate,
Date endDate,
javax.servlet.http.HttpServletRequest servletRequest)
Deprecated.
|
com.sitewhere.spi.device.IDevice |
updateDevice(String hardwareId,
com.sitewhere.rest.model.device.request.DeviceCreateRequest request,
javax.servlet.http.HttpServletRequest servletRequest)
Update device information.
|
getTenant, getTenantAuthToken, handleAccessDenied, handleMissingContent, handleRuntimeException, handleSuccessfulAdd, handleSystemException@RequestMapping(method=POST) @ResponseBody @Secured(value="ROLE_REST") public com.sitewhere.spi.device.IDevice createDevice(@RequestBody com.sitewhere.rest.model.device.request.DeviceCreateRequest request, javax.servlet.http.HttpServletRequest servletRequest) throws com.sitewhere.spi.SiteWhereException
request - com.sitewhere.spi.SiteWhereException@RequestMapping(value="/{hardwareId}",
method=GET)
@ResponseBody
@Secured(value="ROLE_REST")
public com.sitewhere.spi.device.IDevice getDeviceByHardwareId(@PathVariable
String hardwareId,
@RequestParam(defaultValue="true")
boolean includeSpecification,
@RequestParam(defaultValue="true")
boolean includeAssignment,
@RequestParam(defaultValue="true")
boolean includeSite,
@RequestParam(defaultValue="true")
boolean includeAsset,
@RequestParam(defaultValue="false")
boolean includeNested,
javax.servlet.http.HttpServletRequest servletRequest)
throws com.sitewhere.spi.SiteWhereException
hardwareId - com.sitewhere.spi.SiteWhereException@RequestMapping(value="/{hardwareId}",
method=PUT)
@ResponseBody
@Secured(value="ROLE_REST")
public com.sitewhere.spi.device.IDevice updateDevice(@PathVariable
String hardwareId,
@RequestBody
com.sitewhere.rest.model.device.request.DeviceCreateRequest request,
javax.servlet.http.HttpServletRequest servletRequest)
throws com.sitewhere.spi.SiteWhereException
hardwareId - unique hardware idrequest - updated informationcom.sitewhere.spi.SiteWhereException@RequestMapping(value="/{hardwareId}",
method=DELETE)
@ResponseBody
@Secured(value="ROLE_REST")
public com.sitewhere.spi.device.IDevice deleteDevice(@PathVariable
String hardwareId,
@RequestParam(defaultValue="false")
boolean force,
javax.servlet.http.HttpServletRequest servletRequest)
throws com.sitewhere.spi.SiteWhereException
hardwareId - com.sitewhere.spi.SiteWhereException@RequestMapping(value="/{hardwareId}/assignment",
method=GET)
@ResponseBody
@Secured(value="ROLE_REST")
public com.sitewhere.spi.device.IDeviceAssignment getDeviceCurrentAssignment(@PathVariable
String hardwareId,
@RequestParam(defaultValue="true")
boolean includeAsset,
@RequestParam(defaultValue="false")
boolean includeDevice,
@RequestParam(defaultValue="true")
boolean includeSite,
javax.servlet.http.HttpServletRequest servletRequest)
throws com.sitewhere.spi.SiteWhereException
hardwareId - com.sitewhere.spi.SiteWhereException@RequestMapping(value="/{hardwareId}/assignments",
method=GET)
@ResponseBody
@Secured(value="ROLE_REST")
public com.sitewhere.spi.search.ISearchResults<com.sitewhere.spi.device.IDeviceAssignment> listDeviceAssignmentHistory(@PathVariable
String hardwareId,
@RequestParam(defaultValue="false")
boolean includeAsset,
@RequestParam(defaultValue="false")
boolean includeDevice,
@RequestParam(defaultValue="false")
boolean includeSite,
@RequestParam(required=false,defaultValue="1")
int page,
@RequestParam(required=false,defaultValue="100")
int pageSize,
javax.servlet.http.HttpServletRequest servletRequest)
throws com.sitewhere.spi.SiteWhereException
hardwareId - com.sitewhere.spi.SiteWhereException@RequestMapping(value="/{hardwareId}/mappings",
method=POST)
@ResponseBody
@Secured(value="ROLE_REST")
public com.sitewhere.spi.device.IDevice addDeviceElementMapping(@PathVariable
String hardwareId,
@RequestBody
com.sitewhere.rest.model.device.DeviceElementMapping request,
javax.servlet.http.HttpServletRequest servletRequest)
throws com.sitewhere.spi.SiteWhereException
request - com.sitewhere.spi.SiteWhereException@RequestMapping(value="/{hardwareId}/mappings",
method=DELETE)
@ResponseBody
@Secured(value="ROLE_REST")
public com.sitewhere.spi.device.IDevice deleteDeviceElementMapping(@PathVariable
String hardwareId,
@RequestParam(required=true)
String path,
javax.servlet.http.HttpServletRequest servletRequest)
throws com.sitewhere.spi.SiteWhereException
@RequestMapping(value="/{hardwareId}/symbol",
method=GET)
@ResponseBody
@Secured(value="ROLE_REST")
public org.springframework.http.ResponseEntity<byte[]> getDeviceDefaultSymbol(@PathVariable
String hardwareId,
javax.servlet.http.HttpServletRequest servletRequest,
javax.servlet.http.HttpServletResponse response)
throws com.sitewhere.spi.SiteWhereException
hardwareId - servletRequest - response - com.sitewhere.spi.SiteWhereException@RequestMapping(method=GET) @ResponseBody @Secured(value="ROLE_REST") public com.sitewhere.spi.search.ISearchResults<com.sitewhere.spi.device.IDevice> listDevices(@RequestParam(required=false) String specification, @RequestParam(required=false) String site, @RequestParam(required=false,defaultValue="false") boolean includeDeleted, @RequestParam(required=false,defaultValue="false") boolean excludeAssigned, @RequestParam(required=false,defaultValue="false") boolean includeSpecification, @RequestParam(required=false,defaultValue="false") boolean includeAssignment, @RequestParam(required=false,defaultValue="1") int page, @RequestParam(required=false,defaultValue="100") int pageSize, @RequestParam(required=false) Date startDate, @RequestParam(required=false) Date endDate, javax.servlet.http.HttpServletRequest servletRequest) throws com.sitewhere.spi.SiteWhereException
com.sitewhere.spi.SiteWhereException@Deprecated @RequestMapping(value="/specification/{token}", method=GET) @ResponseBody @Secured(value="ROLE_REST") public com.sitewhere.spi.search.ISearchResults<com.sitewhere.spi.device.IDevice> listDevicesForSpecification(@PathVariable String token, @RequestParam(required=false) String site, @RequestParam(required=false,defaultValue="false") boolean includeDeleted, @RequestParam(required=false,defaultValue="false") boolean excludeAssigned, @RequestParam(required=false,defaultValue="false") boolean includeSpecification, @RequestParam(required=false,defaultValue="false") boolean includeAssignment, @RequestParam(required=false,defaultValue="1") int page, @RequestParam(required=false,defaultValue="100") int pageSize, @RequestParam(required=false) Date startDate, @RequestParam(required=false) Date endDate, javax.servlet.http.HttpServletRequest servletRequest) throws com.sitewhere.spi.SiteWhereException
@RequestMapping(value="/group/{groupToken}",
method=GET)
@ResponseBody
@Secured(value="ROLE_REST")
public com.sitewhere.spi.search.ISearchResults<com.sitewhere.spi.device.IDevice> listDevicesForGroup(@PathVariable
String groupToken,
@RequestParam(required=false)
String specification,
@RequestParam(required=false)
String site,
@RequestParam(required=false,defaultValue="false")
boolean includeDeleted,
@RequestParam(required=false,defaultValue="false")
boolean excludeAssigned,
@RequestParam(required=false,defaultValue="false")
boolean includeSpecification,
@RequestParam(required=false,defaultValue="false")
boolean includeAssignment,
@RequestParam(required=false,defaultValue="1")
int page,
@RequestParam(required=false,defaultValue="100")
int pageSize,
@RequestParam(required=false)
Date startDate,
@RequestParam(required=false)
Date endDate,
javax.servlet.http.HttpServletRequest servletRequest)
throws com.sitewhere.spi.SiteWhereException
@RequestMapping(value="/grouprole/{role}",
method=GET)
@ResponseBody
@Secured(value="ROLE_REST")
public com.sitewhere.spi.search.ISearchResults<com.sitewhere.spi.device.IDevice> listDevicesForGroupsWithRole(@PathVariable
String role,
@RequestParam(required=false)
String specification,
@RequestParam(required=false)
String site,
@RequestParam(required=false,defaultValue="false")
boolean includeDeleted,
@RequestParam(required=false,defaultValue="false")
boolean excludeAssigned,
@RequestParam(required=false,defaultValue="false")
boolean includeSpecification,
@RequestParam(required=false,defaultValue="false")
boolean includeAssignment,
@RequestParam(required=false,defaultValue="1")
int page,
@RequestParam(required=false,defaultValue="100")
int pageSize,
@RequestParam(required=false)
Date startDate,
@RequestParam(required=false)
Date endDate,
javax.servlet.http.HttpServletRequest servletRequest)
throws com.sitewhere.spi.SiteWhereException
@RequestMapping(value="/{hardwareId}/batch",
method=POST)
@ResponseBody
@Secured(value="ROLE_REST")
public com.sitewhere.spi.device.event.IDeviceEventBatchResponse addDeviceEventBatch(@PathVariable
String hardwareId,
@RequestBody
com.sitewhere.rest.model.device.event.DeviceEventBatch batch,
javax.servlet.http.HttpServletRequest servletRequest)
throws com.sitewhere.spi.SiteWhereException
DeviceEventBatch
object.request - com.sitewhere.spi.SiteWhereExceptionprotected com.sitewhere.spi.device.IDevice assertDeviceByHardwareId(String hardwareId, javax.servlet.http.HttpServletRequest servletRequest) throws com.sitewhere.spi.SiteWhereException
hardwareId - servletRequest - com.sitewhere.spi.SiteWhereExceptionCopyright © 2016 SiteWhere, LLC.. All rights reserved.