com.cumulocity.sdk.client.inventory
Class InventoryApiImpl

java.lang.Object
  extended by com.cumulocity.sdk.client.inventory.InventoryApiImpl
All Implemented Interfaces:
InventoryApi

public class InventoryApiImpl
extends Object
implements InventoryApi


Constructor Summary
InventoryApiImpl(RestConnector restConnector, TemplateUrlParser templateUrlParser, String platformUrl)
          Deprecated. 
InventoryApiImpl(RestConnector restConnector, TemplateUrlParser templateUrlParser, String platformUrl, int pageSize)
           
 
Method Summary
 ManagedObjectRepresentation create(ManagedObjectRepresentation representation)
          Creates managed object in the platform.
 ManagedObject getManagedObject(GId globalId)
          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
protected  String getSelfUri()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InventoryApiImpl

@Deprecated
public InventoryApiImpl(RestConnector restConnector,
                                   TemplateUrlParser templateUrlParser,
                                   String platformUrl)
Deprecated. 


InventoryApiImpl

public InventoryApiImpl(RestConnector restConnector,
                        TemplateUrlParser templateUrlParser,
                        String platformUrl,
                        int pageSize)
Method Detail

create

public ManagedObjectRepresentation create(ManagedObjectRepresentation representation)
                                   throws SDKException
Description copied from interface: InventoryApi
Creates managed object in the platform. The id of the managed object must not be set, since it will be generated by the platform

Specified by:
create in interface InventoryApi
Parameters:
representation - 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

getManagedObject

public ManagedObject getManagedObject(GId globalId)
                               throws SDKException
Description copied from interface: InventoryApi
Gets managed object resource by id. To get the managed object representation you have to call get() on the returned resource.

Specified by:
getManagedObject in interface InventoryApi
Parameters:
globalId - id of the managed object to search for
Returns:
the managed object resource associated with the given id
Throws:
SDKException - if the query failed

getManagedObjects

public PagedCollectionResource<ManagedObjectCollectionRepresentation> getManagedObjects()
                                                                                 throws SDKException
Description copied from interface: InventoryApi
Gets the all the managed object in the platform

Specified by:
getManagedObjects in interface InventoryApi
Returns:
collection of managed objects with paging functionality
Throws:
SDKException - if the query failed

getManagedObjectsByFilter

public PagedCollectionResource<ManagedObjectCollectionRepresentation> getManagedObjectsByFilter(InventoryFilter filter)
                                                                                         throws SDKException
Description copied from interface: InventoryApi
Gets the managed objects from the platform based on specified filter. Query based on type and fragmentType is not supported.

Specified by:
getManagedObjectsByFilter in interface InventoryApi
Parameters:
filter - the filter criteria(s)
Returns:
collection of managed objects matched by the filter with paging functionality
Throws:
SDKException - if the query failed

getManagedObjectsByListOfIds

public PagedCollectionResource<ManagedObjectCollectionRepresentation> getManagedObjectsByListOfIds(List<GId> ids)
                                                                                            throws SDKException
Description copied from interface: InventoryApi
Gets the managed objects from the platform based on the given ids

Specified by:
getManagedObjectsByListOfIds in interface InventoryApi
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

getSelfUri

protected String getSelfUri()
                     throws SDKException
Throws:
SDKException


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