com.cumulocity.sdk.client.inventory
Class ManagedObjectImpl

java.lang.Object
  extended by com.cumulocity.sdk.client.inventory.ManagedObjectImpl
All Implemented Interfaces:
ManagedObject

public class ManagedObjectImpl
extends Object
implements ManagedObject


Constructor Summary
ManagedObjectImpl(RestConnector restConnector, String url, int pageSize)
           
 
Method Summary
 ManagedObjectReferenceRepresentation addChildAssets(ManagedObjectReferenceRepresentation refrenceReprsentation)
          Adds a child device to the ManagedObject.
 ManagedObjectReferenceRepresentation addChildDevice(ManagedObjectReferenceRepresentation refrenceReprsentation)
          Adds a child device to the ManagedObject.
 void delete()
          Deletes the Managed Object from the Cumulocity Server.
 void deleteChildAsset(GId assetId)
          Deletes the child Asset and its relation to the managed object.
 void deleteChildDevice(GId deviceId)
          Deletes the child device and its relation to the managed object.
 ManagedObjectRepresentation get()
          Returns the Managed Object of the Resource.
 ManagedObjectReferenceCollectionRepresentation getAllChildAssets()
          Deprecated. 
 ManagedObjectReferenceCollectionRepresentation getAllChildDevices()
          Deprecated. 
 ManagedObjectReferenceRepresentation getChildAsset(GId assetId)
          Returns the child Asset with the given id.
 PagedCollectionResource<ManagedObjectReferenceCollectionRepresentation> getChildAssets()
          Returns all the child Assets for the Managed Object in paged collection form
 ManagedObjectReferenceRepresentation getChildDevice(GId deviceId)
          Returns the child device with the given id.
 PagedCollectionResource<ManagedObjectReferenceCollectionRepresentation> getChildDevices()
          Returns all the child Devices for the Managed Object in paged collection form.
 ManagedObjectRepresentation update(ManagedObjectRepresentation managedObjectRepresentation)
          This update the ManagedObject for the operationCollection.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ManagedObjectImpl

public ManagedObjectImpl(RestConnector restConnector,
                         String url,
                         int pageSize)
Method Detail

get

public ManagedObjectRepresentation get()
                                throws SDKException
Description copied from interface: ManagedObject
Returns the Managed Object of the Resource.

Specified by:
get in interface ManagedObject
Returns:
ManagedObjectRepresentation
Throws:
SDKException

delete

public void delete()
            throws SDKException
Description copied from interface: ManagedObject
Deletes the Managed Object from the Cumulocity Server.

Specified by:
delete in interface ManagedObject
Throws:
SDKException

update

public ManagedObjectRepresentation update(ManagedObjectRepresentation managedObjectRepresentation)
                                   throws SDKException
Description copied from interface: ManagedObject
This update the ManagedObject for the operationCollection. Cannot update the ID.

Specified by:
update in interface ManagedObject
Returns:
ManagedObjectRepresentation updated ManagedObject.
Throws:
SDKException

getAllChildDevices

@Deprecated
public ManagedObjectReferenceCollectionRepresentation getAllChildDevices()
                                                                  throws SDKException
Deprecated. 

Description copied from interface: ManagedObject
Returns all the child devices for the Managed Object. Max number of child devices limited to Short.MAX_VALUE = 32767 This method is deprecated. Please use PagedCollectionResource getChildDevices() throws SDKException;

Specified by:
getAllChildDevices in interface ManagedObject
Returns:
ManagedObjectReferenceCollectionRepresentation which contains all the child devices.
Throws:
SDKException

getChildDevices

public PagedCollectionResource<ManagedObjectReferenceCollectionRepresentation> getChildDevices()
                                                                                        throws SDKException
Description copied from interface: ManagedObject
Returns all the child Devices for the Managed Object in paged collection form.

Specified by:
getChildDevices in interface ManagedObject
Returns:
ManagedObjectReferenceCollectionRepresentation which contains all the child devices.
Throws:
SDKException

addChildDevice

public ManagedObjectReferenceRepresentation addChildDevice(ManagedObjectReferenceRepresentation refrenceReprsentation)
                                                    throws SDKException
Description copied from interface: ManagedObject
Adds a child device to the ManagedObject.

Specified by:
addChildDevice in interface ManagedObject
Returns:
ManagedObjectReferenceRepresentation with the id of th child device.
Throws:
SDKException

getChildDevice

public ManagedObjectReferenceRepresentation getChildDevice(GId deviceId)
                                                    throws SDKException
Description copied from interface: ManagedObject
Returns the child device with the given id. If it belongs to the ManagedObject.

Specified by:
getChildDevice in interface ManagedObject
Returns:
ManagedObjectReferenceRepresentation of the child device.
Throws:
SDKException

deleteChildDevice

public void deleteChildDevice(GId deviceId)
                       throws SDKException
Description copied from interface: ManagedObject
Deletes the child device and its relation to the managed object.

Specified by:
deleteChildDevice in interface ManagedObject
Throws:
SDKException

addChildAssets

public ManagedObjectReferenceRepresentation addChildAssets(ManagedObjectReferenceRepresentation refrenceReprsentation)
                                                    throws SDKException
Description copied from interface: ManagedObject
Adds a child device to the ManagedObject.

Specified by:
addChildAssets in interface ManagedObject
Returns:
ManagedObjectReferenceRepresentation with the id of th child device.
Throws:
SDKException

getAllChildAssets

@Deprecated
public ManagedObjectReferenceCollectionRepresentation getAllChildAssets()
                                                                 throws SDKException
Deprecated. 

Description copied from interface: ManagedObject
Returns all the child Assets for the Managed Object. Max number of child devices limited to Short.MAX_VALUE = 32767 This method is deprecated. Please use PagedCollectionResource getChildAssets() throws SDKException;

Specified by:
getAllChildAssets in interface ManagedObject
Returns:
ManagedObjectReferenceCollectionRepresentation which contains all the child devices.
Throws:
SDKException

getChildAssets

public PagedCollectionResource<ManagedObjectReferenceCollectionRepresentation> getChildAssets()
                                                                                       throws SDKException
Description copied from interface: ManagedObject
Returns all the child Assets for the Managed Object in paged collection form

Specified by:
getChildAssets in interface ManagedObject
Returns:
ManagedObjectReferenceCollectionRepresentation which contains all the child devices.
Throws:
SDKException

getChildAsset

public ManagedObjectReferenceRepresentation getChildAsset(GId assetId)
                                                   throws SDKException
Description copied from interface: ManagedObject
Returns the child Asset with the given id. If it belongs to the ManagedObject.

Specified by:
getChildAsset in interface ManagedObject
Returns:
ManagedObjectReferenceRepresentation of the child device.
Throws:
SDKException

deleteChildAsset

public void deleteChildAsset(GId assetId)
                      throws SDKException
Description copied from interface: ManagedObject
Deletes the child Asset and its relation to the managed object.

Specified by:
deleteChildAsset in interface ManagedObject
Throws:
SDKException


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