Class DHTImpl

    • Method Detail

      • isSleeping

        public boolean isSleeping()
        Specified by:
        isSleeping in interface DHT
      • setSuspended

        public void setSuspended​(boolean susp)
        Specified by:
        setSuspended in interface DHT
      • getProp

        protected int getProp​(java.lang.String name,
                              int def)
      • getIntProperty

        public int getIntProperty​(java.lang.String name)
        Specified by:
        getIntProperty in interface DHT
      • isDiversified

        public boolean isDiversified​(byte[] key)
        Specified by:
        isDiversified in interface DHT
      • put

        public void put​(byte[] key,
                        java.lang.String description,
                        byte[] value,
                        short flags,
                        DHTOperationListener listener)
        Specified by:
        put in interface DHT
      • put

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

        public void put​(byte[] key,
                        java.lang.String description,
                        byte[] value,
                        short flags,
                        byte life_hours,
                        boolean high_priority,
                        DHTOperationListener listener)
        Specified by:
        put in interface DHT
      • put

        public void put​(byte[] key,
                        java.lang.String description,
                        byte[] value,
                        short flags,
                        byte life_hours,
                        byte replication_control,
                        boolean high_priority,
                        DHTOperationListener listener)
        Specified by:
        put in interface DHT
      • getLocalValue

        public DHTTransportValue getLocalValue​(byte[] key)
        Description copied from interface: DHT
        Returns value if originated from here for key
        Specified by:
        getLocalValue in interface DHT
        Returns:
      • get

        public void get​(byte[] key,
                        java.lang.String description,
                        short flags,
                        int max_values,
                        long timeout,
                        boolean exhaustive,
                        boolean high_priority,
                        DHTOperationListener listener)
        Specified by:
        get in interface DHT
      • remove

        public byte[] remove​(byte[] key,
                             java.lang.String description,
                             DHTOperationListener listener)
        Specified by:
        remove in interface DHT
      • integrate

        public void integrate​(boolean full_wait)
        Description copied from interface: DHT
        Integrate the node into the DHT Can be invoked more than once if additional state is imported
        Specified by:
        integrate in interface DHT
      • destroy

        public void destroy()
        Specified by:
        destroy in interface DHT
      • exportState

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

        public void importState​(java.io.DataInputStream is)
                         throws java.io.IOException
        Description copied from interface: DHT
        populate the DHT with previously exported state
        Specified by:
        importState in interface DHT
        Throws:
        java.io.IOException
      • setLogging

        public void setLogging​(boolean on)
        Specified by:
        setLogging in interface DHT
      • print

        public void print​(boolean full)
        Specified by:
        print in interface DHT