com.cumulocity.sdk.client.inventory
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
 ManagedObjectRepresentation create(ManagedObjectRepresentation managedObject)
          Creates managed object in the platform.
 ManagedObject getManagedObject(GId gid)
          Gets managed object resource by id.
 PagedCollectionResource<ManagedObjectCollectionRepresentation> getManagedObjects()
          Gets the all the managed object in the platform
 PagedCollectionResource<ManagedObjectCollectionRepresentation> getManagedObjectsByFilter(InventoryFilter filter)
          Gets the managed objects from the platform based on specified filter.
 PagedCollectionResource<ManagedObjectCollectionRepresentation> getManagedObjectsByListOfIds(List<GId> ids)
          Gets the managed objects from the platform based on the given ids
 

Method Detail

getManagedObject

ManagedObject getManagedObject(GId gid)
                               throws SDKException
Gets managed object resource by id. To get the managed object representation you have to call get() 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

PagedCollectionResource<ManagedObjectCollectionRepresentation> 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

PagedCollectionResource<ManagedObjectCollectionRepresentation> getManagedObjectsByFilter(InventoryFilter filter)
                                                                                         throws SDKException
Gets the managed objects from the platform based on specified filter. Query based on type and fragmentType 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 failed
IllegalArgumentException - if both type and fragmentType are specified in the filter

getManagedObjectsByListOfIds

PagedCollectionResource<ManagedObjectCollectionRepresentation> getManagedObjectsByListOfIds(List<GId> ids)
                                                                                            throws SDKException
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


Copyright © 2013 (C) Cumulocity GmbH. All Rights Reserved.