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;
15 * Configuration Java Object which represents a Remote AAA server configuration
16 * information for User Manager.
18 public class ServerConfig implements Serializable {
19 private static final long serialVersionUID = 1L;
21 // Order matters: JSP file expects following fields in the following order
23 private String secret;
24 private String protocol;
26 public ServerConfig() {
29 public ServerConfig(String ip, String secret, String protocol) {
32 this.protocol = protocol;
35 public String getAddress() {
39 public String getSecret() {
43 public String getProtocol() {
48 public int hashCode() {
51 result = prime * result + ((ip == null) ? 0 : ip.hashCode());
52 result = prime * result
53 + ((protocol == null) ? 0 : protocol.hashCode());
54 result = prime * result + ((secret == null) ? 0 : secret.hashCode());
59 public boolean equals(Object obj) {
64 if (getClass() != obj.getClass())
66 ServerConfig other = (ServerConfig) obj;
70 } else if (!ip.equals(other.ip))
72 if (protocol == null) {
73 if (other.protocol != null)
75 } else if (!protocol.equals(other.protocol))
78 if (other.secret != null)
80 } else if (!secret.equals(other.secret))
85 public boolean isValid() {
86 return (ip != null && !ip.isEmpty() && secret != null && !secret