private ThingStatusInfo buildStatusInfo(ThingStatus thingStatus, ThingStatusDetail thingStatusDetail, String description) { ThingStatusInfoBuilder statusInfoBuilder = ThingStatusInfoBuilder.create(thingStatus, thingStatusDetail); statusInfoBuilder.withDescription(description); return statusInfoBuilder.build(); }
/** * Updates the status of the thing. * * @param status the status * @param statusDetail the detail of the status * @param description the description of the status */ protected void updateStatus(ThingStatus status, ThingStatusDetail statusDetail, @Nullable String description) { synchronized (this) { if (this.callback != null) { ThingStatusInfoBuilder statusBuilder = ThingStatusInfoBuilder.create(status, statusDetail); ThingStatusInfo statusInfo = statusBuilder.withDescription(description).build(); this.callback.statusUpdated(this.thing, statusInfo); } else { logger.warn("Handler {} tried updating the thing status although the handler was already disposed.", this.getClass().getSimpleName()); } } }