X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=bundles%2Forg.simantics.db.management%2Fsrc%2Forg%2Fsimantics%2Fdb%2Fmanagement%2Fdiscovery%2FServerInfo.java;fp=bundles%2Forg.simantics.db.management%2Fsrc%2Forg%2Fsimantics%2Fdb%2Fmanagement%2Fdiscovery%2FServerInfo.java;h=55ee365e7cd8130d7250d4678bd8ddca556b071d;hb=0ae2b770234dfc3cbb18bd38f324125cf0faca07;hp=f4a18e2e1a0f46f527b7fae61f5dda5041f21e7a;hpb=24e2b34260f219f0d1644ca7a138894980e25b14;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.db.management/src/org/simantics/db/management/discovery/ServerInfo.java b/bundles/org.simantics.db.management/src/org/simantics/db/management/discovery/ServerInfo.java index f4a18e2e1..55ee365e7 100644 --- a/bundles/org.simantics.db.management/src/org/simantics/db/management/discovery/ServerInfo.java +++ b/bundles/org.simantics.db.management/src/org/simantics/db/management/discovery/ServerInfo.java @@ -1,128 +1,128 @@ -/******************************************************************************* - * 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); -// } - -} +/******************************************************************************* + * 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); +// } + +}