orca.cod.net
Class IPList

java.lang.Object
  extended by orca.cod.net.IPList
All Implemented Interfaces:
IInitialize

public class IPList
extends java.lang.Object
implements IInitialize

Simple allocator that stores a table of free and used IP addresses This may be used when IP address space is scarce and an entire SubnetBlock cannot be carved. It should be used on a per-site basis as opposed to per-Slice The allocate, release and reserve methods are synchronized because currently multiple slices can pull from and add to this list. In the future a policy for arbitrating sparse public IP address space could fix this, giving each slice its own space instead of sharing the same space.


Field Summary
static java.lang.String PropertyFreeList
           
static java.lang.String PropertyTotal
           
static java.lang.String PropertyUsedList
           
 
Constructor Summary
IPList()
          Instantiate new Vectors for allocation of sparce IPs.
 
Method Summary
 java.net.InetAddress allocate()
          Allocate an IP address.
 void initialize()
          Instantiate new Vectors for allocation of sparce IPs.
 boolean inList(java.net.InetAddress i)
           
 void release(java.net.InetAddress i)
          Release an ip address.
 void reserve(java.net.InetAddress i)
          Indicate that an IP is reserved.
 void reset(java.lang.String s)
           
 java.lang.String save()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PropertyTotal

public static java.lang.String PropertyTotal

PropertyFreeList

public static java.lang.String PropertyFreeList

PropertyUsedList

public static java.lang.String PropertyUsedList
Constructor Detail

IPList

public IPList()
       throws java.lang.Exception
Instantiate new Vectors for allocation of sparce IPs.

Parameters:
total - All possible IP addresses to allocate from
Throws:
java.lang.Exception
Method Detail

initialize

public void initialize()
Instantiate new Vectors for allocation of sparce IPs.

Specified by:
initialize in interface IInitialize
Parameters:
total - All possible IP addresses to allocate from

allocate

public java.net.InetAddress allocate()
                              throws java.lang.Exception
Allocate an IP address.

Returns:
IP address allocated.
Throws:
java.lang.Exception - if no free ip address.

release

public void release(java.net.InetAddress i)
             throws java.lang.Exception
Release an ip address.

Parameters:
IP - to release
Throws:
java.lang.Exception - if not being used

reserve

public void reserve(java.net.InetAddress i)
             throws java.lang.Exception
Indicate that an IP is reserved. For use in recovery.

Parameters:
IP - to be reserved
Throws:
java.lang.Exception

inList

public boolean inList(java.net.InetAddress i)

save

public java.lang.String save()
                      throws java.lang.Exception
Throws:
java.lang.Exception

reset

public void reset(java.lang.String s)
           throws java.lang.Exception
Throws:
java.lang.Exception


Copyright © 2007 Network/Internet Computing Lab. All Rights Reserved.