public String getKey() { /* **Codes_SRS_Property_25_003: [**The function shall return the value of the key corresponding to this property.**]** */ return this.property.getKey(); }
public static boolean actualStatusUpdatesContainsStatus(List<Pair<IotHubConnectionStatus, Throwable>> actualStatusUpdates, IotHubConnectionStatus status) { for (int i = 0; i < actualStatusUpdates.size(); i++) { if (actualStatusUpdates.get(i).getKey() == status) { return true; } } return false; } }
/** * Getter for the message callback. * * @param inputName the inputName that the desired callback is tied to, or null for the default callback * * @return the message callback. */ public MessageCallback getDeviceTelemetryMessageCallback(String inputName) { if (inputName == null || !this.inputChannelMessageCallbacks.containsKey(inputName)) { // Codes_SRS_DEVICECLIENTCONFIG_34_010: [If the inputName is null, or the message callbacks map does not // contain the provided inputName, this function shall return the default message callback.] return this.defaultDeviceTelemetryMessageCallback; } else { // Codes_SRS_DEVICECLIENTCONFIG_34_045: [If the message callbacks map contains the provided inputName, this function // shall return the callback associated with that inputName.] return this.inputChannelMessageCallbacks.get(inputName).getKey(); } }
public static void confirmOpenStabilized(List<Pair<IotHubConnectionStatus, Throwable>> actualStatusUpdates, long timeout, InternalClient client) throws InterruptedException { long startTime = System.currentTimeMillis(); long timeElapsed; int numOfUpdates = 0; if (actualStatusUpdates != null) { while (numOfUpdates == 0 || numOfUpdates != actualStatusUpdates.size() || actualStatusUpdates.get(actualStatusUpdates.size() - 1).getKey() != IotHubConnectionStatus.CONNECTED) { numOfUpdates = actualStatusUpdates.size(); Thread.sleep(6 * 1000); timeElapsed = System.currentTimeMillis() - startTime; if (timeElapsed > timeout) { Assert.fail(buildExceptionMessage("Timed out waiting for a stable connection on first open", client)); } } } }
private boolean reportPropertyCallback(Property property) { boolean reported = false; if (onDesiredPropertyChangeMap != null && onDesiredPropertyChangeMap.containsKey(property.getKey())) { Pair<PropertyCallBack<String, Object>, Object> callBackObjectPair = onDesiredPropertyChangeMap.get(property.getKey()); if (callBackObjectPair != null && callBackObjectPair.getKey() != null) { callBackObjectPair.getKey().PropertyCall(property.getKey(), property.getValue(), callBackObjectPair.getValue()); reported = true; } } if (onDesiredTwinPropertyChangeMap != null && onDesiredTwinPropertyChangeMap.containsKey(property.getKey())) { Pair<TwinPropertyCallBack, Object> callBackObjectPair = onDesiredTwinPropertyChangeMap.get(property.getKey()); if (callBackObjectPair != null && callBackObjectPair.getKey() != null) { callBackObjectPair.getKey().TwinPropertyCallBack(property, callBackObjectPair.getValue()); reported = true; } } return reported; }