public DeviceCredentialsRepresentation pollCredentials(String deviceId, PollingStrategy pollingStrategy) {
return aPoller(deviceId, pollingStrategy).startAndPoll();
}
private AlteringRateResultPoller<DeviceCredentialsRepresentation> aPoller(final String deviceId, PollingStrategy pollingStrategy) {
final DeviceCredentialsRepresentation representation = new DeviceCredentialsRepresentation();
representation.setId(deviceId);
GetResultTask<DeviceCredentialsRepresentation> pollingTask = new GetResultTask<DeviceCredentialsRepresentation>() {
@Override
public DeviceCredentialsRepresentation tryGetResult() {
return restConnector.post(url, DEVICE_CREDENTIALS, representation);