Interface InventoryApi
-
- All Known Implementing Classes:
InventoryApiImpl
public interface InventoryApi
API for creating, and retrieving managed objects resources from the platform. Delete and update functionality is implemented on the returned managed object.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description Integer
countManagedObjectsByFilter(InventoryFilter filter)
Returns the count of managed objects from the platform based on specified filter.ManagedObjectRepresentation
create(ManagedObjectRepresentation managedObject)
Creates managed object in the platform.void
delete(GId id)
Deletes the Managed Object from the Cumulocity Server.void
deleteCascade(GId id)
Deletes the Managed Object and all child devices and child assets recursively from the Cumulocity Server.ManagedObjectRepresentation
get(GId id)
Returns the Managed Object of the Resource.ManagedObjectRepresentation
get(GId id, QueryParam... params)
Returns the Managed Object of the Resource.ManagedObject
getManagedObject(GId gid)
Deprecated.ManagedObject
getManagedObjectApi(GId gid)
Gets managed object resource by id.ManagedObjectCollection
getManagedObjects()
Gets the all the managed object in the platformManagedObjectCollection
getManagedObjectsByFilter(InventoryFilter filter)
Gets the managed objects from the platform based on specified filter.ManagedObjectCollection
getManagedObjectsByListOfIds(List<GId> ids)
Deprecated.SupportedMeasurementsRepresentation
getSupportedMeasurements(GId id)
Returns supported measurements of the Managed Object specified by its idSupportedSeriesRepresentation
getSupportedSeries(GId id)
Returns supported series of the Managed Object specified by its idManagedObjectRepresentation
update(ManagedObjectRepresentation managedObjectRepresentation)
This update the ManagedObject for the operationCollection.
-
-
-
Method Detail
-
get
ManagedObjectRepresentation get(GId id) throws SDKException
Returns the Managed Object of the Resource.- Parameters:
id
- Managed Object General Identifier- Returns:
- ManagedObjectRepresentation
- Throws:
SDKException
- if query failed
-
get
ManagedObjectRepresentation get(GId id, QueryParam... params) throws SDKException
Returns the Managed Object of the Resource. Using additional query params e.g. withChildren=false to optimize access time.- Parameters:
id
- Managed Object General Identifierparams
- query parameters- Returns:
- ManagedObjectRepresentation
- Throws:
SDKException
- if query failed
-
delete
void delete(GId id) throws SDKException
Deletes the Managed Object from the Cumulocity Server.- Parameters:
id
- Managed Object General Identifier- Throws:
SDKException
- if the managed object could not be deleted
-
deleteCascade
void deleteCascade(GId id) throws SDKException
Deletes the Managed Object and all child devices and child assets recursively from the Cumulocity Server.- Parameters:
id
- Managed Object General Identifier- Throws:
SDKException
- if the managed object could not be deleted
-
update
ManagedObjectRepresentation update(ManagedObjectRepresentation managedObjectRepresentation) throws SDKException
This update the ManagedObject for the operationCollection. Cannot update the ID.- Parameters:
managedObjectRepresentation
- managed object representation- Returns:
- ManagedObjectRepresentation updated ManagedObject.
- Throws:
SDKException
- if the managed object could not be updated
-
getManagedObjectApi
ManagedObject getManagedObjectApi(GId gid) throws SDKException
Gets managed object resource by id. To get the managed object representation you have to callget()
on the returned resource.- Parameters:
gid
- id of the managed object to search for- Returns:
- the managed object resource associated with the given id
- Throws:
SDKException
- if the query failed
-
create
ManagedObjectRepresentation create(ManagedObjectRepresentation managedObject) throws SDKException
Creates managed object in the platform. The id of the managed object must not be set, since it will be generated by the platform- Parameters:
managedObject
- the managed object to be created- Returns:
- the created managed object with the generated id
- Throws:
SDKException
- if the managed object could not be created
-
getManagedObjects
ManagedObjectCollection getManagedObjects() throws SDKException
Gets the all the managed object in the platform- Returns:
- collection of managed objects with paging functionality
- Throws:
SDKException
- if the query failed
-
getManagedObjectsByFilter
ManagedObjectCollection getManagedObjectsByFilter(InventoryFilter filter) throws SDKException
Gets the managed objects from the platform based on specified filter. Query based ontype
andfragmentType
is not supported.- Parameters:
filter
- the filter criteria(s)- Returns:
- collection of managed objects matched by the filter with paging functionality
- Throws:
SDKException
- if the query failedIllegalArgumentException
- if bothtype
andfragmentType
are specified in the filter
-
countManagedObjectsByFilter
Integer countManagedObjectsByFilter(InventoryFilter filter) throws SDKException
Returns the count of managed objects from the platform based on specified filter.- Parameters:
filter
- the filter criteria(s)- Returns:
- count of managed objects matched by the filter
- Throws:
SDKException
- if the query failedIllegalArgumentException
- if the filter is null
-
getSupportedMeasurements
SupportedMeasurementsRepresentation getSupportedMeasurements(GId id) throws SDKException
Returns supported measurements of the Managed Object specified by its id- Parameters:
id
- id of the managed object to search for- Returns:
- SupportedMeasurementsRepresentation
- Throws:
SDKException
- if managed object does not exists
-
getSupportedSeries
SupportedSeriesRepresentation getSupportedSeries(GId id) throws SDKException
Returns supported series of the Managed Object specified by its id- Parameters:
id
- id of the managed object to search for- Returns:
- SupportedSeriesRepresentation
- Throws:
SDKException
- if managed object does not exists
-
getManagedObjectsByListOfIds
@Deprecated ManagedObjectCollection getManagedObjectsByListOfIds(List<GId> ids) throws SDKException
Deprecated.Gets the managed objects from the platform based on the given ids- Parameters:
ids
- the list of ids of the managed objects to search for- Returns:
- collection of managed objects matched in order of the given ids
- Throws:
SDKException
- if the query failed
-
getManagedObject
@Deprecated ManagedObject getManagedObject(GId gid) throws SDKException
Deprecated.Gets managed object resource by id. To get the managed object representation you have to callget()
on the returned resource.- Parameters:
gid
- id of the managed object to search for- Returns:
- the managed object resource associated with the given id
- Throws:
SDKException
- if the query failed
-
-