Android Get Configuration Latest Upgrade Information
This method retrieves the latest upgrade strategy for configurations.
Request Parameter List
| Parameter Name | Type | Description |
|---|---|---|
| request | ConfigurationUpgradeRequest | Set specific interface request parameters, see Configuration Get Upgrade Strategy |
Return Value List
| Return Value Name | Type | Description |
|---|---|---|
| result | ConfigurationUpgradeResponse | Interface return value, specific interface return parameters, see Configuration Get Upgrade Strategy |
Example Code
You can use the following code to obtain the latest upgrade strategy - synchronous call
java
package com.toolsetlink.upgradelink.api;
import com.toolsetlink.upgradelink.api.models.*;
import org.junit.*;
import java.io.IOException;
import java.util.concurrent.*;
public class SimpleClientTest {
private Client client;
@Before
public void setUp() {
Config config = new Config();
config.accessKey = "mui2W50H1j-OC4xD6PgQag";
config.secretKey = "PEbdHFGC0uO_Pch7XWBQTMsFRxKPQAM2565eP8LJ3gc";
client = new Client(config);
}
@Test
public void getConfigurationUpgrade_shouldCallCallbackOnSuccess() throws Exception {
ConfigurationUpgradeRequest request = new ConfigurationUpgradeRequest(
"q1hfB1VUQaK9VksTZGPU1Q",
1,
0,
"",
""
);
try {
ConfigurationUpgradeResponse response = client.ConfigurationUpgrade(request);
System.out.println("getConfigurationUpgrade request response: " + response.toString());
} catch (Exception e) {
// Print exception stack trace
e.printStackTrace();
// Let the test fail and give an error message
Assert.fail("getConfigurationUpgrade request failed: " + e.getClass().getSimpleName() + ": " + e.getMessage());
}
}
}You can use the following code to obtain the latest upgrade strategy - asynchronous call
java
package com.toolsetlink.upgradelink.api;
import com.toolsetlink.upgradelink.api.models.*;
import org.junit.*;
import java.io.IOException;
import java.util.concurrent.*;
public class SimpleClientTest {
private Client client;
@Before
public void setUp() {
Config config = new Config();
config.accessKey = "mui2W50H1j-OC4xD6PgQag";
config.secretKey = "PEbdHFGC0uO_Pch7XWBQTMsFRxKPQAM2565eP8LJ3gc";
client = new Client(config);
}
@Test
public void configurationUpgradeAsync_shouldCallCallbackOnSuccess() throws Exception {
ConfigurationUpgradeRequest request = new ConfigurationUpgradeRequest(
"q1hfB1VUQaK9VksTZGPU1Q",
1,
0,
"",
""
);
CountDownLatch latch = new CountDownLatch(1);
Client.Callback<ConfigurationUpgradeResponse> callback = new Client.Callback<>() {
@Override
public void onSuccess(ConfigurationUpgradeResponse response) {
System.out.println("getConfigurationUpgrade request response: " + response.toString());
latch.countDown();
}
@Override
public void onFailure(Throwable t) {
t.printStackTrace();
Assert.fail("getConfigurationUpgrade request failed: " + t.getClass().getSimpleName() + ": " + t.getMessage());
latch.countDown();
}
};
client.ConfigurationUpgradeAsync(request, callback);
Assert.assertTrue("Test timed out", latch.await(15, TimeUnit.SECONDS));
}
}