Class LocalForwardingEntry

java.lang.Object
org.apache.sshd.common.forward.LocalForwardingEntry

public class LocalForwardingEntry extends Object
Author:
Apache MINA SSHD Project
  • Constructor Details

  • Method Details

    • 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
      • equals

        public boolean equals(Object o)
        Overrides:
        equals in class Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • toString

        public String toString()
        Overrides:
        toString in class Object
      • 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 if null/empty and not wildcard address match - i.e., no match reported
        anyLocalAddress - 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 matched
        port - The port - ignored if non-positive - i.e., no match reported
        entries - The Collection of LocalForwardingEntry to check - ignored if null/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