public class FirmwareRequestExecutor extends RequestExecutor<Firmware>
FirmwaresApi
. Use this class if you want to get
single firmware through fluent API in chained fashion, for instance:
KontaktCloud kontaktCloud = KontaktCloudFactory.create();
String name = "3.1";
Firmware firmware = kontaktCloud.firmwares().fetch(name)
.forDeviceType(DeviceType.BEACON)
.execute();
Keep in mind that device type must be specified so invocation of forDeviceType
method is mandatory.
Otherwise an exception will be thrown.Constructor and Description |
---|
FirmwareRequestExecutor(FirmwaresService firmwaresService,
java.lang.String name)
Constructs request executor initialized with corresponding service class and firmware name.
|
Modifier and Type | Method and Description |
---|---|
Firmware |
execute()
Executes created request synchronously.
|
void |
execute(CloudCallback<Firmware> callback)
Executes created request asynchronously and invokes callback with the result.
|
FirmwareRequestExecutor |
forDeviceType(DeviceType deviceType)
Specifies device type.
|
public FirmwareRequestExecutor(FirmwaresService firmwaresService, java.lang.String name)
firmwaresService
- the firmwares API service.name
- the firmware name.public FirmwareRequestExecutor forDeviceType(DeviceType deviceType)
deviceType
- the device type.public Firmware execute() throws java.io.IOException, KontaktCloudException
execute
in class RequestExecutor<Firmware>
java.io.IOException
- exceptionKontaktCloudException
- exceptionpublic void execute(CloudCallback<Firmware> callback)
execute
in class RequestExecutor<Firmware>
callback
- the callback object.