public class ContractApiHttp extends Object
This class implements the HTTPS contract between the Provisioning Service Client and the
Device Provisioning Service. It is called by the Managers that implement the Provisioning
Service Client public APIs. To access the public APIs, please see the
ProvisioningServiceClient
.
The follow diagram describe the relation between these 3 layers of the Service Client:
+-------------------------------------------------------------------+ +------------+
| ProvisioningServiceClient | | Query |
+-----+----------------------------+--------------------------+-----+ +--+---+-----+
/ | \ | |
/ | \ | |
+------------+----------------+ +-----------+------------+ +-------------+-------------+ | |
| IndividualEnrollmentManager | | EnrollmentGroupManager | | RegistrationStatusManager | | |
+------------+--------+-------+ +-----------+------+-----+ +-------------+-------+-----+ | |
| \ | \ | \ | |
| +-----------------------------+------------------------------+-------+ |
| | | |
+------------+-------------------------------+-----------------------------+---------------------+---+
| ContractApiHttp |
+------------------------------------------------+---------------------------------------------------+
|
|
+-------------------------------------+------------------------------------------+
| com.microsoft.azure.sdk.iot.deps.transport.http |
+--------------------------------------------------------------------------------+
Modifier and Type | Method and Description |
---|---|
static ContractApiHttp |
createFromConnectionString(ProvisioningConnectionString provisioningConnectionString)
Create a new instance of the ContractApiHttp.
|
HttpResponse |
request(HttpMethod httpMethod,
String path,
Map<String,String> headerParameters,
String payload)
This function sends a raw information to the Device Provisioning Service service using http protocol.
|
public static ContractApiHttp createFromConnectionString(ProvisioningConnectionString provisioningConnectionString)
provisioningConnectionString
- is the Device Provisioning Service service connection string.ContractApiHttp
.IllegalArgumentException
- if there is a problem with the provided connection string.public HttpResponse request(HttpMethod httpMethod, String path, Map<String,String> headerParameters, String payload) throws ProvisioningServiceClientException
The purpose of this function is be the base communication between the controllers and the
Service, and should be used only if you have full understanding of the Device Provisioning Service rest APIs.
We highly recommend that you uses the APis under ProvisioningServiceClient
instead of directly access the rest API using this class.
httpMethod
- is the http verb in the request (GET, POST, PUT, DELETE, PATCH).path
- is the path to the resource in the service that will compose the URL.headerParameters
- is a list of pairs key values that contains optional parameters in the http header.payload
- is the body of the message.HttpResponse
that contains the response of the request.ProvisioningServiceClientTransportException
- if the Service Client failed to exchange http messages with the Provisioning Service.ProvisioningServiceClientException
- if the Provisioning Service response contains an error message.IllegalArgumentException
- if the provided parameters are not correct.Copyright © 2022. All rights reserved.