blob: 29f5cf4c18254ff8cc6bdd618d8cde7f6e6bfef5 [file] [log] [blame]
Thomas Vachuska4f1a60c2014-10-28 13:39:07 -07001/*
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 */
tom73d6d1e2014-09-17 20:08:01 -070016package org.onlab.onos.cluster;
17
Pavlin Radoslavov444b5192014-10-28 10:45:19 -070018import org.onlab.packet.IpAddress;
tom73d6d1e2014-09-17 20:08:01 -070019
20/**
21 * Represents a controller instance as a member in a cluster.
22 */
tome4729872014-09-23 00:37:37 -070023public interface ControllerNode {
tom73d6d1e2014-09-17 20:08:01 -070024
25 /** Represents the operational state of the instance. */
26 public enum State {
27 /**
28 * Signifies that the instance is active and operating normally.
29 */
30 ACTIVE,
31
32 /**
33 * Signifies that the instance is inactive, which means either down or
34 * up, but not operational.
35 */
36 INACTIVE
37 }
38
39 /**
40 * Returns the instance identifier.
41 *
42 * @return instance identifier
43 */
tome4729872014-09-23 00:37:37 -070044 NodeId id();
tom73d6d1e2014-09-17 20:08:01 -070045
46 /**
47 * Returns the IP address of the controller instance.
48 *
49 * @return IP address
50 */
Pavlin Radoslavov444b5192014-10-28 10:45:19 -070051 IpAddress ip();
tom73d6d1e2014-09-17 20:08:01 -070052
tomee49c372014-09-26 15:14:50 -070053
54 /**
55 * Returns the TCP port on which the node listens for connections.
56 *
57 * @return TCP port
58 */
59 int tcpPort();
60
tom73d6d1e2014-09-17 20:08:01 -070061}