public class ConfigurationProviderHTTP extends net.spy.memcached.compat.SpyObject implements ConfigurationProvider
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CLIENT_SPEC_VER
The specification version which this client meets.
|
Constructor and Description |
---|
ConfigurationProviderHTTP(java.util.List<java.net.URI> baseList)
Constructs a configuration provider with disabled authentication for the
REST service.
|
ConfigurationProviderHTTP(java.util.List<java.net.URI> baseList,
java.lang.String restUsr,
java.lang.String restPwd)
Constructs a configuration provider with a given credentials for the REST
service.
|
Modifier and Type | Method and Description |
---|---|
void |
finishResubscribe() |
java.lang.String |
getAnonymousAuthBucket()
Retrieves a default bucket name i.e.
|
java.lang.String |
getBucket()
Returns the current bucket name.
|
Bucket |
getBucketConfiguration(java.lang.String bucketname)
Connects to the REST service and retrieves the bucket configuration from
the first pool available.
|
Config |
getLatestConfig(java.lang.String bucketname) |
Reconfigurable |
getReconfigurable()
Returns the current Reconfigurable object.
|
java.util.List<java.net.InetSocketAddress> |
getServerList(java.lang.String bucketname) |
void |
markForResubscribe(java.lang.String bucketName,
Reconfigurable rec) |
void |
shutdown()
Shutdowns a monitor connections to the REST service.
|
void |
subscribe(java.lang.String bucketName,
Reconfigurable rec)
Subscribes for configuration updates.
|
java.lang.String |
toString() |
void |
unsubscribe(java.lang.String vbucketName,
Reconfigurable rec)
Unsubscribe from updates on a given bucket and given reconfigurable.
|
void |
updateBaseListFromConfig(java.util.List<java.net.URI> newList)
Override the old baseList with new values.
|
void |
updateBucket(java.lang.String config)
Updates the current bucket with a new JSON config string
|
void |
updateBucket(java.lang.String bucketname,
Bucket newBucket)
Update the configuration provider with a new bucket.
|
public static final java.lang.String CLIENT_SPEC_VER
public ConfigurationProviderHTTP(java.util.List<java.net.URI> baseList)
baseList
- list of urls to treat as basejava.io.IOException
public ConfigurationProviderHTTP(java.util.List<java.net.URI> baseList, java.lang.String restUsr, java.lang.String restPwd)
baseList
- list of urls to treat as baserestUsr
- usernamerestPwd
- passwordpublic Reconfigurable getReconfigurable()
getReconfigurable
in interface ConfigurationProvider
public java.lang.String getBucket()
getBucket
in interface ConfigurationProvider
public Bucket getBucketConfiguration(java.lang.String bucketname)
getBucketConfiguration
in interface ConfigurationProvider
bucketname
- bucketnamepublic void updateBucket(java.lang.String bucketname, Bucket newBucket)
updateBucket
in interface ConfigurationProvider
bucketname
- the name of the bucket.newBucket
- the new bucket to update.public java.util.List<java.net.InetSocketAddress> getServerList(java.lang.String bucketname)
public void finishResubscribe()
finishResubscribe
in interface ConfigurationProvider
public void markForResubscribe(java.lang.String bucketName, Reconfigurable rec)
markForResubscribe
in interface ConfigurationProvider
public void subscribe(java.lang.String bucketName, Reconfigurable rec)
subscribe
in interface ConfigurationProvider
bucketName
- bucket name to receive configuration forrec
- reconfigurable that will receive updatespublic void unsubscribe(java.lang.String vbucketName, Reconfigurable rec)
unsubscribe
in interface ConfigurationProvider
vbucketName
- bucket namerec
- reconfigurablepublic Config getLatestConfig(java.lang.String bucketname)
public java.lang.String getAnonymousAuthBucket()
ConfigurationProvider
getAnonymousAuthBucket
in interface ConfigurationProvider
public void shutdown()
shutdown
in interface ConfigurationProvider
public java.lang.String toString()
toString
in class java.lang.Object
public void updateBaseListFromConfig(java.util.List<java.net.URI> newList)
updateBaseListFromConfig
in interface ConfigurationProvider
newList
- the new BaseList.public void updateBucket(java.lang.String config)
ConfigurationProvider
updateBucket
in interface ConfigurationProvider
config
- the raw JSON config to transform and store.Copyright © 2006-2009 Dustin Sallings, 2009-2012 Couchbase, Inc.