ContractApiHttp Class
- java.
lang. Object - com.
microsoft. azure. sdk. iot. provisioning. service. contract. ContractApiHttp
- com.
public class ContractApiHttp
This client handles the Device Provisioning Service HTTP communication.
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 |
+--------------------------------------------------------------------------------+
Method Summary
Modifier and Type | Method and Description |
---|---|
Contract |
createFromConnectionString(ProvisioningConnectionString provisioningConnectionString)
Create a new instance of the ContractApiHttp. |
synchronized Http |
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. 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. |
Method Details
createFromConnectionString
public static ContractApiHttp createFromConnectionString(ProvisioningConnectionString provisioningConnectionString)
Create a new instance of the ContractApiHttp.
Parameters:
Returns:
an instance ofContractApiHttp
</code> . </p>
Throws:
IllegalArgumentException
- if there is a problem with the provided connection string.
request
public synchronized HttpResponse request(HttpMethod httpMethod, String path, Map headerParameters, String payload)
This function sends a raw information to the Device Provisioning Service service using http protocol.
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.
Parameters:
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.
Returns:
theHttpResponse
</code> that contains the response of the request. </p>
Throws:
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.
Applies to
Azure SDK for Java