Package org.apache.sshd.common.forward
Class LocalForwardingEntry
- java.lang.Object
-
- org.apache.sshd.common.forward.LocalForwardingEntry
-
public class LocalForwardingEntry extends Object
- Author:
- Apache MINA SSHD Project
-
-
Constructor Summary
Constructors Constructor Description LocalForwardingEntry(SshdSocketAddress local, InetSocketAddress bound)
LocalForwardingEntry(SshdSocketAddress local, SshdSocketAddress bound)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object o)
static LocalForwardingEntry
findMatchingEntry(String host, boolean anyLocalAddress, int port, Collection<? extends LocalForwardingEntry> entries)
static LocalForwardingEntry
findMatchingEntry(String host, int port, Collection<? extends LocalForwardingEntry> entries)
SshdSocketAddress
getBoundAddress()
SshdSocketAddress
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.SshdSocketAddress
getLocalAddress()
int
hashCode()
static SshdSocketAddress
resolveCombinedBoundAddress(SshdSocketAddress local, SshdSocketAddress bound)
String
toString()
-
-
-
Constructor Detail
-
LocalForwardingEntry
public LocalForwardingEntry(SshdSocketAddress local, InetSocketAddress bound)
-
LocalForwardingEntry
public LocalForwardingEntry(SshdSocketAddress local, SshdSocketAddress bound)
-
-
Method Detail
-
getLocalAddress
public SshdSocketAddress getLocalAddress()
- Returns:
- The original requested local address for binding
-
getBoundAddress
public SshdSocketAddress getBoundAddress()
- Returns:
- The actual bound address
-
getCombinedBoundAddress
public SshdSocketAddress 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
-
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
-
-