-/*******************************************************************************\r
- * Copyright (c) 2007, 2011 Association for Decentralized Information Management\r
- * in Industry THTH ry.\r
- * All rights reserved. This program and the accompanying materials\r
- * are made available under the terms of the Eclipse Public License v1.0\r
- * which accompanies this distribution, and is available at\r
- * http://www.eclipse.org/legal/epl-v10.html\r
- *\r
- * Contributors:\r
- * VTT Technical Research Centre of Finland - initial API and implementation\r
- *******************************************************************************/\r
-package org.simantics.db.management.discovery;\r
-\r
-import org.simantics.db.service.ServerInformation;\r
-\r
-\r
-/**\r
- * @author Tuukka Lehtonen\r
- */\r
-public class ServerInfo {\r
-\r
- public static final ServerInfo[] NONE = {};\r
-\r
- private final String name;\r
-\r
-// private final ServerAddress address;\r
- \r
- private final ServerInformation info;\r
- \r
- private final String aux_info;\r
-\r
- /**\r
- * @param name\r
- * @param address\r
- * @throws IllegalArgumentException if the address is not in host:port\r
- * format\r
- */\r
-// public ServerInfo(String name, String address) throws IllegalArgumentException {\r
-// this(name, address, null, null);\r
-// }\r
- \r
-// public ServerInfo(String name, String address, String aux_info) throws IllegalArgumentException {\r
-// this(name, address, null, aux_info);\r
-// }\r
-//\r
-// public ServerInfo(String name) {\r
-// this(name, null);\r
-// }\r
-// \r
-// public ServerInfo(String name, String aux_info) {\r
-// this(name, aux_info, null);\r
-// }\r
-//\r
-// public ServerInfo(String name, String address, ServerInformation info) throws IllegalArgumentException {\r
-// this(name, address, info, null);\r
-// }\r
-//\r
- public ServerInfo(String name, ServerInformation info, String aux_info) throws IllegalArgumentException {\r
- this.name = name;\r
-// this.address = address == null ? null : new ServerAddress(address);\r
- this.info = info;\r
- this.aux_info = aux_info;\r
- }\r
-//\r
-// public ServerInfo(String name, ServerInformation info) {\r
-// this(name, address, info, null);\r
-// }\r
-// \r
-// public ServerInfo(String name, ServerInformation info, String aux_info) {\r
-// this.name = name;\r
-//// this.address = address;\r
-// this.info = info;\r
-// this.aux_info = aux_info;\r
-// }\r
-\r
- public String getName() {\r
- return name;\r
- }\r
-\r
-// public ServerAddress getAddress() {\r
-// return address;\r
-// }\r
-\r
- public ServerInformation getInfo() {\r
- return info;\r
- }\r
- \r
- public String getAuxInfo() {\r
- return aux_info;\r
- }\r
-\r
- @Override\r
- public String toString() {\r
- String str = name + " "; //+ address;\r
- if(aux_info != null)\r
- str += " "+aux_info;\r
- return str;\r
- }\r
-\r
- @Override\r
- public int hashCode() {\r
- return ((name == null) ? 0 : name.hashCode());\r
- }\r
-\r
- @Override\r
- public boolean equals(Object obj) {\r
- if (this == obj)\r
- return true;\r
- if (obj == null || getClass() != obj.getClass())\r
- return false;\r
- final ServerInfo other = (ServerInfo) obj;\r
-// if (address == null) {\r
-// if (other.address != null)\r
-// return false;\r
-// // The name field is used for equals\r
-// // only when the address is null.\r
-// if (!name.equals(other.name))\r
-// return false;\r
-// } else if (!address.equals(other.address))\r
-// return false;\r
- return true;\r
- }\r
-\r
-// public ServerInfo withAddress(ServerAddress address) {\r
-// return new ServerInfo(name, address);\r
-// }\r
-\r
-}\r
+/*******************************************************************************
+ * Copyright (c) 2007, 2011 Association for Decentralized Information Management
+ * in Industry THTH ry.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * VTT Technical Research Centre of Finland - initial API and implementation
+ *******************************************************************************/
+package org.simantics.db.management.discovery;
+
+import org.simantics.db.service.ServerInformation;
+
+
+/**
+ * @author Tuukka Lehtonen
+ */
+public class ServerInfo {
+
+ public static final ServerInfo[] NONE = {};
+
+ private final String name;
+
+// private final ServerAddress address;
+
+ private final ServerInformation info;
+
+ private final String aux_info;
+
+ /**
+ * @param name
+ * @param address
+ * @throws IllegalArgumentException if the address is not in host:port
+ * format
+ */
+// public ServerInfo(String name, String address) throws IllegalArgumentException {
+// this(name, address, null, null);
+// }
+
+// public ServerInfo(String name, String address, String aux_info) throws IllegalArgumentException {
+// this(name, address, null, aux_info);
+// }
+//
+// public ServerInfo(String name) {
+// this(name, null);
+// }
+//
+// public ServerInfo(String name, String aux_info) {
+// this(name, aux_info, null);
+// }
+//
+// public ServerInfo(String name, String address, ServerInformation info) throws IllegalArgumentException {
+// this(name, address, info, null);
+// }
+//
+ public ServerInfo(String name, ServerInformation info, String aux_info) throws IllegalArgumentException {
+ this.name = name;
+// this.address = address == null ? null : new ServerAddress(address);
+ this.info = info;
+ this.aux_info = aux_info;
+ }
+//
+// public ServerInfo(String name, ServerInformation info) {
+// this(name, address, info, null);
+// }
+//
+// public ServerInfo(String name, ServerInformation info, String aux_info) {
+// this.name = name;
+//// this.address = address;
+// this.info = info;
+// this.aux_info = aux_info;
+// }
+
+ public String getName() {
+ return name;
+ }
+
+// public ServerAddress getAddress() {
+// return address;
+// }
+
+ public ServerInformation getInfo() {
+ return info;
+ }
+
+ public String getAuxInfo() {
+ return aux_info;
+ }
+
+ @Override
+ public String toString() {
+ String str = name + " "; //+ address;
+ if(aux_info != null)
+ str += " "+aux_info;
+ return str;
+ }
+
+ @Override
+ public int hashCode() {
+ return ((name == null) ? 0 : name.hashCode());
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (obj == null || getClass() != obj.getClass())
+ return false;
+ final ServerInfo other = (ServerInfo) obj;
+// if (address == null) {
+// if (other.address != null)
+// return false;
+// // The name field is used for equals
+// // only when the address is null.
+// if (!name.equals(other.name))
+// return false;
+// } else if (!address.equals(other.address))
+// return false;
+ return true;
+ }
+
+// public ServerInfo withAddress(ServerAddress address) {
+// return new ServerInfo(name, address);
+// }
+
+}