3 * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
5 * This program and the accompanying materials are made available under the
6 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
7 * and is available at http://www.eclipse.org/legal/epl-v10.html
10 package org.opendaylight.controller.usermanager;
12 import java.io.Serializable;
14 import org.opendaylight.controller.configuration.ConfigurationObject;
17 * Configuration Java Object which represents a Remote AAA server configuration
18 * information for User Manager.
20 public class ServerConfig extends ConfigurationObject implements Serializable {
21 private static final long serialVersionUID = 1L;
23 // Order matters: JSP file expects following fields in the following order
25 private String secret;
26 private String protocol;
28 public ServerConfig() {
31 public ServerConfig(String ip, String secret, String protocol) {
34 this.protocol = protocol;
37 public String getAddress() {
41 public String getSecret() {
45 public String getProtocol() {
50 public int hashCode() {
53 result = prime * result + ((ip == null) ? 0 : ip.hashCode());
54 result = prime * result
55 + ((protocol == null) ? 0 : protocol.hashCode());
56 result = prime * result + ((secret == null) ? 0 : secret.hashCode());
61 public boolean equals(Object obj) {
68 if (getClass() != obj.getClass()) {
71 ServerConfig other = (ServerConfig) obj;
73 if (other.ip != null) {
76 } else if (!ip.equals(other.ip)) {
79 if (protocol == null) {
80 if (other.protocol != null) {
83 } else if (!protocol.equals(other.protocol)) {
87 if (other.secret != null) {
90 } else if (!secret.equals(other.secret)) {
96 public boolean isValid() {
97 return (ip != null && !ip.isEmpty() && secret != null && !secret