Class BoxUpdatesClient


  • public class BoxUpdatesClient
    extends Object
    Listens for updates inside a Box and runs the given runnable when there is one. Note that Box only sends out update signals at most once per second.
    Author:
    Charles Draper
    • Constructor Detail

      • BoxUpdatesClient

        public BoxUpdatesClient​(URI uri,
                                Runnable runnable)
        Creates a new BoxUpdatesClient that will communicate with an upstream box found at the given base uri and run the given runnable whenever there are updates detected.
        Parameters:
        uri - the base uri of the box source (eg, http://localhost:8080/app/box)
        runnable - the runnable to run when there are updates
      • BoxUpdatesClient

        public BoxUpdatesClient​(URI uri,
                                Runnable runnable,
                                ThreadFactory threadFactory)
        Creates a new BoxUpdatesClient that will communicate with an upstream box found at the given base uri and run the given runnable whenever there are updates detected.
        Parameters:
        uri - the base uri of the box source (eg, http://localhost:8080/app/box)
        runnable - the runnable to run when there are updates
        threadFactory - the thread factory to use for creating the thread that keeps the connection alive