Package org.apache.sshd.common.forward
Class LocalForwardingEntry
java.lang.Object
org.apache.sshd.common.forward.LocalForwardingEntry
- Author:
- Apache MINA SSHD Project
-
Constructor Summary
ConstructorDescriptionLocalForwardingEntry
(SshdSocketAddress local, InetSocketAddress bound) LocalForwardingEntry
(SshdSocketAddress local, SshdSocketAddress bound) -
Method Summary
Modifier and TypeMethodDescriptionboolean
static LocalForwardingEntry
findMatchingEntry
(String host, boolean anyLocalAddress, int port, Collection<? extends LocalForwardingEntry> entries) static LocalForwardingEntry
findMatchingEntry
(String host, int port, Collection<? extends LocalForwardingEntry> entries) A combined address using the following logic: If original requested local binding has a specific port and non-wildcard address then use the local binding as-is If original requested local binding has a specific address but no specific port, then combine its address with the actual auto-allocated port at binding. If original requested local binding has neither a specific address nor a specific port then use the effective bound address.int
hashCode()
static SshdSocketAddress
resolveCombinedBoundAddress
(SshdSocketAddress local, SshdSocketAddress bound) toString()
-
Constructor Details
-
LocalForwardingEntry
-
LocalForwardingEntry
-
-
Method Details
-
getLocalAddress
- Returns:
- The original requested local address for binding
-
getBoundAddress
- Returns:
- The actual bound address
-
getCombinedBoundAddress
A combined address using the following logic:- If original requested local binding has a specific port and non-wildcard address then use the local binding as-is
- If original requested local binding has a specific address but no specific port, then combine its address with the actual auto-allocated port at binding.
- If original requested local binding has neither a specific address nor a specific port then use the effective bound address.
- Returns:
- Combined result
-
equals
-
hashCode
public int hashCode() -
toString
-
resolveCombinedBoundAddress
public static SshdSocketAddress resolveCombinedBoundAddress(SshdSocketAddress local, SshdSocketAddress bound) -
findMatchingEntry
public static LocalForwardingEntry findMatchingEntry(String host, int port, Collection<? extends LocalForwardingEntry> entries) -
findMatchingEntry
public static LocalForwardingEntry findMatchingEntry(String host, boolean anyLocalAddress, int port, Collection<? extends LocalForwardingEntry> entries) - Parameters:
host
- The host - ignored ifnull
/empty and not wildcard address match - i.e., no match reportedanyLocalAddress
- Is host the wildcard address - in which case, we try an exact match first for the host, and if that fails then only the port is matchedport
- The port - ignored if non-positive - i.e., no match reportedentries
- TheCollection
ofLocalForwardingEntry
to check - ignored ifnull
/empty - i.e., no match reported- Returns:
- The first entry whose local or bound address matches the host name - case
insensitive and has a matching bound port -
null
if no match found
-