2 * Copyright (c) 2010-2023 Contributors to the openHAB project
4 * See the NOTICE file(s) distributed with this work for additional
7 * This program and the accompanying materials are made available under the
8 * terms of the Eclipse Public License 2.0 which is available at
9 * http://www.eclipse.org/legal/epl-2.0
11 * SPDX-License-Identifier: EPL-2.0
13 package org.openhab.binding.mielecloud.internal.config.exception;
15 import java.time.LocalDateTime;
17 import org.eclipse.jdt.annotation.NonNullByDefault;
18 import org.eclipse.jdt.annotation.Nullable;
21 * Exception thrown when there already is an ongoing authorization process.
23 * @author Björn Lange - Initial Contribution
26 public final class OngoingAuthorizationException extends RuntimeException {
27 private static final long serialVersionUID = -6742384930140134244L;
30 private final LocalDateTime ongoingAuthorizationExpiryTimestamp;
33 * Creates a new {@link OngoingAuthorizationException}.
35 * @param message Exception message.
36 * @param ongoingAuthorizationExpiryTimestamp Timestamp when the ongoing authorization will expire.
38 public OngoingAuthorizationException(String message, @Nullable LocalDateTime ongoingAuthorizationExpiryTimestamp) {
40 this.ongoingAuthorizationExpiryTimestamp = ongoingAuthorizationExpiryTimestamp;
44 * Gets the timestamp representing when the ongoing authorization will expire.
47 public LocalDateTime getOngoingAuthorizationExpiryTimestamp() {
48 return ongoingAuthorizationExpiryTimestamp;