public class CommandsRequestExecutor extends PaginatedRequestExecutor<SecureCommands>
CommandsApi
. Use this class if you want to obtain
secure commands through fluent API in chained fashion. Here is an example of how to use this executor:
IKontaktCloud kontaktCloud = KontaktCloud.newInstance();
SecureCommands commands = kontaktCloud.commands().fetch()
.forDevices("34Gh", "5Gk9", "d5Gv")
.withType(SecureCommandType.BOOTLOADER)
.startIndex(5)
.maxResult(15)
.execute();
Keep in mind that devices and command type must be specified so invocations of forDevices
and withType
methods are mandatory. Otherwise an exception will be thrown.eTag, maxResult, order, orderBy, query, startIndex
Constructor and Description |
---|
CommandsRequestExecutor(CommandsService commandsService)
Constructs request executor initialized with corresponding service class.
|
Modifier and Type | Method and Description |
---|---|
CommandsRequestExecutor |
eTag(java.lang.String eTag)
Specifies HTTP entity tag purposed for caching REST API calls.
|
SecureCommands |
execute()
Executes created request synchronously.
|
void |
execute(CloudCallback<SecureCommands> callback)
Executes created request asynchronously and invokes callback with the result.
|
CommandsRequestExecutor |
filter(java.lang.String query)
Specifies the filter for requested data.
|
CommandsRequestExecutor |
forDevices(java.util.List<java.lang.String> uniqueIds)
Specifies devices.
|
CommandsRequestExecutor |
forDevices(java.lang.String... uniqueIds)
Specifies devices.
|
CommandsRequestExecutor |
maxResult(int maxResult)
Specifies the maximum size of response data collection.
|
CommandsRequestExecutor |
orderBy(OrderBy orderBy,
Order order)
Specifies the ordering of response data elements.
|
protected java.util.Map<java.lang.String,java.lang.String> |
params()
Composes the request's query parameters in map.
|
protected retrofit2.Call<SecureCommands> |
prepareCall()
Prepares a request to execute.
|
CommandsRequestExecutor |
startIndex(int startIndex)
Specifies the start index of requested data.
|
CommandsRequestExecutor |
withType(SecureCommandType type)
Specifies the command's type.
|
public CommandsRequestExecutor(CommandsService commandsService)
commandsService
- the commands API service.public CommandsRequestExecutor forDevices(java.lang.String... uniqueIds)
uniqueIds
- the device unique identifiers.public CommandsRequestExecutor forDevices(java.util.List<java.lang.String> uniqueIds)
uniqueIds
- the device unique identifiers.public CommandsRequestExecutor withType(SecureCommandType type)
type
- the secure command type.public CommandsRequestExecutor startIndex(int startIndex)
startIndex
in class PaginatedRequestExecutor<SecureCommands>
startIndex
- the start index.public CommandsRequestExecutor maxResult(int maxResult)
maxResult
in class PaginatedRequestExecutor<SecureCommands>
maxResult
- the maximum response size value.public CommandsRequestExecutor filter(java.lang.String query)
filter
in class PaginatedRequestExecutor<SecureCommands>
query
- the query filter.public CommandsRequestExecutor orderBy(OrderBy orderBy, Order order)
orderBy
in class PaginatedRequestExecutor<SecureCommands>
orderBy
- the field type that specifies the order by column.order
- ascending or descending.public CommandsRequestExecutor eTag(java.lang.String eTag)
eTag
in class PaginatedRequestExecutor<SecureCommands>
eTag
- the entity tag value.public SecureCommands execute() throws java.io.IOException, KontaktCloudException
execute
in class RequestExecutor<SecureCommands>
java.io.IOException
- exceptionKontaktCloudException
- exceptionpublic void execute(CloudCallback<SecureCommands> callback)
execute
in class RequestExecutor<SecureCommands>
callback
- the callback object.protected retrofit2.Call<SecureCommands> prepareCall()
prepareCall
in class RequestExecutor<SecureCommands>
protected java.util.Map<java.lang.String,java.lang.String> params()
params
in class PaginatedRequestExecutor<SecureCommands>