Rework SslHandlerFactory
[netconf.git] / apps / callhome-provider / src / main / java / org / opendaylight / netconf / callhome / server / CallHomeStatusRecorder.java
1 /*
2  * Copyright (c) 2023 PANTHEON.tech s.r.o. and others. All rights reserved.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8 package org.opendaylight.netconf.callhome.server;
9
10 import java.net.SocketAddress;
11 import java.security.PublicKey;
12
13 /**
14  * Records the status of incoming connections from configured call-home devices.
15  */
16 public interface CallHomeStatusRecorder {
17
18      /**
19      * Records netconf connection established successfully.
20      *
21      * @param id unique client identifier
22      */
23     void reportSuccess(String id);
24
25      /**
26      * Records client disconnected .
27      *
28      * @param id unique client identifier
29      */
30     void reportDisconnected(String id);
31
32     /**
33      * Records authentication failure for configured client (device).
34      *
35      * @param id unique client identifier
36      */
37     void reportFailedAuth(String id);
38
39      /**
40      * Records NETCONF layer initialization failure for configured client (device).
41      *
42      * @param id unique client identifier
43      */
44     void reportNetconfFailure(String id);
45
46     /**
47      * Records unknown {@link PublicKey} resulting client (device) identification failure.
48      *
49      * @param address the remote address the connection was accepted from
50      * @param publicKey {@link PublicKey} used by client for own identification
51      */
52     void reportUnknown(SocketAddress address, PublicKey publicKey);
53
54     /**
55      * Records any exception causing closure of incoming connection. Mainly for debugging purposes.
56      *
57      * @param throwable exception thrown
58      */
59     default void onTransportChannelFailure(Throwable throwable) {
60         // ignore by default
61     }
62 }