Jumpi v1.2.0

org.jumpi.impl.connector.udp
Class UdpDestination

java.lang.Object
  |
  +--org.jumpi.impl.AbstractDestination
        |
        +--org.jumpi.impl.connector.udp.UdpDestination
All Implemented Interfaces:
Destination, Destination

public class UdpDestination
extends AbstractDestination

A UdpDestination represents a UDP Internet Protocol Address. The UdpDestination consists of an InetAddress and a port number. The syntax is:

<protocolname>://[<ipaddress>|*]:[<port>|*]

Both InetAddress and port may be wildcard, used to filter received packets.


Field Summary
 
Fields inherited from class org.jumpi.impl.AbstractDestination
connector_, controller_, props_, url_, wildcard_
 
Fields inherited from interface org.jumpi.Destination
PROTOCOL_SEPARATOR, SEPARATOR
 
Constructor Summary
UdpDestination(java.lang.String url, Controller controller, Connector connector)
          Creates UdpDestination which has a wildcard InetAddress and wilcard port.
UdpDestination(java.lang.String url, Controller controller, Connector connector, java.net.InetAddress address)
          Creates a UdpDestination which has a specific InetAddress but has a wildcard port.
UdpDestination(java.lang.String url, Controller controller, Connector connector, java.net.InetAddress address, int port)
          Creates a UdpDestination specifically for a given InetAddress and port.
UdpDestination(java.lang.String url, Controller controller, Connector connector, int port)
          Creates a UdpDestination which has a specific port but a wildcard InetAddress.
 
Method Summary
 java.net.InetAddress getInetAddress()
          Return the InetAddress.
 int getPort()
          Return the port.
 java.lang.String getUrl()
          Return the Url representation of the Destination.
 boolean matches(Destination dest)
           Determine if the dest UdpDestination matches this instance taking into account wildcard rules.
 
Methods inherited from class org.jumpi.impl.AbstractDestination
equals, getConnector, getController, getControllerName, getProperties, hashCode, isWildcard, setProperties
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UdpDestination

public UdpDestination(java.lang.String url,
                      Controller controller,
                      Connector connector,
                      java.net.InetAddress address,
                      int port)
Creates a UdpDestination specifically for a given InetAddress and port.

Parameters:
url - the Url representing the UdpDestination.
controller - the Controller associated with the UdpDestination.
connector - the Connector associated with the UdpDestination.
address - the InetAddress part of the UdpDestination.
port - the port number of the UdpDestination.

UdpDestination

public UdpDestination(java.lang.String url,
                      Controller controller,
                      Connector connector)
Creates UdpDestination which has a wildcard InetAddress and wilcard port. This can be used allow all received packets, from any host and port combination.

Parameters:
url - the Url representing the UdpDestination.
controller - the Controller associated with the UdpDestination.
connector - the Connector associated with the UdpDestination.

UdpDestination

public UdpDestination(java.lang.String url,
                      Controller controller,
                      Connector connector,
                      java.net.InetAddress address)
Creates a UdpDestination which has a specific InetAddress but has a wildcard port. This UdpDestination can be used to allow received packets from any port on that host.

Parameters:
url - the Url representing the UdpDestination.
controller - the Controller associated with the UdpDestination.
connector - the Connector associated with the UdpDestination.
address - the InetAddress part of the UdpDestination.

UdpDestination

public UdpDestination(java.lang.String url,
                      Controller controller,
                      Connector connector,
                      int port)
Creates a UdpDestination which has a specific port but a wildcard InetAddress. This can be used to receive packets from any host given that the port matches.

Parameters:
url - the Url representing the UdpDestination.
controller - the Controller associated with the UdpDestination.
connector - the Connector associated with the UdpDestination.
port - the port number of the UdpDestination.
Method Detail

getInetAddress

public java.net.InetAddress getInetAddress()
Return the InetAddress.

Returns:
the InetAddress.

getPort

public int getPort()
Return the port.

Returns:
the port.

getUrl

public java.lang.String getUrl()
Return the Url representation of the Destination.

Specified by:
getUrl in interface Destination
Specified by:
getUrl in class AbstractDestination
Returns:
the Url representation of the Destination.

matches

public boolean matches(Destination dest)

Determine if the dest UdpDestination matches this instance taking into account wildcard rules. A wildcard InetAddress matches any host, and a wildcard port matches any port number.

Specified by:
matches in interface Destination
Overrides:
matches in class AbstractDestination
Parameters:
dest - the other Destination to be checked for the match.
Returns:
true if the dest matches this Destination, taking into account wildcard matching.

Jumpi v1.2.0

Copyright © 2003, Peter Jonathan Klauser.