net.jolsrv2.repository.processforward
Class ForwardedSet

java.lang.Object
  extended by net.jolsrv2.repository.processforward.ForwardedSet

public final class ForwardedSet
extends java.lang.Object

The class implements the forwarded set, as specified in OLSRv2.

Author:
Andreas Schjønhaug

Method Summary
 void addTuple(MessageTypes type, java.net.InetAddress address, int sequenceNumber, long time)
          Adds a forwarded tuple to the forwarded tuple set
 java.lang.Object clone()
          Implementation of the singleton design pattern.
 boolean contains(MessageTypes type, java.net.InetAddress address, int sequenceNumber)
          Checks if the forwarded set contains a forwarded tuple with having a certain message type, IP address and sequence number
static ForwardedSet getForwardedSet()
          Implementation of the singleton design pattern
 void purge()
          The method purges the forwarded set, deleting expired entries
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getForwardedSet

public static ForwardedSet getForwardedSet()
Implementation of the singleton design pattern

Returns:
the forwarded set

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

contains

public boolean contains(MessageTypes type,
                        java.net.InetAddress address,
                        int sequenceNumber)
Checks if the forwarded set contains a forwarded tuple with having a certain message type, IP address and sequence number

Parameters:
type - the message type
address - the IP address
sequenceNumber - the sequence number
Returns:
true if a change has been detected

addTuple

public void addTuple(MessageTypes type,
                     java.net.InetAddress address,
                     int sequenceNumber,
                     long time)
Adds a forwarded tuple to the forwarded tuple set

Parameters:
type - the message type
address - the IP address
sequenceNumber - the sequence number
time - the time

purge

public void purge()
The method purges the forwarded set, deleting expired entries