net.spy.memcached.vbucket
Class BucketMonitor
java.lang.Object
java.util.Observable
net.spy.memcached.vbucket.BucketMonitor
public class BucketMonitor
- extends Observable
The BucketMonitor will open an HTTP comet stream to monitor for
changes to the list of nodes. If the list of nodes changes
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CLIENT_SPEC_VER
public static final String CLIENT_SPEC_VER
- The specification version which this client meets. This will be included
in requests to the server.
- See Also:
- Constant Field Values
BucketMonitor
public BucketMonitor(URI cometStreamURI,
String bucketname,
String username,
String password,
ConfigurationParser configParser)
- Parameters:
cometStreamURI - the URI which will stream node changesbucketname - the bucketToMonitor name we are monitoringusername - the username required for HTTP Basic Auth to the restful servicepassword - the password required for HTTP Basic Auth to the restful service
startMonitor
public void startMonitor()
createChannel
protected void createChannel()
prepareRequest
protected org.jboss.netty.handler.codec.http.HttpRequest prepareRequest(URI uri,
String host)
getHttpUser
public String getHttpUser()
- Returns:
- the httpUser
getHttpPass
public String getHttpPass()
- Returns:
- the httpPass
shutdown
public void shutdown()
- Shut down the monitor in a graceful way (and release all resources)
shutdown
public void shutdown(long timeout,
TimeUnit unit)
- Shut down this monitor in a graceful way
- Parameters:
timeout - unit -
invalidate
protected void invalidate()
setConfigParser
public void setConfigParser(ConfigurationParser configParser)