}
}
- public boolean authorize(boolean useHttps, String fqdn, String apiBaseUrl, String apiVersion, String appToken) {
+ public boolean authorize(boolean useHttps, String fqdn, String apiBaseUrl, String apiVersion, String appToken)
+ throws InterruptedException {
String[] versionSplit = apiVersion.split("\\.");
String majorVersion = "5";
if (versionSplit.length > 0) {
this.appToken = token;
openSession();
return true;
- } catch (FreeboxException | InterruptedException e) {
+ } catch (FreeboxException e) {
logger.debug("Error while opening a session", e);
return false;
}
logger.debug("Binding will schedule a job to establish a connection...");
if (authorizeJob == null || authorizeJob.isCancelled()) {
- authorizeJob = scheduler.schedule(this::authorize, 1, TimeUnit.SECONDS);
+ authorizeJob = scheduler.schedule(() -> {
+ try {
+ authorize();
+ } catch (InterruptedException e) {
+ Thread.currentThread().interrupt();
+ }
+ }, 1, TimeUnit.SECONDS);
}
} else {
updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR,
}
}
- private void authorize() {
+ private void authorize() throws InterruptedException {
logger.debug("Authorize job...");
String fqdn = configuration.fqdn;