public synchronized void updateReportedProperties(Set<Property> reportedProperties) throws IOException { this.updateReportedProperties(reportedProperties, null); }
/** * Sends reported properties * * @param reportedProperties the Set for desired properties and their corresponding callback and context. Cannot be {@code null}. * * @throws IOException if called when client is not opened or called before starting twin. * @throws IllegalArgumentException if reportedProperties is null or empty. */ public void sendReportedProperties(Set<Property> reportedProperties) throws IOException, IllegalArgumentException { if (this.twin == null) { throw new IOException("Start twin before using it"); } if (!this.deviceIO.isOpen()) { throw new IOException("Open the client connection before using it."); } if (reportedProperties == null || reportedProperties.isEmpty()) { throw new IllegalArgumentException("Reported properties set cannot be null or empty."); } this.twin.updateReportedProperties(reportedProperties); }
/** * Sends reported properties * * @param reportedProperties the Set for desired properties and their corresponding callback and context. Cannot be {@code null}. * @param version the Reported property version. Cannot be negative. * * @throws IOException if called when client is not opened or called before starting twin. * @throws IllegalArgumentException if reportedProperties is null or empty. */ public void sendReportedProperties(Set<Property> reportedProperties, int version) throws IOException, IllegalArgumentException { if (this.twin == null) { throw new IOException("Start twin before using it"); } if (!this.deviceIO.isOpen()) { throw new IOException("Open the client connection before using it."); } if (reportedProperties == null || reportedProperties.isEmpty()) { throw new IllegalArgumentException("Reported properties set cannot be null or empty."); } if(version < 0) { throw new IllegalArgumentException("Version cannot be null."); } this.twin.updateReportedProperties(reportedProperties, version); }