net.jradius.handler.dhcp
Class AddressPoolImpl

java.lang.Object
  extended by net.jradius.handler.dhcp.AddressPoolImpl
All Implemented Interfaces:
java.lang.Cloneable, AddressPool, net.sf.ehcache.event.CacheEventListener

public class AddressPoolImpl
extends java.lang.Object
implements AddressPool, net.sf.ehcache.event.CacheEventListener


Field Summary
protected  java.net.InetAddress[] dns
           
protected  int fudge
           
protected  java.lang.String leaseFile
           
protected  net.sf.ehcache.Cache leases
           
protected  int leaseTime
           
protected  AddressPoolListener listener
           
protected  java.net.InetAddress netmask
           
protected  java.net.InetAddress network
           
protected  byte next
           
protected  java.net.InetAddress router
           
 
Constructor Summary
AddressPoolImpl()
           
AddressPoolImpl(java.net.InetAddress network, java.net.InetAddress netmask, java.net.InetAddress router, int leaseTime)
           
 
Method Summary
 java.lang.Object clone()
           
 boolean contains(java.net.InetAddress ip)
           
 void dispose()
           
 java.net.InetAddress[] getDns()
           
 java.net.InetAddress getIP(byte[] hwa, java.net.InetAddress requested, boolean forceNew)
           
 java.lang.String getLeaseFile()
           
 net.sf.ehcache.Ehcache getLeases()
           
 int getLeaseTime()
           
 AddressPoolListener getListener()
           
 java.net.InetAddress getNetmask()
           
 java.net.InetAddress getNetwork()
           
 java.net.InetAddress getRouter()
           
 java.net.InetAddress nextIP()
           
 void notifyElementEvicted(net.sf.ehcache.Ehcache cache, net.sf.ehcache.Element e)
           
 void notifyElementExpired(net.sf.ehcache.Ehcache cache, net.sf.ehcache.Element e)
           
 void notifyElementPut(net.sf.ehcache.Ehcache cache, net.sf.ehcache.Element e)
           
 void notifyElementRemoved(net.sf.ehcache.Ehcache cache, net.sf.ehcache.Element e)
           
 void notifyElementUpdated(net.sf.ehcache.Ehcache cache, net.sf.ehcache.Element e)
           
 void notifyRemoveAll(net.sf.ehcache.Ehcache cache)
           
 void setDns(java.net.InetAddress[] dns)
           
 void setFudge(int fudge)
           
 void setLeaseFile(java.lang.String leaseFile)
           
 void setLeases(net.sf.ehcache.Cache leases)
           
 void setLeaseTime(int leaseTime)
           
 void setListener(AddressPoolListener listener)
           
 void setNetmask(java.net.InetAddress netmask)
           
 void setNetwork(java.net.InetAddress network)
           
 void setRouter(java.net.InetAddress router)
           
 void writeLeaseFile()
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

leaseFile

protected java.lang.String leaseFile

network

protected java.net.InetAddress network

netmask

protected java.net.InetAddress netmask

router

protected java.net.InetAddress router

dns

protected java.net.InetAddress[] dns

next

protected byte next

fudge

protected int fudge

leaseTime

protected int leaseTime

listener

protected AddressPoolListener listener

leases

protected net.sf.ehcache.Cache leases
Constructor Detail

AddressPoolImpl

public AddressPoolImpl()

AddressPoolImpl

public AddressPoolImpl(java.net.InetAddress network,
                       java.net.InetAddress netmask,
                       java.net.InetAddress router,
                       int leaseTime)
Method Detail

contains

public boolean contains(java.net.InetAddress ip)

nextIP

public java.net.InetAddress nextIP()
                            throws java.net.UnknownHostException
Throws:
java.net.UnknownHostException

getIP

public java.net.InetAddress getIP(byte[] hwa,
                                  java.net.InetAddress requested,
                                  boolean forceNew)
                           throws java.net.UnknownHostException
Specified by:
getIP in interface AddressPool
Throws:
java.net.UnknownHostException

writeLeaseFile

public void writeLeaseFile()

notifyElementEvicted

public void notifyElementEvicted(net.sf.ehcache.Ehcache cache,
                                 net.sf.ehcache.Element e)
Specified by:
notifyElementEvicted in interface net.sf.ehcache.event.CacheEventListener

notifyElementExpired

public void notifyElementExpired(net.sf.ehcache.Ehcache cache,
                                 net.sf.ehcache.Element e)
Specified by:
notifyElementExpired in interface net.sf.ehcache.event.CacheEventListener

notifyElementPut

public void notifyElementPut(net.sf.ehcache.Ehcache cache,
                             net.sf.ehcache.Element e)
                      throws net.sf.ehcache.CacheException
Specified by:
notifyElementPut in interface net.sf.ehcache.event.CacheEventListener
Throws:
net.sf.ehcache.CacheException

notifyElementRemoved

public void notifyElementRemoved(net.sf.ehcache.Ehcache cache,
                                 net.sf.ehcache.Element e)
                          throws net.sf.ehcache.CacheException
Specified by:
notifyElementRemoved in interface net.sf.ehcache.event.CacheEventListener
Throws:
net.sf.ehcache.CacheException

notifyElementUpdated

public void notifyElementUpdated(net.sf.ehcache.Ehcache cache,
                                 net.sf.ehcache.Element e)
                          throws net.sf.ehcache.CacheException
Specified by:
notifyElementUpdated in interface net.sf.ehcache.event.CacheEventListener
Throws:
net.sf.ehcache.CacheException

notifyRemoveAll

public void notifyRemoveAll(net.sf.ehcache.Ehcache cache)
Specified by:
notifyRemoveAll in interface net.sf.ehcache.event.CacheEventListener

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Specified by:
clone in interface net.sf.ehcache.event.CacheEventListener
Overrides:
clone in class java.lang.Object
Throws:
java.lang.CloneNotSupportedException

dispose

public void dispose()
Specified by:
dispose in interface net.sf.ehcache.event.CacheEventListener

setFudge

public void setFudge(int fudge)

setLeaseFile

public void setLeaseFile(java.lang.String leaseFile)

setLeases

public void setLeases(net.sf.ehcache.Cache leases)

setLeaseTime

public void setLeaseTime(int leaseTime)

setNetmask

public void setNetmask(java.net.InetAddress netmask)

setNetwork

public void setNetwork(java.net.InetAddress network)

setRouter

public void setRouter(java.net.InetAddress router)

getLeaseFile

public java.lang.String getLeaseFile()

getLeases

public net.sf.ehcache.Ehcache getLeases()

getLeaseTime

public int getLeaseTime()
Specified by:
getLeaseTime in interface AddressPool

getNetmask

public java.net.InetAddress getNetmask()
Specified by:
getNetmask in interface AddressPool

getNetwork

public java.net.InetAddress getNetwork()
Specified by:
getNetwork in interface AddressPool

getRouter

public java.net.InetAddress getRouter()
Specified by:
getRouter in interface AddressPool

getDns

public java.net.InetAddress[] getDns()
Specified by:
getDns in interface AddressPool

setDns

public void setDns(java.net.InetAddress[] dns)

getListener

public AddressPoolListener getListener()

setListener

public void setListener(AddressPoolListener listener)


Copyright © 2008 JRadius Project, All Rights Reserved.