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 AbstractDhcpStore()
public Lease getLeaseOffer(HardwareAddress hardwareAddress, InetAddress requestedAddress, InetAddress selectionBase, long requestedLeaseTime, OptionsField options) throws DhcpException
DhcpStore
The 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 DhcpStore
hardwareAddress
- 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.DhcpException
public Lease getExistingLease(HardwareAddress hardwareAddress, InetAddress requestedAddress, InetAddress selectionBase, long requestedLeaseTime, OptionsField options) throws DhcpException
DhcpStore
getExistingLease
in interface DhcpStore
DhcpException
public void releaseLease(Lease lease)
DhcpStore
releaseLease
in interface DhcpStore
protected 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
- DhcpException
protected abstract Subnet findSubnet(InetAddress clientAddress)
clientAddress
- Copyright © 2003–2020 The Apache Software Foundation. All rights reserved.