@Controller @RequestMapping(value="/assets") public class AssetsController extends RestController
| Constructor and Description |
|---|
AssetsController() |
| Modifier and Type | Method and Description |
|---|---|
com.sitewhere.spi.asset.IAssetCategory |
createAssetCategory(com.sitewhere.rest.model.asset.request.AssetCategoryCreateRequest request,
javax.servlet.http.HttpServletRequest servletRequest)
Create a new asset category.
|
com.sitewhere.spi.asset.IHardwareAsset |
createHardwareAsset(String categoryId,
com.sitewhere.rest.model.asset.request.HardwareAssetCreateRequest request,
javax.servlet.http.HttpServletRequest servletRequest)
Creates a new hardware asset in the category.
|
com.sitewhere.spi.asset.ILocationAsset |
createLocationAsset(String categoryId,
com.sitewhere.rest.model.asset.request.LocationAssetCreateRequest request,
javax.servlet.http.HttpServletRequest servletRequest)
Creates a new location asset in the category.
|
com.sitewhere.spi.asset.IPersonAsset |
createPersonAsset(String categoryId,
com.sitewhere.rest.model.asset.request.PersonAssetCreateRequest request,
javax.servlet.http.HttpServletRequest servletRequest)
Creates a new person asset in the category.
|
com.sitewhere.spi.asset.IAssetCategory |
deleteAssetCategory(String categoryId,
javax.servlet.http.HttpServletRequest servletRequest)
Delete an existing asset category.
|
com.sitewhere.spi.asset.IAsset |
deleteCategoryAsset(String categoryId,
String assetId,
javax.servlet.http.HttpServletRequest servletRequest)
Delete an asset from a category based on unique id.
|
com.sitewhere.spi.asset.IAsset |
getAssetById(String assetModuleId,
String assetId,
javax.servlet.http.HttpServletRequest servletRequest)
Get an asset from an
IAssetModule by unique id. |
com.sitewhere.spi.asset.IAssetCategory |
getAssetCategoryById(String categoryId,
javax.servlet.http.HttpServletRequest servletRequest)
Get an asset category by unique id.
|
com.sitewhere.rest.model.asset.AssetModule |
getAssetModule(String assetModuleId,
javax.servlet.http.HttpServletRequest servletRequest)
Search for assets in an
IAssetModule that meet the given criteria. |
com.sitewhere.spi.search.ISearchResults<com.sitewhere.spi.device.IDeviceAssignment> |
getAssignmentsForAsset(String assetModuleId,
String assetId,
String siteToken,
String status,
int page,
int pageSize,
javax.servlet.http.HttpServletRequest servletRequest)
Get all assignments for a given asset.
|
com.sitewhere.spi.asset.IAsset |
getCategoryAsset(String categoryId,
String assetId,
javax.servlet.http.HttpServletRequest servletRequest)
Get an asset from a category by unique id.
|
com.sitewhere.spi.search.ISearchResults<com.sitewhere.spi.asset.IAssetCategory> |
listAssetCategories(int page,
int pageSize,
javax.servlet.http.HttpServletRequest servletRequest)
List asset categories that match the given search criteria.
|
List<com.sitewhere.rest.model.asset.AssetModule> |
listAssetModules(String assetType,
javax.servlet.http.HttpServletRequest servletRequest)
List all asset modules.
|
com.sitewhere.spi.search.ISearchResults<com.sitewhere.spi.asset.IAsset> |
listCategoryAssets(String categoryId,
int page,
int pageSize,
javax.servlet.http.HttpServletRequest servletRequest)
List all assets for a given category.
|
List<com.sitewhere.spi.command.ICommandResponse> |
refreshModules(javax.servlet.http.HttpServletRequest servletRequest)
Refresh all asset modules.
|
com.sitewhere.rest.model.search.SearchResults<? extends com.sitewhere.spi.asset.IAsset> |
searchAssets(String assetModuleId,
String criteria,
javax.servlet.http.HttpServletRequest servletRequest)
Search for assets in an
IAssetModule that meet the given criteria. |
com.sitewhere.spi.asset.IAssetCategory |
updateAssetCategory(String categoryId,
com.sitewhere.rest.model.asset.request.AssetCategoryCreateRequest request,
javax.servlet.http.HttpServletRequest servletRequest)
Update an existing asset category.
|
com.sitewhere.spi.asset.IHardwareAsset |
updateHardwareAsset(String categoryId,
String assetId,
com.sitewhere.rest.model.asset.request.HardwareAssetCreateRequest request,
javax.servlet.http.HttpServletRequest servletRequest)
Update an existing hardware asset.
|
com.sitewhere.spi.asset.ILocationAsset |
updateLocationAsset(String categoryId,
String assetId,
com.sitewhere.rest.model.asset.request.LocationAssetCreateRequest request,
javax.servlet.http.HttpServletRequest servletRequest)
Update an existing location asset.
|
com.sitewhere.spi.asset.IPersonAsset |
updatePersonAsset(String categoryId,
String assetId,
com.sitewhere.rest.model.asset.request.PersonAssetCreateRequest request,
javax.servlet.http.HttpServletRequest servletRequest)
Update an existing person asset.
|
getTenant, getTenantAuthToken, handleAccessDenied, handleMissingContent, handleRuntimeException, handleSuccessfulAdd, handleSystemException@RequestMapping(value="/modules/{assetModuleId}",
method=GET)
@ResponseBody
@Secured(value="ROLE_REST")
public com.sitewhere.rest.model.asset.AssetModule getAssetModule(@PathVariable
String assetModuleId,
javax.servlet.http.HttpServletRequest servletRequest)
throws com.sitewhere.spi.SiteWhereException
IAssetModule that meet the given criteria.assetModuleId - criteria - com.sitewhere.spi.SiteWhereException@RequestMapping(value="/modules/{assetModuleId}/assets",
method=GET)
@ResponseBody
@Secured(value="ROLE_REST")
public com.sitewhere.rest.model.search.SearchResults<? extends com.sitewhere.spi.asset.IAsset> searchAssets(@PathVariable
String assetModuleId,
@RequestParam(defaultValue="")
String criteria,
javax.servlet.http.HttpServletRequest servletRequest)
throws com.sitewhere.spi.SiteWhereException
IAssetModule that meet the given criteria.assetModuleId - criteria - com.sitewhere.spi.SiteWhereException@RequestMapping(value="/modules/{assetModuleId}/assets/{assetId}",
method=GET)
@ResponseBody
@Secured(value="ROLE_REST")
public com.sitewhere.spi.asset.IAsset getAssetById(@PathVariable
String assetModuleId,
@PathVariable
String assetId,
javax.servlet.http.HttpServletRequest servletRequest)
throws com.sitewhere.spi.SiteWhereException
IAssetModule by unique id.assetModuleId - assetId - com.sitewhere.spi.SiteWhereException@RequestMapping(value="/modules/{assetModuleId}/assets/{assetId}/assignments",
method=GET)
@ResponseBody
@Secured(value="ROLE_REST")
public com.sitewhere.spi.search.ISearchResults<com.sitewhere.spi.device.IDeviceAssignment> getAssignmentsForAsset(@PathVariable
String assetModuleId,
@PathVariable
String assetId,
@RequestParam
String siteToken,
@RequestParam(required=false)
String status,
@RequestParam(required=false,defaultValue="1")
int page,
@RequestParam(required=false,defaultValue="100")
int pageSize,
javax.servlet.http.HttpServletRequest servletRequest)
throws com.sitewhere.spi.SiteWhereException
assetModuleId - assetId - siteToken - page - pageSize - com.sitewhere.spi.SiteWhereException@RequestMapping(value="/modules",
method=GET)
@ResponseBody
@Secured(value="ROLE_REST")
public List<com.sitewhere.rest.model.asset.AssetModule> listAssetModules(@RequestParam(required=false)
String assetType,
javax.servlet.http.HttpServletRequest servletRequest)
throws com.sitewhere.spi.SiteWhereException
com.sitewhere.spi.SiteWhereException@RequestMapping(value="/modules/refresh",
method=POST)
@ResponseBody
@Secured(value="ROLE_REST")
public List<com.sitewhere.spi.command.ICommandResponse> refreshModules(javax.servlet.http.HttpServletRequest servletRequest)
throws com.sitewhere.spi.SiteWhereException
com.sitewhere.spi.SiteWhereException@RequestMapping(value="/categories",
method=POST)
@ResponseBody
@Secured(value="ROLE_REST")
public com.sitewhere.spi.asset.IAssetCategory createAssetCategory(@RequestBody
com.sitewhere.rest.model.asset.request.AssetCategoryCreateRequest request,
javax.servlet.http.HttpServletRequest servletRequest)
throws com.sitewhere.spi.SiteWhereException
request - com.sitewhere.spi.SiteWhereException@RequestMapping(value="/categories/{categoryId}",
method=PUT)
@ResponseBody
@Secured(value="ROLE_REST")
public com.sitewhere.spi.asset.IAssetCategory updateAssetCategory(@PathVariable
String categoryId,
@RequestBody
com.sitewhere.rest.model.asset.request.AssetCategoryCreateRequest request,
javax.servlet.http.HttpServletRequest servletRequest)
throws com.sitewhere.spi.SiteWhereException
categoryId - request - com.sitewhere.spi.SiteWhereException@RequestMapping(value="/categories/{categoryId}",
method=GET)
@ResponseBody
@Secured(value="ROLE_REST")
public com.sitewhere.spi.asset.IAssetCategory getAssetCategoryById(@PathVariable
String categoryId,
javax.servlet.http.HttpServletRequest servletRequest)
throws com.sitewhere.spi.SiteWhereException
categoryId - com.sitewhere.spi.SiteWhereException@RequestMapping(value="/categories/{categoryId}",
method=DELETE)
@ResponseBody
@Secured(value="ROLE_REST")
public com.sitewhere.spi.asset.IAssetCategory deleteAssetCategory(@PathVariable
String categoryId,
javax.servlet.http.HttpServletRequest servletRequest)
throws com.sitewhere.spi.SiteWhereException
categoryId - com.sitewhere.spi.SiteWhereException@RequestMapping(value="/categories",
method=GET)
@ResponseBody
@Secured(value="ROLE_REST")
public com.sitewhere.spi.search.ISearchResults<com.sitewhere.spi.asset.IAssetCategory> listAssetCategories(@RequestParam(required=false,defaultValue="1")
int page,
@RequestParam(required=false,defaultValue="100")
int pageSize,
javax.servlet.http.HttpServletRequest servletRequest)
throws com.sitewhere.spi.SiteWhereException
page - pageSize - com.sitewhere.spi.SiteWhereException@RequestMapping(value="/categories/{categoryId}/persons",
method=POST)
@ResponseBody
@Secured(value="ROLE_REST")
public com.sitewhere.spi.asset.IPersonAsset createPersonAsset(@PathVariable
String categoryId,
@RequestBody
com.sitewhere.rest.model.asset.request.PersonAssetCreateRequest request,
javax.servlet.http.HttpServletRequest servletRequest)
throws com.sitewhere.spi.SiteWhereException
categoryId - request - com.sitewhere.spi.SiteWhereException@RequestMapping(value="/categories/{categoryId}/persons/{assetId}",
method=PUT)
@ResponseBody
@Secured(value="ROLE_REST")
public com.sitewhere.spi.asset.IPersonAsset updatePersonAsset(@PathVariable
String categoryId,
@PathVariable
String assetId,
@RequestBody
com.sitewhere.rest.model.asset.request.PersonAssetCreateRequest request,
javax.servlet.http.HttpServletRequest servletRequest)
throws com.sitewhere.spi.SiteWhereException
categoryId - assetId - request - com.sitewhere.spi.SiteWhereException@RequestMapping(value="/categories/{categoryId}/hardware",
method=POST)
@ResponseBody
@Secured(value="ROLE_REST")
public com.sitewhere.spi.asset.IHardwareAsset createHardwareAsset(@PathVariable
String categoryId,
@RequestBody
com.sitewhere.rest.model.asset.request.HardwareAssetCreateRequest request,
javax.servlet.http.HttpServletRequest servletRequest)
throws com.sitewhere.spi.SiteWhereException
categoryId - request - com.sitewhere.spi.SiteWhereException@RequestMapping(value="/categories/{categoryId}/hardware/{assetId}",
method=PUT)
@ResponseBody
@Secured(value="ROLE_REST")
public com.sitewhere.spi.asset.IHardwareAsset updateHardwareAsset(@PathVariable
String categoryId,
@PathVariable
String assetId,
@RequestBody
com.sitewhere.rest.model.asset.request.HardwareAssetCreateRequest request,
javax.servlet.http.HttpServletRequest servletRequest)
throws com.sitewhere.spi.SiteWhereException
categoryId - assetId - request - com.sitewhere.spi.SiteWhereException@RequestMapping(value="/categories/{categoryId}/locations",
method=POST)
@ResponseBody
@Secured(value="ROLE_REST")
public com.sitewhere.spi.asset.ILocationAsset createLocationAsset(@PathVariable
String categoryId,
@RequestBody
com.sitewhere.rest.model.asset.request.LocationAssetCreateRequest request,
javax.servlet.http.HttpServletRequest servletRequest)
throws com.sitewhere.spi.SiteWhereException
categoryId - request - com.sitewhere.spi.SiteWhereException@RequestMapping(value="/categories/{categoryId}/locations/{assetId}",
method=PUT)
@ResponseBody
@Secured(value="ROLE_REST")
public com.sitewhere.spi.asset.ILocationAsset updateLocationAsset(@PathVariable
String categoryId,
@PathVariable
String assetId,
@RequestBody
com.sitewhere.rest.model.asset.request.LocationAssetCreateRequest request,
javax.servlet.http.HttpServletRequest servletRequest)
throws com.sitewhere.spi.SiteWhereException
categoryId - assetId - request - com.sitewhere.spi.SiteWhereException@RequestMapping(value="/categories/{categoryId}/assets/{assetId}",
method=GET)
@ResponseBody
@Secured(value="ROLE_REST")
public com.sitewhere.spi.asset.IAsset getCategoryAsset(@PathVariable
String categoryId,
@PathVariable
String assetId,
javax.servlet.http.HttpServletRequest servletRequest)
throws com.sitewhere.spi.SiteWhereException
categoryId - assetId - com.sitewhere.spi.SiteWhereException@RequestMapping(value="/categories/{categoryId}/assets/{assetId}",
method=DELETE)
@ResponseBody
@Secured(value="ROLE_REST")
public com.sitewhere.spi.asset.IAsset deleteCategoryAsset(@PathVariable
String categoryId,
@PathVariable
String assetId,
javax.servlet.http.HttpServletRequest servletRequest)
throws com.sitewhere.spi.SiteWhereException
categoryId - assetId - com.sitewhere.spi.SiteWhereException@RequestMapping(value="/categories/{categoryId}/assets",
method=GET)
@ResponseBody
@Secured(value="ROLE_REST")
public com.sitewhere.spi.search.ISearchResults<com.sitewhere.spi.asset.IAsset> listCategoryAssets(@PathVariable
String categoryId,
@RequestParam(required=false,defaultValue="1")
int page,
@RequestParam(required=false,defaultValue="100")
int pageSize,
javax.servlet.http.HttpServletRequest servletRequest)
throws com.sitewhere.spi.SiteWhereException
categoryId - page - pageSize - com.sitewhere.spi.SiteWhereExceptionCopyright © 2016 SiteWhere, LLC.. All rights reserved.