public abstract class AbstractDhcpStore extends Object implements DhcpStore
DhcpStore.| Constructor and Description |
|---|
AbstractDhcpStore() |
| Modifier and Type | Method and Description |
|---|---|
protected abstract Host |
findDesignatedHost(HardwareAddress hardwareAddress)
Find a host to with the explicitely designated hardware address.
|
protected abstract Lease |
findExistingLease(HardwareAddress hardwareAddress,
Lease existingLease)
Find an existing lease in the store.
|
protected abstract Subnet |
findSubnet(InetAddress clientAddress)
Find the subnet definition matching the given address.
|
Lease |
getExistingLease(HardwareAddress hardwareAddress,
InetAddress requestedAddress,
InetAddress selectionBase,
long requestedLeaseTime,
OptionsField options)
Retrieve an existing lease from the dhcp store.
|
Lease |
getLeaseOffer(HardwareAddress hardwareAddress,
InetAddress requestedAddress,
InetAddress selectionBase,
long requestedLeaseTime,
OptionsField options)
Find a lease to offer in response to a DHCPDISCOVER request.
|
protected abstract OptionsField |
getOptions(DhcpConfigElement element)
Return a list of all options applicable to the given config element.
|
protected abstract Map |
getProperties(DhcpConfigElement element)
Return a list of all options applicable to the given config element.
|
void |
releaseLease(Lease lease)
Release the specified lease.
|
protected abstract void |
updateLease(Lease lease)
Update the (possibly changed) lease in the store.
|
public Lease getLeaseOffer(HardwareAddress hardwareAddress, InetAddress requestedAddress, InetAddress selectionBase, long requestedLeaseTime, OptionsField options) throws DhcpException
DhcpStoreThe lease to offer should be determined by an algorithme like the following:
If the requestedLeaseTime is >= 0, the validity duration of the returned lease must be updated, so that the lease is valid for at least the specified time. The duration may, however, be constrained by a configured maximum lease time.
getLeaseOffer in interface DhcpStorehardwareAddress - hardwareAddress the hardware address of the client requesting
the lease.requestedAddress - the address requested by the client or null if
the client did not request a specific address.selectionBase - the address on which to base the selection of a lease from a
pool, i.e. either the address of the interface on which the
request was received or the address of a DHCP relay agent.requestedLeaseTime - the lease time in milliseconds as requested by the client, or
-1 if the client did not request a specific lease time.options - the supplied DHCP options. Lease selection may be refined by
using those optionsnull if no matching lease was found.DhcpExceptionpublic Lease getExistingLease(HardwareAddress hardwareAddress, InetAddress requestedAddress, InetAddress selectionBase, long requestedLeaseTime, OptionsField options) throws DhcpException
DhcpStoregetExistingLease in interface DhcpStoreDhcpExceptionpublic void releaseLease(Lease lease)
DhcpStorereleaseLease in interface DhcpStoreprotected abstract void updateLease(Lease lease)
lease - protected abstract OptionsField getOptions(DhcpConfigElement element)
element - protected abstract Map getProperties(DhcpConfigElement element)
element - protected abstract Lease findExistingLease(HardwareAddress hardwareAddress, Lease existingLease)
hardwareAddress - existingLease - protected abstract Host findDesignatedHost(HardwareAddress hardwareAddress) throws DhcpException
hardwareAddress - DhcpExceptionprotected abstract Subnet findSubnet(InetAddress clientAddress)
clientAddress - Copyright © 2021. All rights reserved.