com.eurotech.framework.net.firewall
Class FirewallPortForwardConfigIP<T extends IPAddress>

java.lang.Object
  extended by com.eurotech.framework.net.firewall.FirewallPortForwardConfigIP<T>
Type Parameters:
T -
All Implemented Interfaces:
FirewallPortForwardConfig, NetConfig
Direct Known Subclasses:
FirewallPortForwardConfigIP4

public abstract class FirewallPortForwardConfigIP<T extends IPAddress>
extends Object
implements FirewallPortForwardConfig

The base class for firewall port forward configurations

Author:
eurotech

Constructor Summary
FirewallPortForwardConfigIP()
          Creates and empty port forward configuration
FirewallPortForwardConfigIP(String interfaceName, IP4Address address, NetProtocol protocol, int inPort, int outPort, NetworkPair<T> permittedNetwork, String permittedMac, String sourcePortRange)
          Creates a complete port forward configuration
 
Method Summary
 boolean equals(Object obj)
           
 IP4Address getAddress()
          The LAN IP address to forward connections to
 int getInPort()
          The inbound (WAN) port to use for this configuration
 String getInterfaceName()
          The external (WAN) interface to listen for inbound connections on
 int getOutPort()
          The outbound (LAN) port to use for this configuration
 String getPermittedMac()
          Gets the (optional) permitted MAC address that is allowed to make inbound connections
 NetworkPair<T> getPermittedNetwork()
          Gets the (optional) permitted remote network that can make inbound connections
 NetProtocol getProtocol()
          Gets the type of network protocol (TCP or UDP) that is used for this configuration
 String getSourcePortRange()
          Gets the (optional) permitted source port range that is allowed to make inbound connections
 int hashCode()
           
 boolean isValid()
          Checks whether or not this configuration is valid.
 void setAddress(IP4Address address)
           
 void setInPort(int inPort)
           
 void setInterfaceName(String interfaceName)
           
 void setOutPort(int outPort)
           
 void setPermittedMac(String permittedMac)
           
 void setPermittedNetwork(NetworkPair<T> permittedNetwork)
           
 void setProtocol(NetProtocol protocol)
           
 void setSourcePortRange(String sourcePortRange)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FirewallPortForwardConfigIP

public FirewallPortForwardConfigIP()
Creates and empty port forward configuration


FirewallPortForwardConfigIP

public FirewallPortForwardConfigIP(String interfaceName,
                                   IP4Address address,
                                   NetProtocol protocol,
                                   int inPort,
                                   int outPort,
                                   NetworkPair<T> permittedNetwork,
                                   String permittedMac,
                                   String sourcePortRange)
Creates a complete port forward configuration

Parameters:
interfaceName - The interface name on which this configuration will listen for inbound connections
address - The LAN address to forward to
protocol - The protocol (TCP or UDP) to listen for and forward
inPort - The inbound (WAN) port to listen on
outPort - The outbound (LAN) port to listen on
permittedNetwork - The (optional) permitted network for inbound connections
permittedMac - The (optional) permitted MAC address for inbound connections
sourcePortRange - The (options) permitted source port range for inbound connections
Method Detail

getInterfaceName

public String getInterfaceName()
Description copied from interface: FirewallPortForwardConfig
The external (WAN) interface to listen for inbound connections on

Specified by:
getInterfaceName in interface FirewallPortForwardConfig
Returns:
The interface name used for this port forward configuration

setInterfaceName

public void setInterfaceName(String interfaceName)

getAddress

public IP4Address getAddress()
Description copied from interface: FirewallPortForwardConfig
The LAN IP address to forward connections to

Specified by:
getAddress in interface FirewallPortForwardConfig
Returns:
The LAN IPAddress to forward connections to

setAddress

public void setAddress(IP4Address address)

getProtocol

public NetProtocol getProtocol()
Description copied from interface: FirewallPortForwardConfig
Gets the type of network protocol (TCP or UDP) that is used for this configuration

Specified by:
getProtocol in interface FirewallPortForwardConfig
Returns:
The NetProtocol type associated with this interface

setProtocol

public void setProtocol(NetProtocol protocol)

getInPort

public int getInPort()
Description copied from interface: FirewallPortForwardConfig
The inbound (WAN) port to use for this configuration

Specified by:
getInPort in interface FirewallPortForwardConfig
Returns:
The WAN port number

setInPort

public void setInPort(int inPort)

getOutPort

public int getOutPort()
Description copied from interface: FirewallPortForwardConfig
The outbound (LAN) port to use for this configuration

Specified by:
getOutPort in interface FirewallPortForwardConfig
Returns:
The LAN port number

setOutPort

public void setOutPort(int outPort)

getPermittedNetwork

public NetworkPair<T> getPermittedNetwork()
Description copied from interface: FirewallPortForwardConfig
Gets the (optional) permitted remote network that can make inbound connections

Specified by:
getPermittedNetwork in interface FirewallPortForwardConfig
Returns:
The NetworkPair representing the permitted network

setPermittedNetwork

public void setPermittedNetwork(NetworkPair<T> permittedNetwork)

getPermittedMac

public String getPermittedMac()
Description copied from interface: FirewallPortForwardConfig
Gets the (optional) permitted MAC address that is allowed to make inbound connections

Specified by:
getPermittedMac in interface FirewallPortForwardConfig
Returns:
The MAC address that is allowed to make inbound connections

setPermittedMac

public void setPermittedMac(String permittedMac)

getSourcePortRange

public String getSourcePortRange()
Description copied from interface: FirewallPortForwardConfig
Gets the (optional) permitted source port range that is allowed to make inbound connections

Specified by:
getSourcePortRange in interface FirewallPortForwardConfig
Returns:
The source port range that is allowed to make inbound connections

setSourcePortRange

public void setSourcePortRange(String sourcePortRange)

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

isValid

public boolean isValid()
Description copied from interface: NetConfig
Checks whether or not this configuration is valid.

Specified by:
isValid in interface NetConfig
Returns:
true if the configuration is valid, otherwise false

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2013. All Rights Reserved.