blob: a3086ba5bfdfb44b6e69571015a3a1da0dab5998 [file] [log] [blame]
maojianwei42e23442016-02-15 10:40:48 +08001/*
2 * Copyright 2015-present Open Networking Laboratory
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 */
16package org.onosproject.fnl.intf;
17
18import org.onosproject.fnl.intf.NetworkDiagnostic.Type;
19
20import java.util.Set;
21
22/**
23 * Network Troubleshooting Core Service.
24 */
25public interface NetworkDiagnosticService {
26
27 /**
28 * Checks for and returns all registered kinds of network anomalies.
29 * An empty set is returned if there are no anomalies found.
30 *
31 * @return all discovered anomalies; may be empty
32 */
33 Set<NetworkAnomaly> findAnomalies();
34
35 /**
36 * Checks for and returns the specific kind of network anomalies.
37 * <p>
38 * An empty set is returned if there is no anomaly of specific type,
39 * or there is no diagnostic of specific type.
40 *
41 * @return the specific kind of anomalies; may be empty
42 */
43
44 /**
45 * Checks for and returns the specific type of network anomalies.
46 * <p>
47 * An empty set is returned if there is no anomaly of specific type,
48 * or there is no diagnostic of specific type.
49 *
50 * @param type the type of network anomalies
51 * @return the specific kind of anomalies; may be empty
52 */
53 Set<NetworkAnomaly> findAnomalies(Type type);
54
55 /**
56 * Registers the specified diagnostic module with the service.
57 *
58 * Each diagnostic type can have only one module,
59 * and previous one will be removed.
60 *
61 * @param diagnostic an instance of class implemented NetworkDiagnostic
62 */
63 void register(NetworkDiagnostic diagnostic);
64
65 /**
66 * Unregisters the specified diagnostic module form the service.
67 *
68 * @param diagnostic diagnostic module to be removed
69 * @return true if the module existed before and has been removed
70 * successfully; false otherwise
71 */
72 boolean unregister(NetworkDiagnostic diagnostic);
73}