net.jolsrv2.repository.neighbourhood
Class SymmetricNeighbourSet

java.lang.Object
  extended by net.jolsrv2.repository.neighbourhood.SymmetricNeighbourSet

public class SymmetricNeighbourSet
extends java.lang.Object

The class implements the symmetric neighbour set, as specified in OLSRv2.

Author:
Andreas Schjønhaug

Constructor Summary
SymmetricNeighbourSet()
          Constructor
 
Method Summary
 java.lang.Object clone()
          Implementation of the singleton design pattern.
static SymmetricNeighbourSet getSymmetricNeighbourSet()
          Implementation of the singleton design pattern.
 java.util.ArrayList<SymmetricNeighbourTuple> getTuples(CidrAddress from)
          Returns the tuples with a certain local CIDR address
 void populate(CidrAddress receivingCAddress, java.util.ArrayList<CidrAddress> libCAddresses, java.util.ArrayList<CidrAddress> cidrAddresses, java.util.ArrayList<Tlv> tlvs, long validityTime)
          Method populating the symmetric neighbour set, as proposed in the specification
 boolean purge()
          The method purges the symmetric neighbour set, deleting expired entries
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SymmetricNeighbourSet

public SymmetricNeighbourSet()
Constructor

Method Detail

getSymmetricNeighbourSet

public static SymmetricNeighbourSet getSymmetricNeighbourSet()
Implementation of the singleton design pattern.

Returns:
the symmetric neighbour 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

populate

public void populate(CidrAddress receivingCAddress,
                     java.util.ArrayList<CidrAddress> libCAddresses,
                     java.util.ArrayList<CidrAddress> cidrAddresses,
                     java.util.ArrayList<Tlv> tlvs,
                     long validityTime)
Method populating the symmetric neighbour set, as proposed in the specification

Parameters:
receivingCAddress - the receiving CIDR address
libCAddresses - the LIB CIDR address
cidrAddresses - the CIDR addresses
tlvs - the TLVs
validityTime - the validity time

getTuples

public java.util.ArrayList<SymmetricNeighbourTuple> getTuples(CidrAddress from)
Returns the tuples with a certain local CIDR address

Parameters:
from - the local CIDR address
Returns:
an ArrayList containing the symmetric neighbour tuples matching the criterias

purge

public boolean purge()
The method purges the symmetric neighbour set, deleting expired entries

Returns:
true if a change is detected