String apiPath = "allowedCerticates.xml"; WebResource apisWeb = client.resource(API_URL).path(apiPath); AllowedCerticatesResult result; int offset = 0; do { // if the "limit" queryParam is not initialized, limit default value = 50 // if the "offset" queryParam is not initialized, offset default value = 0 apisWeb = apisWeb.queryParam("limit", "" + limit); if (offset > 0) apisWeb = apisWeb.queryParam("offset", "" + offset); result = apisWeb.get(AllowedCerticatesResult.class); offset += limit; } while (result.isLimitExceeded()):]]>
String apiPath = "blockedCerticates.xml"; WebResource apisWeb = client.resource(API_URL).path(apiPath); BlockedCerticatesResult result; int offset = 0; do { // if the "limit" queryParam is not initialized, limit default value = 50 // if the "offset" queryParam is not initialized, offset default value = 0 apisWeb = apisWeb.queryParam("limit", "" + limit); if (offset > 0) apisWeb = apisWeb.queryParam("offset", "" + offset); result = apisWeb.get(BlockedCerticatesResult.class); offset += limit; } while (result.isLimitExceeded()):]]>
String apiPath = "deviceMgmtPki.xml"; WebResource apisWeb = client.resource(API_URL).path(apiPath); DeviceMgmtPkiResult result; int offset = 0; do { // if the "limit" queryParam is not initialized, limit default value = 50 // if the "offset" queryParam is not initialized, offset default value = 0 apisWeb = apisWeb.queryParam("limit", "" + limit); if (offset > 0) apisWeb = apisWeb.queryParam("offset", "" + offset); result = apisWeb.get(DeviceMgmtPkiResult.class); offset += limit; } while (result.isLimitExceeded()):]]>
String apiPath = "devices.xml"; WebResource apisWeb = client.resource(API_URL).path(apiPath); DevicesResult result; int offset = 0; do { // if the "limit" queryParam is not initialized, limit default value = 50 // if the "offset" queryParam is not initialized, offset default value = 0 apisWeb = apisWeb.queryParam("limit", "" + limit); if (offset > 0) apisWeb = apisWeb.queryParam("offset", "" + offset); result = apisWeb.get(DevicesResult.class); offset += limit; } while (result.isLimitExceeded()):]]>
Example to get all messages:
// First get the total count of messages String apiPath = "messages/count.xml"; WebResource apisWeb = client.resource(API_URL).path(apiPath); CountResult countResult = apisWeb.get(CountResult.class); // Then paginate to get all messages long MSG_COUNT = countResult.getCount(); apiPath = "messages.xml"; apisWeb = client.resource(API_URL).path(apiPath); for (int offset = 0; offset < MSG_COUNT; offset += limit) { // set limit and offset as queryParam // if the "limit" queryParam is not initialized, limit default value = 50 // if the "offset" queryParam is not initialized, offset default value = 0 apisWeb = apisWeb.queryParam("limit", "" + limit); if (offset > 0) apisWeb = apisWeb.queryParam("offset", "" + offset); MessagesResult result = apisWeb.get(MessagesResult.class); } // To get all messages of a given topic apiPath = "messages/searchByTopic.xml"; apisWeb = client.resource(API_URL).path(apiPath); apisWeb = apisWeb.queryParam("topic", topic); MessagesResult result; int offset = 0; do { apisWeb = apisWeb.queryParam("limit", "" + limit); if (offset > 0) apisWeb = apisWeb.queryParam("offset", "" + offset); result = apisWeb.get(MessagesResult.class); offset += limit; } while (result.isLimitExceeded()):]]>
A provision request is owned by the target account even if the device will connect to the provision broker using a user that belong to the provision account.
A ProvisionRequest object contains a nested ProvisionJob that represent the background job that will be triggered upon device request to be provisioned. The nested ProvisionJob will contain information the provisioning process of a device, its retry counter and general status.
]]>
Mandatory fields are: accountId, retryMaxAttempts, provisionUserUsername, provisionUserPassword. Other field that are not set in the ProvisionRequestCreator will be set to the default value of their
type.
The properties for the EdcMessageEvent object are: isControlTopic, account, asset, semanticTopic, fullTopic, receivedOn, metrics, sentOn, position, payload, isForwarded, and UUID.]]>