DirectMethod Class
- java.
lang. Object - com.
microsoft. azure. sdk. iot. device. twin. DirectMethod
- com.
public class DirectMethod
Constructor Summary
Constructor | Description |
---|---|
DirectMethod(InternalClient client, SubscriptionAcknowledgedCallback deviceMethodStatusCallback, Object deviceMethodStatusCallbackContext) |
This constructor creates an instance of device method class which helps facilitate the interation for device methods between the user and IotHub. |
Method Summary
Modifier and Type | Method and Description |
---|---|
void |
subscribeToDirectMethods(MethodCallback methodCallback, Object deviceMethodCallbackContext)
A method which subscribes to receive device method invocation for the user with the IotHub. |
Constructor Details
DirectMethod
public DirectMethod(InternalClient client, SubscriptionAcknowledgedCallback deviceMethodStatusCallback, Object deviceMethodStatusCallbackContext)
This constructor creates an instance of device method class which helps facilitate the interation for device methods between the user and IotHub.
Parameters:
Device client object for this connection instance for the device. Cannot benull
</code></p>
deviceMethodStatusCallback
- Callback to provide status for device method state with IotHub. Cannot benull
</code> . </p>
deviceMethodStatusCallbackContext
- Context to be passed when device method status is invoked. Can benull
</code></p>
Throws:
IllegalArgumentException
- This exception is thrown if either deviceIO or config or deviceMethodStatusCallback are null
Method Details
subscribeToDirectMethods
public void subscribeToDirectMethods(MethodCallback methodCallback, Object deviceMethodCallbackContext)
A method which subscribes to receive device method invocation for the user with the IotHub.
Parameters:
methodCallback
- Callback where upon receiving the request the invoke a method shall be triggered.
deviceMethodCallbackContext
- Context to be passed on when invoking the callback.
Throws:
IllegalArgumentException
- This exception is thrown when methodCallback is provided null.
Applies to
Azure SDK for Java