public class ConfigurationParserJSON extends net.spy.memcached.compat.SpyObject implements ConfigurationParser
ConfigurationParser
takes JSON-based configuration information
and transforms it into a Bucket
.Constructor and Description |
---|
ConfigurationParserJSON() |
Modifier and Type | Method and Description |
---|---|
Bucket |
parseBucket(java.lang.String bucketJson)
Parse a raw bucket config string into a
Bucket configuration. |
java.util.Map<java.lang.String,Bucket> |
parseBuckets(java.lang.String bucketsJson)
Parses the /pools/{pool}/buckets URI for a list of contained buckets.
|
void |
parsePool(Pool pool,
java.lang.String poolsJson)
Parses a given /pools/{pool} JSON for the buckets URI.
|
java.util.Map<java.lang.String,Pool> |
parsePools(java.lang.String poolsJson)
Parses the /pools URI and returns a map of found pools.
|
Bucket |
updateBucket(java.lang.String bucketJson,
Bucket currentBucket)
Parse a raw bucket config and update an old bucket with the new infos.
|
public java.util.Map<java.lang.String,Pool> parsePools(java.lang.String poolsJson) throws java.text.ParseException
parsePools
in interface ConfigurationParser
poolsJson
- the raw JSON of the pools response.java.text.ParseException
- if the JSON could not be parsed properly.ConnectionException
- if a non-recoverable connect error happened.public void parsePool(Pool pool, java.lang.String poolsJson) throws java.text.ParseException
parsePool
in interface ConfigurationParser
pool
- the actual pool object to attach to.poolsJson
- the raw JSON for the pool response.java.text.ParseException
- if the JSON could not be parsed properly.public java.util.Map<java.lang.String,Bucket> parseBuckets(java.lang.String bucketsJson) throws java.text.ParseException
parseBuckets
in interface ConfigurationParser
bucketsJson
- the raw JSON of the buckets response.java.text.ParseException
- if the JSON could not be parsed properly.public Bucket parseBucket(java.lang.String bucketJson) throws java.text.ParseException
Bucket
configuration.parseBucket
in interface ConfigurationParser
bucketJson
- the raw JSON.java.text.ParseException
- if the JSON could not be parsed properly.public Bucket updateBucket(java.lang.String bucketJson, Bucket currentBucket) throws java.text.ParseException
updateBucket
in interface ConfigurationParser
bucketJson
- the new JSON information.currentBucket
- the current bucket to update.java.text.ParseException
- if the JSON could not be parsed properly.Copyright © 2006-2009 Dustin Sallings, 2009-2012 Couchbase, Inc.