se.unlogic.eagledns.zoneproviders.file
Class FileZoneProvider

java.lang.Object
  extended by se.unlogic.eagledns.zoneproviders.file.FileZoneProvider
All Implemented Interfaces:
java.lang.Runnable, ZoneProvider, ZoneProviderUpdatable
Direct Known Subclasses:
PathZoneProvider

public class FileZoneProvider
extends java.lang.Object
implements ZoneProvider, ZoneProviderUpdatable, java.lang.Runnable

This class loads primary zones from zone files in the file system. The zone files have to formated accordingly to RFC 1035 (http://tools.ietf.org/html/rfc1035) and RFC 1034 (http://tools.ietf.org/html/rfc1034).

Author:
Robert "Unlogic" Olofsson, Michael Neale, Red Hat (JBoss division)

Constructor Summary
FileZoneProvider()
           
 
Method Summary
 java.util.Collection<org.xbill.DNS.Zone> getPrimaryZones()
          This method is called each time EagleDNS reloads it's zones.
 java.util.Collection<SecondaryZone> getSecondaryZones()
          This method is called each time EagleDNS reloads it's zones.
 java.lang.String getZoneFileDirectory()
           
 void init(java.lang.String name)
          This method is called after the ZoneProvider has been instantiated by EagleDNS and all properties specified in the config file for this zone provider have been set using their set methods.
 void run()
           
 void setAutoReloadZones(java.lang.String autoReloadZones)
           
 void setChangeListener(ZoneChangeCallback ev)
          This method is automatically called by Eagle DNS when the ZoneProvider has been instantiated, before the init() method is called.
 void setPollingInterval(java.lang.String pollingInterval)
           
 void setZoneFileDirectory(java.lang.String zoneFileDirectory)
           
 void unload()
          This method is called when EagleDNS is shutdown or when the configuration has been updated and the ZoneProvider is no longer present in the configuration file.
 void zoneChecked(SecondaryZone secondaryZone)
          This method is called each time a zone has been downloaded and no changes have been detected (by comparing the serial)
 void zoneUpdated(SecondaryZone secondaryZone)
          This method is called when a change has been detected in a secondary zone previously loaded from this ZoneProvider.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileZoneProvider

public FileZoneProvider()
Method Detail

init

public void init(java.lang.String name)
Description copied from interface: ZoneProvider
This method is called after the ZoneProvider has been instantiated by EagleDNS and all properties specified in the config file for this zone provider have been set using their set methods.

Specified by:
init in interface ZoneProvider

run

public void run()
Specified by:
run in interface java.lang.Runnable

getPrimaryZones

public java.util.Collection<org.xbill.DNS.Zone> getPrimaryZones()
Description copied from interface: ZoneProvider
This method is called each time EagleDNS reloads it's zones. If no zones are found or if an error occurs the the ZoneProvider should return null else it should return all primary zones available from the zone provider.

Specified by:
getPrimaryZones in interface ZoneProvider
Returns:

unload

public void unload()
Description copied from interface: ZoneProvider
This method is called when EagleDNS is shutdown or when the configuration has been updated and the ZoneProvider is no longer present in the configuration file.

Specified by:
unload in interface ZoneProvider

getZoneFileDirectory

public java.lang.String getZoneFileDirectory()

setZoneFileDirectory

public void setZoneFileDirectory(java.lang.String zoneFileDirectory)

getSecondaryZones

public java.util.Collection<SecondaryZone> getSecondaryZones()
Description copied from interface: ZoneProvider
This method is called each time EagleDNS reloads it's zones. If no zones are found or if an error occurs the the ZoneProvider should return null else it should return all secondary zones available from the zone provider. The returned secondary zones may contain a previously saved copy of the zone if the ZoneProvider supports this feature.

Specified by:
getSecondaryZones in interface ZoneProvider
Returns:

zoneUpdated

public void zoneUpdated(SecondaryZone secondaryZone)
Description copied from interface: ZoneProvider
This method is called when a change has been detected in a secondary zone previously loaded from this ZoneProvider. Failed AXFR requests will not trigger this method, although zone expiry will. The main purpose of this method is to enable the ZoneProviders to save the updated zone data which is useful in case EagleDNS is restarted when the primary DNS server of the zone is down.

Specified by:
zoneUpdated in interface ZoneProvider

zoneChecked

public void zoneChecked(SecondaryZone secondaryZone)
Description copied from interface: ZoneProvider
This method is called each time a zone has been downloaded and no changes have been detected (by comparing the serial)

Specified by:
zoneChecked in interface ZoneProvider

setChangeListener

public void setChangeListener(ZoneChangeCallback ev)
Description copied from interface: ZoneProviderUpdatable
This method is automatically called by Eagle DNS when the ZoneProvider has been instantiated, before the init() method is called.

Specified by:
setChangeListener in interface ZoneProviderUpdatable
Parameters:
ev - Callback handle
See Also:
ZoneChangeCallback

setAutoReloadZones

public void setAutoReloadZones(java.lang.String autoReloadZones)

setPollingInterval

public void setPollingInterval(java.lang.String pollingInterval)


Copyright © 2011. All Rights Reserved.