Class ScriptBasedMapping

All Implemented Interfaces:
Configurable, DNSToSwitchMapping

@Public @Evolving public class ScriptBasedMapping extends CachedDNSToSwitchMapping
This class implements the DNSToSwitchMapping interface using a script configured via the CommonConfigurationKeysPublic.NET_TOPOLOGY_SCRIPT_FILE_NAME_KEY option.

It contains a static class RawScriptBasedMapping that performs the work: reading the configuration parameters, executing any defined script, handling errors and such like. The outer class extends CachedDNSToSwitchMapping to cache the delegated queries.

This DNS mapper's CachedDNSToSwitchMapping.isSingleSwitch() predicate returns true if and only if a script is defined.

  • Field Details

  • Constructor Details

    • ScriptBasedMapping

      public ScriptBasedMapping()
      Create an instance with the default configuration.

      Calling setConf(Configuration) will trigger a re-evaluation of the configuration settings and so be used to set up the mapping script.

    • ScriptBasedMapping

      public ScriptBasedMapping(DNSToSwitchMapping rawMap)
      Create an instance from the given raw mapping
      Parameters:
      rawMap - raw DNSTOSwithMapping
    • ScriptBasedMapping

      public ScriptBasedMapping(Configuration conf)
      Create an instance from the given configuration
      Parameters:
      conf - configuration
  • Method Details