HttpsRequestResponseSerializer Class

  • java.lang.Object
    • com.microsoft.azure.sdk.iot.device.hsm.HttpsRequestResponseSerializer

public class HttpsRequestResponseSerializer

Constructor Summary

Constructor Description
HttpsRequestResponseSerializer()

Method Summary

Modifier and Type Method and Description
static HttpsResponse deserializeResponse(BufferedReader bufferedReader)

Deserialize a stream of bytes from an HSM party into an HttpsResponse

static byte[] serializeRequest(HttpsRequest httpsRequest, String path, String queryString, String host)

Serialize the provided request

Methods inherited from java.lang.Object

java.lang.Object.clone java.lang.Object.equals java.lang.Object.finalize java.lang.Object.getClass java.lang.Object.hashCode java.lang.Object.notify java.lang.Object.notifyAll java.lang.Object.toString java.lang.Object.wait java.lang.Object.wait java.lang.Object.wait

Constructor Details

HttpsRequestResponseSerializer

public HttpsRequestResponseSerializer()

Method Details

deserializeResponse

public static HttpsResponse deserializeResponse(BufferedReader bufferedReader)

Deserialize a stream of bytes from an HSM party into an HttpsResponse

Parameters:

bufferedReader - the stream to read from. Will be closed before this method returns

Returns:

the deserialized response

Throws:

java.io.IOException - if the stream cannot be read from

serializeRequest

public static byte[] serializeRequest(HttpsRequest httpsRequest, String path, String queryString, String host)

Serialize the provided request

Parameters:

httpsRequest - the request to be serialized
path - the path for the request to invoke on (e.g. /trust-bundle)
queryString - the full querystring associated with the http request. Should not include the '?' character at the beginning
host - the host that the request is being made to

Returns:

the serialized request

Throws:

java.lang.IllegalArgumentException - if the provided httpsRequest is null or has a null request url

Applies to