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
21 public final class LttngRelaydConnectionInfo
{
23 private final String fHost
;
24 private final int fPort
;
25 private final String fSessionName
;
28 * Constructs a connection information.
37 public LttngRelaydConnectionInfo(String host
, int port
, String sessionName
) {
40 fSessionName
= sessionName
;
44 * Get the host string.
46 * @return the host string
48 public String
getHost() {
53 * Get the port number.
55 * @return the port number
57 public int getPort() {
62 * Get the session name.
64 * @return the session name
66 public String
getSessionName() {
71 public int hashCode() {
74 result
= prime
* result
+ ((fHost
== null) ?
0 : fHost
.hashCode());
75 result
= prime
* result
+ fPort
;
76 result
= prime
* result
+ ((fSessionName
== null) ?
0 : fSessionName
.hashCode());
81 public boolean equals(final Object obj
) {
88 if (getClass() != obj
.getClass()) {
91 LttngRelaydConnectionInfo other
= (LttngRelaydConnectionInfo
) obj
;
93 if (other
.fHost
!= null) {
96 } else if (!fHost
.equals(other
.fHost
)) {
99 if (fPort
!= other
.fPort
) {
102 if (fSessionName
== null) {
103 if (other
.fSessionName
!= null) {
106 } else if (!fSessionName
.equals(other
.fSessionName
)) {