net.jolsrv2
Class Node

java.lang.Object
  extended by net.jolsrv2.Node

public final class Node
extends java.lang.Object

The main class

Author:
Andreas Schjønhaug

Method Summary
 java.lang.Object clone()
          Implementation of the singleton design pattern.
 void forwardMessage(java.net.InetAddress sourceAddress, Message message)
          The method evaluates if the incoming message should be forwarded, and acts accordingly.
 int getAMessageSequenceNumber()
          The method returns the next message sequence number to be used.
 java.util.ArrayList<java.net.InetAddress> getGateways()
          The method gets the gateways attached to the node.
 java.util.ArrayList<Interface> getInterfaces()
          Returns the Interfaces
 int getIpVersion()
          The method gets the IP version used (either 4 or 6).
 java.util.ArrayList<java.net.InetAddress> getMprs()
          The method return the MPRs
static Node getNode()
          Implementation of the singleton design pattern
 java.net.InetAddress getOriginatorAddress()
          The moethod gets the address used as originator address on the node
 Values getWillingness()
          The method return a node's willingness
static void main(java.lang.String[] args)
          The main method.
 void populateDerivedSets()
          The method populates the derived sets, meaning: RelaySet AdvertisedNeighbourSet
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getNode

public static Node getNode()
Implementation of the singleton design pattern

Returns:
the node

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Implementation of the singleton design pattern. This method is used to ensure that the class can not be cloned.

Overrides:
clone in class java.lang.Object
Throws:
java.lang.CloneNotSupportedException

getMprs

public java.util.ArrayList<java.net.InetAddress> getMprs()
The method return the MPRs

Returns:
ArrayList of InetAddresses

getInterfaces

public java.util.ArrayList<Interface> getInterfaces()
Returns the Interfaces

Returns:
an ArrayList of Interfaces

populateDerivedSets

public void populateDerivedSets()
The method populates the derived sets, meaning:


getAMessageSequenceNumber

public int getAMessageSequenceNumber()
The method returns the next message sequence number to be used. It handles wrap around

Returns:
next message sequence number to be used

getWillingness

public Values getWillingness()
The method return a node's willingness

Returns:
the node's willingness

forwardMessage

public void forwardMessage(java.net.InetAddress sourceAddress,
                           Message message)
The method evaluates if the incoming message should be forwarded, and acts accordingly. If the message is accepted for forwarding, it is offered to the outgoing message queue on all interfaces.

Parameters:
sourceAddress - the address of the interface receiving the message
message - the message

getOriginatorAddress

public java.net.InetAddress getOriginatorAddress()
The moethod gets the address used as originator address on the node

Returns:
InetAddress originatorAddress

main

public static void main(java.lang.String[] args)
The main method.

Parameters:
args -

getIpVersion

public int getIpVersion()
The method gets the IP version used (either 4 or 6).

Returns:
int ipVersion

getGateways

public java.util.ArrayList<java.net.InetAddress> getGateways()
The method gets the gateways attached to the node.

Returns:
ArrayList gateways