Class DNSStateTask

  • All Implemented Interfaces:
    Runnable
    Direct Known Subclasses:
    Announcer, Canceler, Prober, Renewer

    public abstract class DNSStateTask
    extends DNSTask
    This is the root class for all state tasks. These tasks work with objects that implements the DNSStatefulObject interface and therefore participate in the state machine.
    Author:
    Pierre Frisch
    • Constructor Detail

      • DNSStateTask

        public DNSStateTask​(JmDNSImpl jmDNSImpl,
                            int ttl)
        Parameters:
        jmDNSImpl -
        ttl -
    • Method Detail

      • getTaskDescription

        public abstract String getTaskDescription()
      • defaultTTL

        public static int defaultTTL()
      • setDefaultTTL

        public static void setDefaultTTL​(int value)
        For testing only do not use in production.
        Parameters:
        value -
      • getTTL

        public int getTTL()
        Returns:
        the ttl
      • associate

        protected void associate​(DNSState state)
        Associate the DNS host and the service infos with this task if not already associated and in the same state.
        Parameters:
        state - target state
      • removeAssociation

        protected void removeAssociation()
        Remove the DNS host and service info association with this task.
      • checkRunCondition

        protected abstract boolean checkRunCondition()
      • createOugoing

        protected abstract DNSOutgoing createOugoing()
      • recoverTask

        protected abstract void recoverTask​(Throwable e)
      • advanceTask

        protected abstract void advanceTask()
      • getTaskState

        protected DNSState getTaskState()
        Returns:
        the taskState
      • setTaskState

        protected void setTaskState​(DNSState taskState)
        Parameters:
        taskState - the taskState to set