clarify limitations with IotProvider and PublishSubscribeService
diff --git a/connectors/src/main/java/org/apache/edgent/samples/connectors/iotp/IotpAppClient.java b/connectors/src/main/java/org/apache/edgent/samples/connectors/iotp/IotpAppClient.java
index 3511dc3..959f218 100644
--- a/connectors/src/main/java/org/apache/edgent/samples/connectors/iotp/IotpAppClient.java
+++ b/connectors/src/main/java/org/apache/edgent/samples/connectors/iotp/IotpAppClient.java
@@ -58,12 +58,12 @@
Properties cfgProps = new Properties();
cfgProps.load(new FileReader(new File(deviceCfgPath)));
- String iotpOrg = cfgProps.getProperty("org");
- String iotpAppId = cfgProps.getProperty("id");
- String iotpAppKey = cfgProps.getProperty("auth-key");
- System.out.println("org: " + iotpOrg);
- System.out.println("id: " + iotpAppId);
- System.out.println("key: " + iotpAppKey);
+ String iotpOrg = getProperty(cfgProps, "Organization-ID", "org");
+ String iotpAppId = getProperty(cfgProps, "id");
+ String iotpApiKey = getProperty(cfgProps, "API-Key", "auth-key");
+ System.out.println("org: " + iotpOrg);
+ System.out.println("id: " + iotpAppId);
+ System.out.println("ApiKey: " + iotpApiKey);
String iotpDevType = cfgProps.getProperty("deviceType");
String iotpDevId = cfgProps.getProperty("deviceId");
@@ -132,5 +132,14 @@
System.out.println("Sent: " + (ok ? "OK" : "NOT-OK"));
}
+
+ private static String getProperty(Properties props, String... keys) {
+ for (String key : keys) {
+ String val = props.getProperty(key);
+ if (val != null)
+ return val;
+ }
+ return null;
+ }
}