Interface DHT

  • All Known Implementing Classes:
    DHTImpl

    public interface DHT
    • Method Detail

      • put

        void put​(byte[] key,
                 java.lang.String description,
                 byte[] value,
                 short flags,
                 DHTOperationListener listener)
      • put

        void put​(byte[] key,
                 java.lang.String description,
                 byte[] value,
                 short flags,
                 boolean high_priority,
                 DHTOperationListener listener)
        default is HIGH PRIORITY. if you change to low priority then do so consistently as operations can get out of order otherwise
        Parameters:
        key -
        description -
        value -
        flags -
        high_priority -
        listener -
      • put

        void put​(byte[] key,
                 java.lang.String description,
                 byte[] value,
                 short flags,
                 byte life_hours,
                 boolean high_priority,
                 DHTOperationListener listener)
      • put

        void put​(byte[] key,
                 java.lang.String description,
                 byte[] value,
                 short flags,
                 byte life_hours,
                 byte replication_control,
                 boolean high_priority,
                 DHTOperationListener listener)
      • getLocalValue

        DHTTransportValue getLocalValue​(byte[] key)
        Returns value if originated from here for key
        Parameters:
        key -
        Returns:
      • get

        void get​(byte[] key,
                 java.lang.String description,
                 short flags,
                 int max_values,
                 long timeout,
                 boolean exhaustive,
                 boolean high_priority,
                 DHTOperationListener listener)
        Parameters:
        key -
        max_values -
        timeout -
        listener -
      • remove

        byte[] remove​(byte[] key,
                      java.lang.String description,
                      DHTOperationListener listener)
      • isDiversified

        boolean isDiversified​(byte[] key)
      • getIntProperty

        int getIntProperty​(java.lang.String name)
      • getDataBase

        DHTDB getDataBase()
      • exportState

        void exportState​(java.io.DataOutputStream os,
                         int max)
                  throws java.io.IOException
        externalises information that allows the DHT to be recreated at a later date and populated via the import method
        Parameters:
        os -
        max - maximum to export, 0 -> all
        Throws:
        java.io.IOException
      • importState

        void importState​(java.io.DataInputStream is)
                  throws java.io.IOException
        populate the DHT with previously exported state
        Parameters:
        is -
        Throws:
        java.io.IOException
      • integrate

        void integrate​(boolean full_wait)
        Integrate the node into the DHT Can be invoked more than once if additional state is imported
      • setSuspended

        void setSuspended​(boolean susp)
      • destroy

        void destroy()
      • isSleeping

        boolean isSleeping()
      • setLogging

        void setLogging​(boolean on)
      • print

        void print​(boolean full)
      • addListener

        void addListener​(DHTListener listener)
      • removeListener

        void removeListener​(DHTListener listener)