Merge "BUG-2329 Add test for anyxmls inside rpc resonse for netcfon-connector"
[controller.git] / opendaylight / adsal / sal / api / src / main / java / org / opendaylight / controller / sal / utils / IListener.java
1 /*
2  * Copyright (c) 2011 Big Switch Networks, Inc.
3  *
4  * Licensed under the Eclipse Public License, Version 1.0 (the
5  * "License"); you may not use this file except in compliance with the
6  * License. You may obtain a copy of the License at
7  *
8  *      http://www.eclipse.org/legal/epl-v10.html
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
13  * implied. See the License for the specific language governing
14  * permissions and limitations under the License.
15  *
16  * This file incorporates work covered by the following copyright and
17  * permission notice:
18  *
19  *    Originally created by David Erickson, Stanford University
20  *
21  *    Licensed under the Apache License, Version 2.0 (the "License");
22  *    you may not use this file except in compliance with the
23  *    License. You may obtain a copy of the License at
24  *
25  *         http://www.apache.org/licenses/LICENSE-2.0
26  *
27  *    Unless required by applicable law or agreed to in writing,
28  *    software distributed under the License is distributed on an "AS
29  *    IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
30  *    express or implied. See the License for the specific language
31  *    governing permissions and limitations under the License.
32  */
33
34 package org.opendaylight.controller.sal.utils;
35
36 /**
37  * This interface defines the methods for callback ordering
38  *
39  */
40
41 public interface IListener<T> {
42     public enum Command {
43         CONTINUE, STOP
44     }
45
46     /**
47      * The name assigned to this listener
48      *
49      * @return the name string
50      */
51     public String getName();
52
53     /**
54      * Check if the module called name is a callback ordering prerequisite for
55      * this module. In other words, if this function returns true for the given
56      * name, then this listener will be called after that message listener.
57      *
58      * @param type
59      *            the object type to which this applies
60      * @param name
61      *            the name of the module
62      * @return whether name is a prerequisite.
63      */
64     public boolean isCallbackOrderingPrereq(T type, String name);
65
66     /**
67      * Check if the module called name is a callback ordering post-requisite for
68      * this module. In other words, if this function returns true for the given
69      * name, then this listener will be called before that message listener.
70      *
71      * @param type
72      *            the object type to which this applies
73      * @param name
74      *            the name of the module
75      * @return whether name is a post-requisite.
76      */
77     public boolean isCallbackOrderingPostreq(T type, String name);
78 }