Skip to content

Commit

Permalink
Corrected exception message and fixed javadoc warnings
Browse files Browse the repository at this point in the history
Signed-off-by: miketran <miketran@us.ibm.com>
  • Loading branch information
miketran78727 committed Nov 29, 2016
1 parent 580fbcf commit 4422261
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions src/main/java/com/ibm/iotf/client/api/APIClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ private static String trimedValue(String value) {
}

private HttpResponse connect(String httpOperation, String url, String jsonPacket,
List<NameValuePair> queryParameters) throws IoTFCReSTException, URISyntaxException, IOException {
List<NameValuePair> queryParameters) throws URISyntaxException, IOException {
final String METHOD = "connect";

StringEntity input = null;
Expand Down Expand Up @@ -2660,8 +2660,8 @@ public boolean deleteDeviceManagementRequest(String requestId) throws IoTFCReSTE
String result = this.readContent(response, METHOD);
jsonResponse = new JsonParser().parse(result);
} catch(Exception e) {
IoTFCReSTException ex = new IoTFCReSTException("Failure in deleting the Device management Request "
+ "::"+e.getMessage());
IoTFCReSTException ex = new IoTFCReSTException("Failure in deleting the DM Request for ID ("
+ requestId + ")::"+e.getMessage());
ex.initCause(e);
throw ex;
}
Expand Down Expand Up @@ -2703,8 +2703,8 @@ public JsonObject getDeviceManagementRequest(String requestId) throws IoTFCReSTE
return jsonResponse.getAsJsonObject();
}
} catch(Exception e) {
IoTFCReSTException ex = new IoTFCReSTException("Failure in deleting the Device management Request "
+ "::"+e.getMessage());
IoTFCReSTException ex = new IoTFCReSTException("Failure in getting the DM Request for ID ("
+ requestId + ")::" + e.getMessage());
ex.initCause(e);
throw ex;
}
Expand Down Expand Up @@ -3341,6 +3341,7 @@ public boolean publishDeviceEventOverHTTP(String eventId, JsonObject payload) th
* <a href="https://docs.internetofthings.ibmcloud.com/swagger/v0002.html#!/Connectivity/post_device_types_deviceType_devices_deviceId_events_eventName">link</a>
* <a href="https://docs.internetofthings.ibmcloud.com/swagger/v0002.html#!/Connectivity/post_application_types_deviceType_devices_deviceId_events_eventName">link</a>
* for more information about the schema to be used
* @param contenttype Content type
*
* @return boolean indicates status of publishing event.
*
Expand All @@ -3357,6 +3358,8 @@ public boolean publishDeviceEventOverHTTP(String eventId, JsonObject payload, Co
/**
* Application Publishes events on behalf of device over HTTP
*
* @param deviceId Device ID
* @param deviceType Device type
* @param eventId String representing the eventId to be added.
* @param payload JSON object representing the payload to be added. Refer to
* <a href="https://docs.internetofthings.ibmcloud.com/swagger/v0002.html#!/Connectivity/post_device_types_deviceType_devices_deviceId_events_eventName">link</a>
Expand All @@ -3366,8 +3369,7 @@ public boolean publishDeviceEventOverHTTP(String eventId, JsonObject payload, Co
* @return boolean indicates status of publishing event.
*
* @throws IoTFCReSTException Failure publishing event. *
*/

*/
public boolean publishApplicationEventforDeviceOverHTTP(String deviceId, String deviceType, String eventId, JsonObject payload) throws Exception {
boolean ret = false;
this.mdeviceId = deviceId;
Expand All @@ -3379,17 +3381,19 @@ public boolean publishApplicationEventforDeviceOverHTTP(String deviceId, String
/**
* Application Publishes events on behalf of device over HTTP
*
* @param deviceId Device ID
* @param deviceType Device type
* @param eventId String representing the eventId to be added.
* @param payload JSON object representing the payload to be added. Refer to
* <a href="https://docs.internetofthings.ibmcloud.com/swagger/v0002.html#!/Connectivity/post_device_types_deviceType_devices_deviceId_events_eventName">link</a>
* <a href="https://docs.internetofthings.ibmcloud.com/swagger/v0002.html#!/Connectivity/post_application_types_deviceType_devices_deviceId_events_eventName">link</a>
* for more information about the schema to be used
* @param contenttype Content type
*
* @return boolean indicates status of publishing event.
*
* @throws IoTFCReSTException Failure publishing event. *
*/

public boolean publishApplicationEventforDeviceOverHTTP(String deviceId, String deviceType, String eventId, JsonObject payload, ContentType contenttype) throws Exception {
boolean ret = false;
contentType = contenttype;
Expand Down Expand Up @@ -3424,6 +3428,7 @@ public boolean publishCommandOverHTTP(String eventId, JsonObject payload) throws
* <a href="https://docs.internetofthings.ibmcloud.com/swagger/v0002.html#!/Connectivity/post_device_types_deviceType_devices_deviceId_events_eventName">link</a>
* <a href="https://docs.internetofthings.ibmcloud.com/swagger/v0002.html#!/Connectivity/post_application_types_deviceType_devices_deviceId_events_eventName">link</a>
* for more information about the schema to be used
* @param contenttype Content type
*
* @return boolean indicates status of publishing event.
*
Expand Down

0 comments on commit 4422261

Please sign in to comment.