net.handle.hdllib
Class Configuration

java.lang.Object
  extended by net.handle.hdllib.Configuration

public class Configuration
extends java.lang.Object


Field Summary
static int RM_GLOBAL
           
static int RM_WITH_CACHE
           
 
Method Summary
 void addRootInfoListener(RootInfoListener listener)
           
static Configuration defaultConfiguration()
          Get the current default configuration.
 SiteInfo[] getCacheSites()
           
 java.io.File getConfigDir()
           
 NamespaceInfo getGlobalNamespace()
           
 SiteInfo[] getGlobalSites()
           
 HandleValue[] getGlobalValues()
           
 java.util.Map getLocalAddressMap()
          Gets the mapping of addresses to local addresses
 SiteInfo[] getLocalSites(byte[] na)
           
 SiteInfo[] getLocalSites(java.lang.String na)
           
 int getResolutionMethod()
           
 java.net.InetAddress mapLocalAddress(java.net.InetAddress addr)
          If the given address appears in the local address map return the address to which it is mapped.
 void notifyRootInfoOutdated()
           
 void refreshRootInfoFromNet()
           
 void removeRootInfoListener(RootInfoListener listener)
           
 void saveGlobalValues()
          save the default global values in the users' config directory
 void saveLocalAddressMap()
          Saves the local address map to the appropriate configuration file
 void setCacheSites(SiteInfo[] cacheSites)
           
 void setConfigDir(java.io.File newConfigDir)
           
 void setGlobalSites(SiteInfo[] globalSites)
           
 void setGlobalValues(HandleValue[] globalValues)
           
 void setGlobalValuesFile(java.io.File newGlobalValuesFile)
           
 void setLocalAddressMap(java.util.Map localAddrMap)
          Sets a map that converts IP addresses to alternate addresses.
 void setLocalSites(byte[] na, SiteInfo[] sites)
           
 void setLocalSites(java.lang.String na, SiteInfo[] sites)
           
 void setResolutionMethod(int resolutionMethod)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RM_GLOBAL

public static final int RM_GLOBAL
See Also:
Constant Field Values

RM_WITH_CACHE

public static final int RM_WITH_CACHE
See Also:
Constant Field Values
Method Detail

defaultConfiguration

public static final Configuration defaultConfiguration()
Get the current default configuration.


setLocalSites

public void setLocalSites(java.lang.String na,
                          SiteInfo[] sites)

setLocalSites

public void setLocalSites(byte[] na,
                          SiteInfo[] sites)

setLocalAddressMap

public void setLocalAddressMap(java.util.Map localAddrMap)
Sets a map that converts IP addresses to alternate addresses. This is used to map IP addresses that are viewable outside of firewalls to IP addresses that are accessibile from inside a firewall. This wouldn't be necessary if every NAT firewall/router weren't completely stupid. The localAddrMap parameter should map InetAddress objects or their String representation.


saveLocalAddressMap

public void saveLocalAddressMap()
                         throws java.io.IOException
Saves the local address map to the appropriate configuration file

Throws:
java.io.IOException

getLocalAddressMap

public java.util.Map getLocalAddressMap()
Gets the mapping of addresses to local addresses


mapLocalAddress

public java.net.InetAddress mapLocalAddress(java.net.InetAddress addr)
If the given address appears in the local address map return the address to which it is mapped. Otherwise, return the given parameter.


getLocalSites

public SiteInfo[] getLocalSites(java.lang.String na)

getLocalSites

public SiteInfo[] getLocalSites(byte[] na)

setGlobalValues

public void setGlobalValues(HandleValue[] globalValues)

setGlobalValuesFile

public void setGlobalValuesFile(java.io.File newGlobalValuesFile)

saveGlobalValues

public void saveGlobalValues()
save the default global values in the users' config directory


setConfigDir

public void setConfigDir(java.io.File newConfigDir)

getConfigDir

public java.io.File getConfigDir()

getGlobalValues

public HandleValue[] getGlobalValues()

getGlobalNamespace

public NamespaceInfo getGlobalNamespace()

setGlobalSites

public void setGlobalSites(SiteInfo[] globalSites)

getGlobalSites

public SiteInfo[] getGlobalSites()

setCacheSites

public void setCacheSites(SiteInfo[] cacheSites)

getCacheSites

public SiteInfo[] getCacheSites()

getResolutionMethod

public int getResolutionMethod()

setResolutionMethod

public void setResolutionMethod(int resolutionMethod)

addRootInfoListener

public void addRootInfoListener(RootInfoListener listener)

removeRootInfoListener

public void removeRootInfoListener(RootInfoListener listener)

notifyRootInfoOutdated

public void notifyRootInfoOutdated()

refreshRootInfoFromNet

public void refreshRootInfoFromNet()
                            throws HandleException
Throws:
HandleException