1 /*
2  * Copyright (C) 2022 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 package android.net.ipsec.ike.exceptions;
17 
18 import android.annotation.NonNull;
19 import android.net.ipsec.ike.ChildSessionCallback;
20 import android.net.ipsec.ike.IkeSessionCallback;
21 
22 import java.io.IOException;
23 
24 /**
25  * This exception is thrown when there is an IKE retransmission timeout.
26  *
27  * <p>This exception indicates that the IKE Session failed to receive an IKE response before hitting
28  * the maximum number of retransmission attempts configured in {@link
29  * android.net.ipsec.ike.IkeSessionParams.Builder#setRetransmissionTimeoutsMillis(int[])}.
30  *
31  * @see <a href="https://datatracker.ietf.org/doc/html/rfc7296#section-2.1">RFC 7296, Internet Key
32  *     Exchange Protocol Version 2 (IKEv2)</a>
33  */
34 public final class IkeTimeoutException extends IOException {
35 
36     /**
37      * Constructs an {@code IkeTimeoutException} with the specified detail message.
38      *
39      * <p>Callers are not generally expected to instantiate this object themselves, except for
40      * testing. A reference is passed via {@link IkeSessionCallback} or {@link
41      * ChildSessionCallback}.
42      *
43      * @param message The detail message (which is saved for later retrieval by the {@link
44      *     #getMessage()} method)
45      */
IkeTimeoutException(@onNull String message)46     public IkeTimeoutException(@NonNull String message) {
47         super(message);
48     }
49 }
50