Package edu.byu.hbll.box.client
Class BoxUpdatesClient
- java.lang.Object
-
- edu.byu.hbll.box.client.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 Summary
Constructors Constructor Description BoxUpdatesClient(URI uri, Runnable runnable)
Creates a newBoxUpdatesClient
that will communicate with an upstream box found at the given base uri and run the given runnable whenever there are updates detected.BoxUpdatesClient(URI uri, Runnable runnable, ThreadFactory threadFactory)
Creates a newBoxUpdatesClient
that will communicate with an upstream box found at the given base uri and run the given runnable whenever there are updates detected.
-
-
-
Constructor Detail
-
BoxUpdatesClient
public BoxUpdatesClient(URI uri, Runnable runnable)
Creates a newBoxUpdatesClient
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 newBoxUpdatesClient
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 updatesthreadFactory
- the thread factory to use for creating the thread that keeps the connection alive
-
-