-
Notifications
You must be signed in to change notification settings - Fork 821
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Exposed method to retrieve the list of Server's connected clients (is…
…sue #448)
- Loading branch information
Showing
6 changed files
with
97 additions
and
18 deletions.
There are no files selected for viewing
52 changes: 52 additions & 0 deletions
52
broker/src/main/java/io/moquette/broker/ClientDescriptor.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
package io.moquette.broker; | ||
|
||
import java.util.Objects; | ||
|
||
public class ClientDescriptor { | ||
|
||
private final String clientID; | ||
private final String address; | ||
private final int port; | ||
|
||
ClientDescriptor(String clientID, String address, int port) { | ||
this.clientID = clientID; | ||
this.address = address; | ||
this.port = port; | ||
} | ||
|
||
public String getClientID() { | ||
return clientID; | ||
} | ||
|
||
public String getAddress() { | ||
return address; | ||
} | ||
|
||
public int getPort() { | ||
return port; | ||
} | ||
|
||
@Override | ||
public boolean equals(Object o) { | ||
if (this == o) return true; | ||
if (o == null || getClass() != o.getClass()) return false; | ||
ClientDescriptor that = (ClientDescriptor) o; | ||
return port == that.port && | ||
Objects.equals(clientID, that.clientID) && | ||
Objects.equals(address, that.address); | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
return Objects.hash(clientID, address, port); | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return "ClientDescriptor{" + | ||
"clientID='" + clientID + '\'' + | ||
", address='" + address + '\'' + | ||
", port=" + port + | ||
'}'; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters