i2p.susi.dns

## Class NamingServiceBean

- java.lang.Object
- - i2p.susi.dns.BaseBean
  - - i2p.susi.dns.AddressbookBean
    - - i2p.susi.dns.NamingServiceBean

-     public class NamingServiceBean
      extends AddressbookBean

  Talk to the NamingService API instead of modifying the hosts.txt files directly, except for the 'published' addressbook.

- - ### Field Summary

    - ### Fields inherited from class i2p.susi.dns.AddressbookBean

      `beginIndex, book, category, deletionMarks, destination, endIndex, entries, filter, hostname, search, sorter`

    - ### Fields inherited from class i2p.susi.dns.BaseBean

      `_context, action, lastSerial, method, PROP_PW_ENABLE, properties, serial`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `NamingServiceBean()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `export(Writer out)` Export address book entries to a writer.
    `String` | `getDisplayName()` Returns the display name for the address book.
    `AddressBean[]` | `getEntries()` Returns the address entries.
    `String` | `getFileName()` Returns the file name for the address book.
    `String` | `getLoadBookMessages()` Load addressbook and apply filter, returning messages about this.
    `AddressBean` | `getLookup()` Lookup a single destination by hostname.
    `List<AddressBean>` | `getLookupAll()` Lookup all destinations for a hostname.
    `String` | `getMessages()` Perform actions, returning messages about this.
    `protected int` | `getTotalFilteredCount()` Gets the total count of filtered results for pagination display.
    `boolean` | `haveImagegen()` Check if the imagegen service is available.
    `String` | `importFile(RequestWrapper wrequest)` Import entries from a file upload.
    `boolean` | `isNotEmpty()` Returns whether the address book is not empty.
    `protected boolean` | `isPrefiltered()` Checks if entries are pre-filtered.
    `protected int` | `resultSize()` Gets the size of the lookup result.
    `void` | `saveNotes()` Save notes for a destination.
    `void` | `setH(String h)` Sets the hostname for lookup.
    `void` | `setNofilter_notes(String n)` Sets the notes for the destination.
    `protected int` | `totalSize()` Gets the total size of the address book.

    - ### Methods inherited from class i2p.susi.dns.AddressbookBean

      `generateLoadMessage, getBegin, getBeginInt, getBook, getCategoryFilter, getDestination, getEnd, getEndInt, getFilter, getHostname, getPageBegin, getResultBegin, getResultEnd, getSearch, getTrClass, isHasFilter, isIsEmpty, isValidBook, setBegin, setBook, setDestination, setEnd, setFilter, setHostname, setMarkedForDeletion, setResetDeletionMarks, setSearch, setTrClass`

    - ### Methods inherited from class i2p.susi.dns.BaseBean

      `_t, _t, _t, addressbookDir, configFile, debug, getAction, getSerial, getTheme, getThemeName, getThemes, isOverrideCssActive, loadConfig, ngettext, reload, setAction, setSerial, storeMethod, useSoraFont, warn`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### NamingServiceBean

          public NamingServiceBean()

  - ### Method Detail

    - #### export

          public void export(Writer out)
                      throws IOException

      Export address book entries to a writer.
      Parameters:
        `out` - the writer to export to
      Throws:
        `IOException` - if an I/O error occurs

    - #### getDisplayName

          public String getDisplayName()

      Description copied from class: `AddressbookBean`
      Returns the display name for the address book.
      Overrides:
        `getDisplayName` in class `AddressbookBean`
      Returns:
        the display name

    - #### getEntries

          public AddressBean[] getEntries()

      Description copied from class: `AddressbookBean`
      Returns the address entries.
      Overrides:
        `getEntries` in class `AddressbookBean`
      Returns:
        the address entries

    - #### getFileName

          public String getFileName()

      Description copied from class: `AddressbookBean`
      Returns the file name for the address book.
      Overrides:
        `getFileName` in class `AddressbookBean`
      Returns:
        the file name

    - #### getLoadBookMessages

          public String getLoadBookMessages()

      Load addressbook and apply filter, returning messages about this. To control memory, don't load the whole addressbook if we can help it... only load what is searched for.
      Overrides:
        `getLoadBookMessages` in class `AddressbookBean`
      Returns:
        messages about loading the address book

    - #### getLookup

          public AddressBean getLookup()

      Lookup a single destination by hostname.
      Returns:
        the AddressBean for the destination, or null if not found

    - #### getLookupAll

          public List<AddressBean> getLookupAll()

      Lookup all destinations for a hostname.
      Returns:
        list of AddressBeans for all destinations, or null if not found

    - #### getMessages

          public String getMessages()

      Perform actions, returning messages about this.
      Overrides:
        `getMessages` in class `AddressbookBean`
      Returns:
        messages about the performed actions

    - #### getTotalFilteredCount

          protected int getTotalFilteredCount()

      Gets the total count of filtered results for pagination display. Returns the count BEFORE manual pagination is applied.
      Overrides:
        `getTotalFilteredCount` in class `AddressbookBean`
      Returns:
        the total count of filtered results

    - #### haveImagegen

          public boolean haveImagegen()

      Check if the imagegen service is available.
      Returns:
        true if imagegen is registered

    - #### importFile

          public String importFile(RequestWrapper wrequest)
                            throws IOException

      Import entries from a file upload.
      Parameters:
        `wrequest` - the request wrapper containing the file
      Returns:
        messages about the import operation
      Throws:
        `IOException` - if an I/O error occurs

    - #### isNotEmpty

          public boolean isNotEmpty()

      Description copied from class: `AddressbookBean`
      Returns whether the address book is not empty.
      Overrides:
        `isNotEmpty` in class `AddressbookBean`
      Returns:
        true if the address book is not empty

    - #### isPrefiltered

          protected boolean isPrefiltered()

      Description copied from class: `AddressbookBean`
      Checks if entries are pre-filtered.
      Overrides:
        `isPrefiltered` in class `AddressbookBean`
      Returns:
        true if pre-filtered

    - #### resultSize

          protected int resultSize()

      Description copied from class: `AddressbookBean`
      Gets the size of the lookup result.
      Overrides:
        `resultSize` in class `AddressbookBean`
      Returns:
        the size of the lookup result

    - #### saveNotes

          public void saveNotes()

      Save notes for a destination.

    - #### setH

          public void setH(String h)

      Sets the hostname for lookup.
      Parameters:
        `h` - the hostname to set

    - #### setNofilter_notes

          public void setNofilter_notes(String n)

      Sets the notes for the destination.
      Parameters:
        `n` - the notes to set

    - #### totalSize

          protected int totalSize()

      Description copied from class: `AddressbookBean`
      Gets the total size of the address book.
      Overrides:
        `totalSize` in class `AddressbookBean`
      Returns:
        the total size of the address book