MethodRequest Class

  • java.lang.Object
    • com.microsoft.azure.sdk.iot.device.edge.MethodRequest

public class MethodRequest

Json parser for a method request. Used to invoke methods on other devices/modules

Constructor Summary

Constructor Description
MethodRequest(String methodName, String payload)

Constructor for a MethodRequest.

MethodRequest(String methodName, String payload, Integer responseTimeout, Integer connectionTimeout)

Constructor for a MethodRequest.

Method Summary

Modifier and Type Method and Description
java.lang.String toJson()

Return the json representation of this object

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

MethodRequest

public MethodRequest(String methodName, String payload)

Constructor for a MethodRequest. Uses default responseTimeout and connectionTimeout which is to never timeout

Parameters:

methodName - The method to be invoked
payload - the payload attached to that method

Throws:

java.lang.IllegalArgumentException - if the provided methodName is null or empty

MethodRequest

public MethodRequest(String methodName, String payload, Integer responseTimeout, Integer connectionTimeout)

Constructor for a MethodRequest.

Parameters:

methodName - The method to be invoked
payload - the payload attached to that method
responseTimeout - the timeout in seconds for the response to be received
connectionTimeout - the timeout in seconds for the connection to be established

Throws:

java.lang.IllegalArgumentException - if the provided methodName is null or empty

Method Details

toJson

public String toJson()

Return the json representation of this object

Returns:

the json representation of this object

Applies to