1 /**********************************************************************
2 * Copyright (c) 2014 Ericsson
4 * All rights reserved. This program and the accompanying materials are
5 * made available under the terms of the Eclipse Public License v1.0 which
6 * accompanies this distribution, and is available at
7 * http://www.eclipse.org/legal/epl-v10.html
10 * Marc-Andre Laperle - Initial implementation
11 **********************************************************************/
13 package org
.eclipse
.tracecompass
.internal
.lttng2
.control
.ui
.relayd
;
16 * A class that holds information about the relayd connection.
18 * @author Marc-Andre Laperle
20 public final class LttngRelaydConnectionInfo
{
22 private final String fHost
;
23 private final int fPort
;
24 private final String fSessionName
;
27 * Constructs a connection information.
36 public LttngRelaydConnectionInfo(String host
, int port
, String sessionName
) {
39 fSessionName
= sessionName
;
43 * Get the host string.
45 * @return the host string
47 public String
getHost() {
52 * Get the port number.
54 * @return the port number
56 public int getPort() {
61 * Get the session name.
63 * @return the session name
65 public String
getSessionName() {
70 public int hashCode() {
73 result
= prime
* result
+ ((fHost
== null) ?
0 : fHost
.hashCode());
74 result
= prime
* result
+ fPort
;
75 result
= prime
* result
+ ((fSessionName
== null) ?
0 : fSessionName
.hashCode());
80 public boolean equals(final Object obj
) {
87 if (getClass() != obj
.getClass()) {
90 LttngRelaydConnectionInfo other
= (LttngRelaydConnectionInfo
) obj
;
92 if (other
.fHost
!= null) {
95 } else if (!fHost
.equals(other
.fHost
)) {
98 if (fPort
!= other
.fPort
) {
101 if (fSessionName
== null) {
102 if (other
.fSessionName
!= null) {
105 } else if (!fSessionName
.equals(other
.fSessionName
)) {