Package com.cumulocity.me.rest.representation.inventory

Examples of com.cumulocity.me.rest.representation.inventory.ManagedObjectRepresentation


        isValid(representation, UPDATE);
    }

    @Test
    public void shouldConvertDateToJson() throws Exception {
        ManagedObjectRepresentation representation = minimalManagedObjectBuilder().withLastUpdated(lastUpdated).build();
        String stringDate = DateUtils.format(lastUpdated);
        JSONObject expectedJSON = minimalJsonManagedObjectRepresentation().withProperty(PROP_LAST_UPDATED, stringDate).build();

        JSONObject outputJSON = toJson(representation);
        System.out.println(outputJSON);
View Full Code Here


        assertThat(outputJSON.toString()).isEqualTo(expectedJSON.toString());
    }

    @Test
    public void shouldConvertChildAssetsAndDevicesToJson() throws Exception {
        ManagedObjectRepresentation representation = minimalManagedObjectBuilder()
                .withChildAssets(getMinimalMORCR())
                .withChildDevices(getMinimalMORCR())
                .withParents(getMinimalMORCR())
                .build();
        JSONObject expectedJSON = minimalJsonManagedObjectRepresentation()
View Full Code Here

    return managedObjectRepresentation.getChildDevices().getSelf();

  }

  public PagedCollectionResource getChildDevices() {
    ManagedObjectRepresentation managedObjectRepresentation = get();
    String self = createChildDevicePath(managedObjectRepresentation);
    return new ManagedObjectReferenceCollectionImpl(restConnector, self, pageSize);
  }
View Full Code Here

  }

  public ManagedObjectReferenceRepresentation addChildDevice(ManagedObjectReferenceRepresentation refrenceRepresentation)
      throws SDKException {

    ManagedObjectRepresentation managedObjectRepresentation = get();
    return (ManagedObjectReferenceRepresentation) restConnector.post(this.createChildDevicePath(managedObjectRepresentation),
        InventoryMediaType.MANAGED_OBJECT_REFERENCE, refrenceRepresentation);
  }
View Full Code Here

        InventoryMediaType.MANAGED_OBJECT_REFERENCE, refrenceRepresentation);
  }

  public ManagedObjectReferenceRepresentation getChildDevice(GId deviceId) {

    ManagedObjectRepresentation managedObjectRepresentation = get();
    String path = createChildDevicePath(managedObjectRepresentation) + "/" + deviceId.getValue();
    return (ManagedObjectReferenceRepresentation) restConnector.get(path, InventoryMediaType.MANAGED_OBJECT_REFERENCE,
        ManagedObjectReferenceRepresentation.class);
  }
View Full Code Here

    return (ManagedObjectReferenceRepresentation) restConnector.get(path, InventoryMediaType.MANAGED_OBJECT_REFERENCE,
        ManagedObjectReferenceRepresentation.class);
  }

  public void deleteChildDevice(GId deviceId) {
    ManagedObjectRepresentation managedObjectRepresentation = get();
    String path = createChildDevicePath(managedObjectRepresentation) + "/" + deviceId.getValue();
    restConnector.delete(path);
  }
View Full Code Here

    restConnector.delete(path);
  }

  public ManagedObjectReferenceRepresentation addChildAssets(ManagedObjectReferenceRepresentation refrenceReprsentation)
      throws SDKException {
    ManagedObjectRepresentation managedObjectRepresentation = get();
    return (ManagedObjectReferenceRepresentation) restConnector.post(createChildAssetPath(managedObjectRepresentation),
        InventoryMediaType.MANAGED_OBJECT_REFERENCE, refrenceReprsentation);
  }
View Full Code Here

    }
    return managedObjectRepresentation.getChildAssets().getSelf();
  }

  public PagedCollectionResource getChildAssets() {
    ManagedObjectRepresentation managedObjectRepresentation = get();
    String self = createChildAssetPath(managedObjectRepresentation);
    return new ManagedObjectReferenceCollectionImpl(restConnector, self, pageSize);
  }
View Full Code Here

    String self = createChildAssetPath(managedObjectRepresentation);
    return new ManagedObjectReferenceCollectionImpl(restConnector, self, pageSize);
  }

  public ManagedObjectReferenceRepresentation getChildAsset(GId assetId) {
    ManagedObjectRepresentation managedObjectRepresentation = get();
    String path = createChildAssetPath(managedObjectRepresentation) + "/" + assetId.getValue();
    return (ManagedObjectReferenceRepresentation) restConnector.get(path, InventoryMediaType.MANAGED_OBJECT_REFERENCE,
        ManagedObjectReferenceRepresentation.class);
  }
View Full Code Here

    return (ManagedObjectReferenceRepresentation) restConnector.get(path, InventoryMediaType.MANAGED_OBJECT_REFERENCE,
        ManagedObjectReferenceRepresentation.class);
  }

  public void deleteChildAsset(GId assetId) {
    ManagedObjectRepresentation managedObjectRepresentation = get();
    String path = createChildAssetPath(managedObjectRepresentation) + "/" + assetId.getValue();
    restConnector.delete(path);
  }
View Full Code Here

TOP

Related Classes of com.cumulocity.me.rest.representation.inventory.ManagedObjectRepresentation

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.