2 * Copyright (c) 2014 Cisco Systems, Inc. and others. All rights reserved.
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
8 package org.opendaylight.controller.connectionmanager.scheme;
10 import java.net.InetAddress;
13 * Configuration object that can be used to prioritize or add weight to a given controller.
14 * This can be potentially used by the Connection management scheme algorithms.
16 * This is currently not used.
19 public class ControllerConfig {
20 private InetAddress controllerId;
24 public ControllerConfig(InetAddress controllerId, int priority, int weight) {
25 this.controllerId = controllerId;
26 this.priority = priority;
30 public InetAddress getControllerId() {
33 public int getPriority() {
36 public int getWeight() {
41 public int hashCode() {
44 result = prime * result
45 + ((controllerId == null) ? 0 : controllerId.hashCode());
49 public boolean equals(Object obj) {
54 if (getClass() != obj.getClass())
56 ControllerConfig other = (ControllerConfig) obj;
57 if (controllerId == null) {
58 if (other.controllerId != null)
60 } else if (!controllerId.equals(other.controllerId))
65 public String toString() {
66 return "ControllerConfig [controllerId=" + controllerId + ", priority="
67 + priority + ", weight=" + weight + "]";