Class NetPoll


  • public class NetPoll
    extends java.lang.Object
    class to poll a network address
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addURL​(java.lang.String url)  
      protected void finalize()
      make sur we stop all threads prior to dying
      protected int getIdleWait()
      get the idle wait period divided by the # of urls to ping
      protected java.lang.String getUrl​(java.lang.String baseUrl)
      get the URL based on a baseurl
      VString getUrls()
      get the vector of urls
      protected int getUrlSize()  
      boolean isRunning()
      return true if we are running
      protected IPollDetails poll​(java.lang.String baseUrl)  
      void setBusyWait​(int busyWait)  
      void setContentType​(java.lang.String contentType)  
      void setIdleWait​(int idleWait)  
      void setMethod​(java.lang.String method)  
      void start()
      start the poll loop
      void stop()
      stop the poll loop
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • idleWait

        protected int idleWait
      • busyWait

        protected int busyWait
      • pollThread

        protected org.cip4.jdflib.util.net.NetPoll.PollThread pollThread
      • method

        protected java.lang.String method
      • contentType

        protected java.lang.String contentType
    • Constructor Detail

      • NetPoll

        public NetPoll​(VString urls,
                       IPollHandler poller)
        Parameters:
        urls - the urls to poll - duh!
        poller -
      • NetPoll

        public NetPoll​(java.lang.String url,
                       IPollHandler poller)
        shorthand constructor for single String
        Parameters:
        url - the url to poll - duh!
        poller -
    • Method Detail

      • isRunning

        public boolean isRunning()
        return true if we are running
        Returns:
      • start

        public void start()
        start the poll loop
      • stop

        public void stop()
        stop the poll loop
      • getUrlSize

        protected int getUrlSize()
      • poll

        protected IPollDetails poll​(java.lang.String baseUrl)
        Parameters:
        baseUrl - the url to write to
        Returns:
        the details, null if no connection could be made
      • setMethod

        public void setMethod​(java.lang.String method)
        Parameters:
        method - the http transfer method to set (GET / POST)
      • addURL

        public void addURL​(java.lang.String url)
        Parameters:
        url - the additional url to add
      • setContentType

        public void setContentType​(java.lang.String contentType)
        Parameters:
        contentType - the contentType to set
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
        Returns:
        See Also:
        Object.toString()
      • setIdleWait

        public void setIdleWait​(int idleWait)
        Parameters:
        idleWait - the number of wait milliseconds to set
      • setBusyWait

        public void setBusyWait​(int busyWait)
        Parameters:
        busyWait - the busyWait to set
      • getUrl

        protected java.lang.String getUrl​(java.lang.String baseUrl)
        get the URL based on a baseurl
        Parameters:
        baseUrl -
        Returns:
      • getUrls

        public VString getUrls()
        get the vector of urls
        Returns:
      • finalize

        protected void finalize()
                         throws java.lang.Throwable
        make sur we stop all threads prior to dying
        Overrides:
        finalize in class java.lang.Object
        Throws:
        java.lang.Throwable
        See Also:
        Object.finalize()
      • getIdleWait

        protected int getIdleWait()
        get the idle wait period divided by the # of urls to ping
        Returns: