Class NetPoll

java.lang.Object
org.cip4.jdflib.util.net.NetPoll

public class NetPoll extends Object
class to poll a network address
  • Field Details

    • idleWait

      protected int idleWait
    • busyWait

      protected int busyWait
    • pollThread

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

      protected IPollHandler poller
    • mutex

      protected MyMutex mutex
    • method

      protected String method
    • contentType

      protected String contentType
  • Constructor Details

    • NetPoll

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

      public NetPoll(String url, IPollHandler poller)
      shorthand constructor for single String
      Parameters:
      url - the url to poll - duh!
      poller -
  • Method Details

    • 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(String baseUrl)
      Parameters:
      baseUrl - the url to write to
      Returns:
      the details, null if no connection could be made
    • setMethod

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

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

      public void setContentType(String contentType)
      Parameters:
      contentType - the contentType to set
    • toString

      public String toString()
      Overrides:
      toString in class Object
      Returns:
      See Also:
    • 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 String getUrl(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 Throwable
      make sur we stop all threads prior to dying
      Overrides:
      finalize in class Object
      Throws:
      Throwable
      See Also:
    • getIdleWait

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