net.jolsrv2.repository.processforward
Class ProcessedSet

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

public final class ProcessedSet
extends java.lang.Object

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

Author:
Andreas Schjønhaug

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

Constructor Detail

ProcessedSet

public ProcessedSet()
Constructor

Method Detail

getProcessedSet

public static ProcessedSet getProcessedSet()
Implementation of the singleton design pattern

Returns:
the processed 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 processed set contains a processed tuple with 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 the processed tuple exists

addTuple

public void addTuple(MessageTypes type,
                     java.net.InetAddress address,
                     int sequenceNumber,
                     long time)
Adds a tuple to the processed 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 processed set, deleting expired entries