Examples of ManagedObjectRepresentation


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

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

        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

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

    return managedObjectRepresentation.getChildDevices().getSelf();

  }

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

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

  }

  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

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

        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

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

    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

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

    }

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

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

    @Override
    public ManagedObjectReferenceRepresentation addChildDevice(ManagedObjectReferenceRepresentation refrenceReprsentation)
            throws SDKException {

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

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

    }
   
    @Override
    public ManagedObjectReferenceRepresentation addChildDevice(GId childId)
            throws SDKException {
        ManagedObjectRepresentation managedObjectRepresentation = get();
        return restConnector.post(this.createChildDevicePath(managedObjectRepresentation), InventoryMediaType.MANAGED_OBJECT_REFERENCE,
                createChildObject(childId));
    }
View Full Code Here

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

    }

    @Override
    public ManagedObjectReferenceRepresentation getChildDevice(GId deviceId) throws SDKException {

        ManagedObjectRepresentation managedObjectRepresentation = get();
        String path = createChildDevicePath(managedObjectRepresentation) + "/" + deviceId.getValue();
        return restConnector.get(path, InventoryMediaType.MANAGED_OBJECT_REFERENCE, ManagedObjectReferenceRepresentation.class);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.