@Controller @RequestMapping(value="/assignments") public class AssignmentsController extends RestController
| Constructor and Description |
|---|
AssignmentsController() |
| Modifier and Type | Method and Description |
|---|---|
void |
addDeviceStreamData(String token,
String streamId,
Long sequenceNumber,
javax.servlet.http.HttpServletRequest servletRequest,
javax.servlet.http.HttpServletResponse svtResponse)
Adds data to an existing device stream.
|
protected com.sitewhere.spi.device.IDeviceAssignment |
assureAssignment(String token,
javax.servlet.http.HttpServletRequest servletRequest)
Get an assignment by unique token.
|
protected com.sitewhere.spi.device.command.IDeviceCommand |
assureDeviceCommand(String token,
javax.servlet.http.HttpServletRequest servletRequest)
Get a device command by unique token.
|
com.sitewhere.rest.model.device.event.DeviceAlert |
createAlert(com.sitewhere.rest.model.device.event.request.DeviceAlertCreateRequest input,
String token,
javax.servlet.http.HttpServletRequest servletRequest)
Create alert to be associated with a device assignment.
|
com.sitewhere.rest.model.device.event.DeviceCommandInvocation |
createCommandInvocation(com.sitewhere.rest.model.device.event.request.DeviceCommandInvocationCreateRequest request,
String token,
javax.servlet.http.HttpServletRequest servletRequest)
Create command invocation to be associated with a device assignment.
|
com.sitewhere.rest.model.device.event.DeviceCommandResponse |
createCommandResponse(com.sitewhere.rest.model.device.event.request.DeviceCommandResponseCreateRequest input,
String token,
javax.servlet.http.HttpServletRequest servletRequest)
Create command response to be associated with a device assignment.
|
com.sitewhere.rest.model.device.DeviceAssignment |
createDeviceAssignment(com.sitewhere.rest.model.device.request.DeviceAssignmentCreateRequest request,
javax.servlet.http.HttpServletRequest servletRequest)
Used by AJAX calls to create a device assignment.
|
com.sitewhere.rest.model.device.streaming.DeviceStream |
createDeviceStream(com.sitewhere.rest.model.device.request.DeviceStreamCreateRequest request,
String token,
javax.servlet.http.HttpServletRequest servletRequest)
Create a stream to be associated with a device assignment.
|
com.sitewhere.rest.model.device.event.DeviceLocation |
createLocation(com.sitewhere.rest.model.device.event.request.DeviceLocationCreateRequest input,
String token,
javax.servlet.http.HttpServletRequest servletRequest)
Create location to be associated with a device assignment.
|
com.sitewhere.rest.model.device.event.DeviceMeasurements |
createMeasurements(com.sitewhere.rest.model.device.event.request.DeviceMeasurementsCreateRequest input,
String token,
javax.servlet.http.HttpServletRequest servletRequest)
Create measurements to be associated with a device assignment.
|
com.sitewhere.rest.model.device.event.DeviceStateChange |
createStateChange(com.sitewhere.rest.model.device.event.request.DeviceStateChangeCreateRequest input,
String token,
javax.servlet.http.HttpServletRequest servletRequest)
Create state change to be associated with a device assignment.
|
com.sitewhere.rest.model.device.DeviceAssignment |
deleteDeviceAssignment(String token,
boolean force,
javax.servlet.http.HttpServletRequest servletRequest)
Delete an existing device assignment.
|
com.sitewhere.rest.model.device.DeviceAssignment |
endDeviceAssignment(String token,
javax.servlet.http.HttpServletRequest servletRequest)
End an existing device assignment.
|
com.sitewhere.rest.model.device.DeviceAssignment |
getDeviceAssignment(String token,
javax.servlet.http.HttpServletRequest servletRequest)
Get an assignment by its unique token.
|
org.springframework.http.ResponseEntity<byte[]> |
getDeviceAssignmentSymbol(String token,
javax.servlet.http.HttpServletRequest servletRequest,
javax.servlet.http.HttpServletResponse response)
Get the default symbol for a device assignment.
|
com.sitewhere.rest.model.device.streaming.DeviceStream |
getDeviceStream(String token,
String streamId,
javax.servlet.http.HttpServletRequest servletRequest)
Get an existing device stream associated with an assignment.
|
void |
getDeviceStreamData(String token,
String streamId,
long sequenceNumber,
javax.servlet.http.HttpServletRequest servletRequest,
javax.servlet.http.HttpServletResponse svtResponse)
Get a single chunk of data from a device stream.
|
com.sitewhere.spi.search.ISearchResults<com.sitewhere.spi.device.event.IDeviceAlert> |
listAlerts(String token,
int page,
int pageSize,
Date startDate,
Date endDate,
javax.servlet.http.HttpServletRequest servletRequest)
List device alerts for a given assignment.
|
com.sitewhere.spi.search.ISearchResults<com.sitewhere.spi.device.event.IDeviceCommandInvocation> |
listCommandInvocations(String token,
boolean includeCommand,
int page,
int pageSize,
Date startDate,
Date endDate,
javax.servlet.http.HttpServletRequest servletRequest)
List device command invocations for a given assignment.
|
com.sitewhere.spi.search.ISearchResults<com.sitewhere.spi.device.event.IDeviceCommandResponse> |
listCommandResponses(String token,
int page,
int pageSize,
Date startDate,
Date endDate,
javax.servlet.http.HttpServletRequest servletRequest)
List device command responses for a given assignment.
|
void |
listDeviceStreamData(String token,
String streamId,
javax.servlet.http.HttpServletRequest servletRequest,
javax.servlet.http.HttpServletResponse svtResponse) |
com.sitewhere.spi.search.ISearchResults<com.sitewhere.spi.device.streaming.IDeviceStream> |
listDeviceStreams(String token,
int page,
int pageSize,
Date startDate,
Date endDate,
javax.servlet.http.HttpServletRequest servletRequest) |
com.sitewhere.spi.search.ISearchResults<com.sitewhere.spi.device.event.IDeviceEvent> |
listEvents(String token,
int page,
int pageSize,
Date startDate,
Date endDate,
javax.servlet.http.HttpServletRequest servletRequest)
List all device events for an assignment that match the given criteria.
|
com.sitewhere.spi.search.ISearchResults<com.sitewhere.spi.device.event.IDeviceLocation> |
listLocations(String token,
int page,
int pageSize,
Date startDate,
Date endDate,
javax.servlet.http.HttpServletRequest servletRequest)
List device locations for a given assignment.
|
com.sitewhere.spi.search.ISearchResults<com.sitewhere.spi.device.event.IDeviceMeasurements> |
listMeasurements(String token,
int page,
int pageSize,
Date startDate,
Date endDate,
javax.servlet.http.HttpServletRequest servletRequest)
List all device measurements for a given assignment.
|
List<com.sitewhere.spi.device.charting.IChartSeries<Double>> |
listMeasurementsAsChartSeries(String token,
int page,
int pageSize,
Date startDate,
Date endDate,
String[] measurementIds,
javax.servlet.http.HttpServletRequest servletRequest)
List device measurements for a given assignment.
|
com.sitewhere.spi.search.ISearchResults<com.sitewhere.spi.device.event.IDeviceStateChange> |
listStateChanges(String token,
int page,
int pageSize,
Date startDate,
Date endDate,
javax.servlet.http.HttpServletRequest servletRequest)
List device state changes for a given assignment.
|
com.sitewhere.rest.model.device.DeviceAssignment |
missingDeviceAssignment(String token,
javax.servlet.http.HttpServletRequest servletRequest)
Mark a device assignment as missing.
|
com.sitewhere.spi.scheduling.IScheduledJob |
scheduleCommandInvocation(com.sitewhere.rest.model.device.event.request.DeviceCommandInvocationCreateRequest request,
String token,
String scheduleToken,
javax.servlet.http.HttpServletRequest servletRequest) |
com.sitewhere.rest.model.device.DeviceAssignment |
updateDeviceAssignmentMetadata(String token,
com.sitewhere.rest.model.common.MetadataProvider metadata,
javax.servlet.http.HttpServletRequest servletRequest)
Update metadata associated with an assignment.
|
getTenant, getTenantAuthToken, handleAccessDenied, handleMissingContent, handleRuntimeException, handleSuccessfulAdd, handleSystemException@RequestMapping(method=POST) @ResponseBody @Secured(value="ROLE_REST") public com.sitewhere.rest.model.device.DeviceAssignment createDeviceAssignment(@RequestBody com.sitewhere.rest.model.device.request.DeviceAssignmentCreateRequest request, javax.servlet.http.HttpServletRequest servletRequest) throws com.sitewhere.spi.SiteWhereException
request - com.sitewhere.spi.SiteWhereException@RequestMapping(value="/{token}",
method=GET)
@ResponseBody
@Secured(value="ROLE_REST")
public com.sitewhere.rest.model.device.DeviceAssignment getDeviceAssignment(@PathVariable
String token,
javax.servlet.http.HttpServletRequest servletRequest)
throws com.sitewhere.spi.SiteWhereException
token - com.sitewhere.spi.SiteWhereException@RequestMapping(value="/{token}",
method=DELETE)
@ResponseBody
@Secured(value="ROLE_REST")
public com.sitewhere.rest.model.device.DeviceAssignment deleteDeviceAssignment(@PathVariable
String token,
@RequestParam(defaultValue="false")
boolean force,
javax.servlet.http.HttpServletRequest servletRequest)
throws com.sitewhere.spi.SiteWhereException
token - com.sitewhere.spi.SiteWhereException@RequestMapping(value="/{token}/metadata",
method=PUT)
@ResponseBody
@Secured(value="ROLE_REST")
public com.sitewhere.rest.model.device.DeviceAssignment updateDeviceAssignmentMetadata(@PathVariable
String token,
@RequestBody
com.sitewhere.rest.model.common.MetadataProvider metadata,
javax.servlet.http.HttpServletRequest servletRequest)
throws com.sitewhere.spi.SiteWhereException
request - com.sitewhere.spi.SiteWhereException@RequestMapping(value="/{token}/events",
method=GET)
@ResponseBody
@Secured(value="ROLE_REST")
public com.sitewhere.spi.search.ISearchResults<com.sitewhere.spi.device.event.IDeviceEvent> listEvents(@PathVariable
String token,
@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
token - page - pageSize - startDate - endDate - com.sitewhere.spi.SiteWhereException@RequestMapping(value="/{token}/measurements",
method=GET)
@ResponseBody
@Secured(value="ROLE_REST")
public com.sitewhere.spi.search.ISearchResults<com.sitewhere.spi.device.event.IDeviceMeasurements> listMeasurements(@PathVariable
String token,
@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
assignmentToken - com.sitewhere.spi.SiteWhereException@RequestMapping(value="/{token}/measurements/series",
method=GET)
@ResponseBody
@Secured(value="ROLE_REST")
public List<com.sitewhere.spi.device.charting.IChartSeries<Double>> listMeasurementsAsChartSeries(@PathVariable
String token,
@RequestParam(required=false,defaultValue="1")
int page,
@RequestParam(required=false,defaultValue="100")
int pageSize,
@RequestParam(required=false)
Date startDate,
@RequestParam(required=false)
Date endDate,
@RequestParam(required=false)
String[] measurementIds,
javax.servlet.http.HttpServletRequest servletRequest)
throws com.sitewhere.spi.SiteWhereException
assignmentToken - com.sitewhere.spi.SiteWhereException@RequestMapping(value="/{token}/measurements",
method=POST)
@ResponseBody
@Secured(value="ROLE_REST")
public com.sitewhere.rest.model.device.event.DeviceMeasurements createMeasurements(@RequestBody
com.sitewhere.rest.model.device.event.request.DeviceMeasurementsCreateRequest input,
@PathVariable
String token,
javax.servlet.http.HttpServletRequest servletRequest)
throws com.sitewhere.spi.SiteWhereException
input - token - updateState - com.sitewhere.spi.SiteWhereException@RequestMapping(value="/{token}/locations",
method=GET)
@ResponseBody
@Secured(value="ROLE_REST")
public com.sitewhere.spi.search.ISearchResults<com.sitewhere.spi.device.event.IDeviceLocation> listLocations(@PathVariable
String token,
@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
assignmentToken - com.sitewhere.spi.SiteWhereException@RequestMapping(value="/{token}/locations",
method=POST)
@ResponseBody
@Secured(value="ROLE_REST")
public com.sitewhere.rest.model.device.event.DeviceLocation createLocation(@RequestBody
com.sitewhere.rest.model.device.event.request.DeviceLocationCreateRequest input,
@PathVariable
String token,
javax.servlet.http.HttpServletRequest servletRequest)
throws com.sitewhere.spi.SiteWhereException
input - token - updateState - com.sitewhere.spi.SiteWhereException@RequestMapping(value="/{token}/alerts",
method=GET)
@ResponseBody
@Secured(value="ROLE_REST")
public com.sitewhere.spi.search.ISearchResults<com.sitewhere.spi.device.event.IDeviceAlert> listAlerts(@PathVariable
String token,
@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
assignmentToken - com.sitewhere.spi.SiteWhereException@RequestMapping(value="/{token}/alerts",
method=POST)
@ResponseBody
@Secured(value="ROLE_REST")
public com.sitewhere.rest.model.device.event.DeviceAlert createAlert(@RequestBody
com.sitewhere.rest.model.device.event.request.DeviceAlertCreateRequest input,
@PathVariable
String token,
javax.servlet.http.HttpServletRequest servletRequest)
throws com.sitewhere.spi.SiteWhereException
input - token - updateState - com.sitewhere.spi.SiteWhereException@RequestMapping(value="/{token}/streams",
method=POST)
@ResponseBody
@Secured(value="ROLE_REST")
public com.sitewhere.rest.model.device.streaming.DeviceStream createDeviceStream(@RequestBody
com.sitewhere.rest.model.device.request.DeviceStreamCreateRequest request,
@PathVariable
String token,
javax.servlet.http.HttpServletRequest servletRequest)
throws com.sitewhere.spi.SiteWhereException
input - token - com.sitewhere.spi.SiteWhereException@RequestMapping(value="/{token}/streams",
method=GET)
@ResponseBody
@Secured(value="ROLE_REST")
public com.sitewhere.spi.search.ISearchResults<com.sitewhere.spi.device.streaming.IDeviceStream> listDeviceStreams(@PathVariable
String token,
@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="/{token}/streams/{streamId:.+}",
method=GET,
produces="application/json")
@ResponseBody
@Secured(value="ROLE_REST")
public com.sitewhere.rest.model.device.streaming.DeviceStream getDeviceStream(@PathVariable
String token,
@PathVariable
String streamId,
javax.servlet.http.HttpServletRequest servletRequest)
throws com.sitewhere.spi.SiteWhereException
token - streamId - com.sitewhere.spi.SiteWhereException@RequestMapping(value="/{token}/streams/{streamId:.+}",
method=POST)
@ResponseBody
@Secured(value="ROLE_REST")
public void addDeviceStreamData(@PathVariable
String token,
@PathVariable
String streamId,
@RequestParam(required=false)
Long sequenceNumber,
javax.servlet.http.HttpServletRequest servletRequest,
javax.servlet.http.HttpServletResponse svtResponse)
throws com.sitewhere.spi.SiteWhereException
token - streamId - sequenceNumber - svtRequest - svtResponse - com.sitewhere.spi.SiteWhereException@RequestMapping(value="/{token}/streams/{streamId:.+}/data/{sequenceNumber}",
method=GET)
@ResponseBody
@Secured(value="ROLE_REST")
public void getDeviceStreamData(@PathVariable
String token,
@PathVariable
String streamId,
@PathVariable
long sequenceNumber,
javax.servlet.http.HttpServletRequest servletRequest,
javax.servlet.http.HttpServletResponse svtResponse)
throws com.sitewhere.spi.SiteWhereException
token - streamId - sequenceNumber - svtResponse - com.sitewhere.spi.SiteWhereException@RequestMapping(value="/{token}/streams/{streamId:.+}/data",
method=GET)
@ResponseBody
@Secured(value="ROLE_REST")
public void listDeviceStreamData(@PathVariable
String token,
@PathVariable
String streamId,
javax.servlet.http.HttpServletRequest servletRequest,
javax.servlet.http.HttpServletResponse svtResponse)
throws com.sitewhere.spi.SiteWhereException
@RequestMapping(value="/{token}/invocations",
method=POST)
@ResponseBody
@Secured(value="ROLE_REST")
public com.sitewhere.rest.model.device.event.DeviceCommandInvocation createCommandInvocation(@RequestBody
com.sitewhere.rest.model.device.event.request.DeviceCommandInvocationCreateRequest request,
@PathVariable
String token,
javax.servlet.http.HttpServletRequest servletRequest)
throws com.sitewhere.spi.SiteWhereException
input - token - com.sitewhere.spi.SiteWhereException@RequestMapping(value="/{token}/invocations/schedules/{scheduleToken}",
method=POST)
@ResponseBody
@Secured(value="ROLE_REST")
public com.sitewhere.spi.scheduling.IScheduledJob scheduleCommandInvocation(@RequestBody
com.sitewhere.rest.model.device.event.request.DeviceCommandInvocationCreateRequest request,
@PathVariable
String token,
@PathVariable
String scheduleToken,
javax.servlet.http.HttpServletRequest servletRequest)
throws com.sitewhere.spi.SiteWhereException
@RequestMapping(value="/{token}/invocations",
method=GET)
@ResponseBody
@Secured(value="ROLE_REST")
public com.sitewhere.spi.search.ISearchResults<com.sitewhere.spi.device.event.IDeviceCommandInvocation> listCommandInvocations(@PathVariable
String token,
@RequestParam(defaultValue="true")
boolean includeCommand,
@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
assignmentToken - com.sitewhere.spi.SiteWhereException@RequestMapping(value="/{token}/statechanges",
method=POST)
@ResponseBody
@Secured(value="ROLE_REST")
public com.sitewhere.rest.model.device.event.DeviceStateChange createStateChange(@RequestBody
com.sitewhere.rest.model.device.event.request.DeviceStateChangeCreateRequest input,
@PathVariable
String token,
javax.servlet.http.HttpServletRequest servletRequest)
throws com.sitewhere.spi.SiteWhereException
input - token - com.sitewhere.spi.SiteWhereException@RequestMapping(value="/{token}/statechanges",
method=GET)
@ResponseBody
@Secured(value="ROLE_REST")
public com.sitewhere.spi.search.ISearchResults<com.sitewhere.spi.device.event.IDeviceStateChange> listStateChanges(@PathVariable
String token,
@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
assignmentToken - com.sitewhere.spi.SiteWhereException@RequestMapping(value="/{token}/responses",
method=POST)
@ResponseBody
@Secured(value="ROLE_REST")
public com.sitewhere.rest.model.device.event.DeviceCommandResponse createCommandResponse(@RequestBody
com.sitewhere.rest.model.device.event.request.DeviceCommandResponseCreateRequest input,
@PathVariable
String token,
javax.servlet.http.HttpServletRequest servletRequest)
throws com.sitewhere.spi.SiteWhereException
input - token - com.sitewhere.spi.SiteWhereException@RequestMapping(value="/{token}/responses",
method=GET)
@ResponseBody
@Secured(value="ROLE_REST")
public com.sitewhere.spi.search.ISearchResults<com.sitewhere.spi.device.event.IDeviceCommandResponse> listCommandResponses(@PathVariable
String token,
@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
assignmentToken - com.sitewhere.spi.SiteWhereException@RequestMapping(value="/{token}/symbol",
method=GET)
@ResponseBody
@Secured(value="ROLE_REST")
public org.springframework.http.ResponseEntity<byte[]> getDeviceAssignmentSymbol(@PathVariable
String token,
javax.servlet.http.HttpServletRequest servletRequest,
javax.servlet.http.HttpServletResponse response)
throws com.sitewhere.spi.SiteWhereException
token - servletRequest - response - com.sitewhere.spi.SiteWhereException@RequestMapping(value="/{token}/end",
method=POST)
@ResponseBody
@Secured(value="ROLE_REST")
public com.sitewhere.rest.model.device.DeviceAssignment endDeviceAssignment(@PathVariable
String token,
javax.servlet.http.HttpServletRequest servletRequest)
throws com.sitewhere.spi.SiteWhereException
token - com.sitewhere.spi.SiteWhereException@RequestMapping(value="/{token}/missing",
method=POST)
@ResponseBody
@Secured(value="ROLE_REST")
public com.sitewhere.rest.model.device.DeviceAssignment missingDeviceAssignment(@PathVariable
String token,
javax.servlet.http.HttpServletRequest servletRequest)
throws com.sitewhere.spi.SiteWhereException
token - com.sitewhere.spi.SiteWhereExceptionprotected com.sitewhere.spi.device.IDeviceAssignment assureAssignment(String token, javax.servlet.http.HttpServletRequest servletRequest) throws com.sitewhere.spi.SiteWhereException
token - servletRequest - com.sitewhere.spi.SiteWhereExceptionprotected com.sitewhere.spi.device.command.IDeviceCommand assureDeviceCommand(String token, javax.servlet.http.HttpServletRequest servletRequest) throws com.sitewhere.spi.SiteWhereException
token - servletRequest - com.sitewhere.spi.SiteWhereExceptionCopyright © 2016 SiteWhere, LLC.. All rights reserved.