java.lang.Object
net.i2p.client.naming.NamingService
net.i2p.client.naming.DummyNamingService
Direct Known Subclasses:
BlockfileNamingService, EepGetNamingService, MetaNamingService

public class DummyNamingServiceextends NamingService
A Dummy naming service that can only handle base64 and b32 destinations.
  • Field Details

    • BASE32_HASH_LENGTH

      protected static final int BASE32_HASH_LENGTH
      Length of a base32 hash string.
      See Also:
    • PROP_B32

      public static final String PROP_B32
      Property to enable b32 lookup.
      See Also:
    • CACHE_MAX_SIZE

      protected static final int CACHE_MAX_SIZE
      Maximum cache size.
    • DEST_SIZE

      public static final int DEST_SIZE
      Standard base64 destination length (no certificate).
      See Also:
    • _cache

      private static final Map<String, Destination> _cache
      The LRU cache, with no expiration time. Classes should take care to call removeCache(String) for any entries that are invalidated.
  • Constructor Details

    • DummyNamingService

      protected DummyNamingService(I2PAppContext context)
      The naming service should only be constructed and accessed through the application context. This constructor should only be used by the appropriate application context itself.
      Parameters:
      context - the application context
  • Method Details

    • lookup

      public Destination lookup(String hostname, Properties lookupOptions, Properties storedOptions)
      Throws, this service knows no destinations.
      Specified by:
      lookup in class NamingService
      Parameters:
      hostname - mixed case as it could be a key
      lookupOptions - input parameter, NamingService-specific, can be null
      storedOptions - output parameter, NamingService-specific, any stored properties will be added if non-null
      Returns:
      dest or null
    • putCache

      protected static void putCache(String s, Destination d)
      Provide basic static caching for all services.
      Parameters:
      s - case-sensitive, could be a hostname or a full b64 string
      d - the destination to cache
    • getCache

      protected static Destination getCache(String s)
      Look up a cached destination.
      Parameters:
      s - case-sensitive, could be a hostname or a full b64 string
      Returns:
      cached dest or null
    • removeCache

      protected static void removeCache(String s)
      Remove a cached destination.
      Parameters:
      s - case-sensitive, could be a hostname or a full b64 string
    • clearCache

      protected static void clearCache()
      Clear all cached destinations. @since 0.8.1.