net.spy.memcached.vbucket
Class BucketMonitor

java.lang.Object
  extended by java.util.Observable
      extended by 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


Field Summary
static String CLIENT_SPEC_VER
          The specification version which this client meets.
 
Constructor Summary
BucketMonitor(URI cometStreamURI, String bucketname, String username, String password, ConfigurationParser configParser)
           
 
Method Summary
protected  void createChannel()
           
 String getHttpPass()
           
 String getHttpUser()
           
protected  void invalidate()
           
protected  org.jboss.netty.handler.codec.http.HttpRequest prepareRequest(URI uri, String h)
           
 void setConfigParser(ConfigurationParser configParser)
           
 void shutdown()
          Shut down the monitor in a graceful way (and release all resources)
 void shutdown(long timeout, TimeUnit unit)
          Shut down this monitor in a graceful way
 void startMonitor()
           
 
Methods inherited from class java.util.Observable
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

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
Constructor Detail

BucketMonitor

public BucketMonitor(URI cometStreamURI,
                     String bucketname,
                     String username,
                     String password,
                     ConfigurationParser configParser)
Parameters:
cometStreamURI - the URI which will stream node changes
bucketname - the bucketToMonitor name we are monitoring
username - the username required for HTTP Basic Auth to the restful service
password - the password required for HTTP Basic Auth to the restful service
Method Detail

startMonitor

public void startMonitor()

createChannel

protected void createChannel()

prepareRequest

protected org.jboss.netty.handler.codec.http.HttpRequest prepareRequest(URI uri,
                                                                        String h)

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)