88c4cc7087ac9c0ce630ffa3c2c090adecc73c8f
[onosfw.git] /
1 /*
2  * Copyright 2014 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  */
16 package org.onosproject.openflow.controller.driver;
17
18 /**
19  * When we remove a pending role request we use this enum to indicate how we
20  * arrived at the decision. When we send a role request to the switch, we
21  * also use  this enum to indicate what we expect back from the switch, so the
22  * role changer can match the reply to our expectation.
23  */
24 public enum RoleRecvStatus {
25     /** The switch returned an error indicating that roles are not.
26      * supported*/
27     UNSUPPORTED,
28     /** The request timed out. */
29     NO_REPLY,
30     /** The reply was old, there is a newer request pending. */
31     OLD_REPLY,
32     /**
33      *  The reply's role matched the role that this controller set in the
34      *  request message - invoked either initially at startup or to reassert
35      *  current role.
36      */
37     MATCHED_CURRENT_ROLE,
38     /**
39      *  The reply's role matched the role that this controller set in the
40      *  request message - this is the result of a callback from the
41      *  global registry, followed by a role request sent to the switch.
42      */
43     MATCHED_SET_ROLE,
44     /**
45      * The reply's role was a response to the query made by this controller.
46      */
47     REPLY_QUERY,
48     /** We received a role reply message from the switch
49      *  but the expectation was unclear, or there was no expectation.
50      */
51     OTHER_EXPECTATION,
52 }