Package org.apache.sshd.common.forward
Class LocalForwardingEntry
- java.lang.Object
-
- java.net.SocketAddress
-
- org.apache.sshd.common.util.net.SshdSocketAddress
-
- org.apache.sshd.common.forward.LocalForwardingEntry
-
- All Implemented Interfaces:
java.io.Serializable
public class LocalForwardingEntry extends SshdSocketAddress
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.Stringaliasprivate static longserialVersionUID-
Fields inherited from class org.apache.sshd.common.util.net.SshdSocketAddress
BROADCAST_ADDRESS, BY_HOST_ADDRESS, BY_HOST_AND_PORT, CARRIER_GRADE_NAT_PREFIX, IPV4_ANYADDR, IPV6_LONG_ANY_ADDRESS, IPV6_LONG_LOCALHOST, IPV6_MAX_HEX_DIGITS_PER_GROUP, IPV6_MAX_HEX_GROUPS, IPV6_SHORT_ANY_ADDRESS, IPV6_SHORT_LOCALHOST, LOCALHOST_ADDRESS, LOCALHOST_IPV4, LOCALHOST_NAME, PRIVATE_CLASS_A_PREFIX, PRIVATE_CLASS_B_PREFIX, PRIVATE_CLASS_C_PREFIX, WELL_KNOWN_IPV4_ADDRESSES, WELL_KNOWN_IPV6_ADDRESSES
-
-
Constructor Summary
Constructors Constructor Description LocalForwardingEntry(java.lang.String hostName, java.lang.String alias, int port)LocalForwardingEntry(SshdSocketAddress local, java.net.InetSocketAddress bound)LocalForwardingEntry(SshdSocketAddress local, SshdSocketAddress bound)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object o)static LocalForwardingEntryfindMatchingEntry(java.lang.String host, int port, java.util.Collection<? extends LocalForwardingEntry> entries)java.lang.StringgetAlias()inthashCode()protected booleanisEquivalent(SshdSocketAddress that)java.lang.StringtoString()-
Methods inherited from class org.apache.sshd.common.util.net.SshdSocketAddress
getExternalNetwork4Addresses, getFirstExternalNetwork4Address, getHostName, getPort, isCarrierGradeNatIPv4Address, isIPv4Address, isIPv6Address, isLoopback, isLoopback, isPrivateIPv4Address, isValidHostAddress, isValidIPv4AddressComponent, toAddressPort, toAddressString, toAddressString, toInetSocketAddress, toInetSocketAddress, toSshdSocketAddress
-
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
alias
private final java.lang.String alias
-
-
Constructor Detail
-
LocalForwardingEntry
public LocalForwardingEntry(SshdSocketAddress local, java.net.InetSocketAddress bound)
-
LocalForwardingEntry
public LocalForwardingEntry(SshdSocketAddress local, SshdSocketAddress bound)
-
LocalForwardingEntry
public LocalForwardingEntry(java.lang.String hostName, java.lang.String alias, int port)
-
-
Method Detail
-
getAlias
public java.lang.String getAlias()
-
isEquivalent
protected boolean isEquivalent(SshdSocketAddress that)
- Overrides:
isEquivalentin classSshdSocketAddress
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classSshdSocketAddress
-
hashCode
public int hashCode()
- Overrides:
hashCodein classSshdSocketAddress
-
toString
public java.lang.String toString()
- Overrides:
toStringin classSshdSocketAddress
-
findMatchingEntry
public static LocalForwardingEntry findMatchingEntry(java.lang.String host, int port, java.util.Collection<? extends LocalForwardingEntry> entries)
- Parameters:
host- The host - ignored ifnull/empty - i.e., no match reportedport- The port - ignored if non-positive - i.e., no match reportedentries- TheCollectionofLocalForwardingEntryto check - ignored ifnull/empty - i.e., no match reported- Returns:
- The first entry whose host or alias matches the host name - case
insensitive and has a matching port -
nullif no match found
-
-