@InterfaceStability.Committed
@InterfaceAudience.Public
public interface BucketManager
Provides management capabilities for a Bucket
.
Operations provided on the BucketManager
can be used to perform administrative tasks which require bucket-level credentials like managing DesignDocument
s or flushing a Bucket
. Access to the underlying AsyncBucketManager
is provided through the async()
method.
Modifier and Type | Method and Description |
---|---|
AsyncBucketManager |
async()
Returns the underlying
AsyncBucketManager for asynchronous execution. |
java.lang.Boolean |
flush()
Flushes the bucket (removes all data) with the default management timeout.
|
java.lang.Boolean |
flush(long timeout,
java.util.concurrent.TimeUnit timeUnit)
Flushes the bucket (removes all data) with a custom timeout.
|
DesignDocument |
getDesignDocument(java.lang.String name)
Loads a published
DesignDocument by its name with the default management timeout. |
DesignDocument |
getDesignDocument(java.lang.String name,
boolean development)
Loads a
DesignDocument by its name from either development or production with the default management timeout. |
DesignDocument |
getDesignDocument(java.lang.String name,
boolean development,
long timeout,
java.util.concurrent.TimeUnit timeUnit)
Loads a
DesignDocument s by its name from either development or production with a custom timeout. |
DesignDocument |
getDesignDocument(java.lang.String name,
long timeout,
java.util.concurrent.TimeUnit timeUnit)
Loads a published
DesignDocument by its name with the a custom timeout. |
java.util.List<DesignDocument> |
getDesignDocuments()
Loads all published
DesignDocument s with the default management timeout. |
java.util.List<DesignDocument> |
getDesignDocuments(boolean development)
Loads all
DesignDocument s from either development or production with the default management timeout. |
java.util.List<DesignDocument> |
getDesignDocuments(boolean development,
long timeout,
java.util.concurrent.TimeUnit timeUnit)
Loads all
DesignDocument s from either development or production with a custom timeout. |
java.util.List<DesignDocument> |
getDesignDocuments(long timeout,
java.util.concurrent.TimeUnit timeUnit)
Loads all published
DesignDocument s with a custom timeout. |
BucketInfo |
info()
Returns information about the connected bucket with the default management timeout.
|
BucketInfo |
info(long timeout,
java.util.concurrent.TimeUnit timeUnit)
Returns information about the connected bucket with a custom timeout.
|
DesignDocument |
insertDesignDocument(DesignDocument designDocument)
Inserts a
DesignDocument into production if it does not exist with the default management timeout. |
DesignDocument |
insertDesignDocument(DesignDocument designDocument,
boolean development)
Inserts a
DesignDocument into development or production if it does not exist with the default management timeout. |
DesignDocument |
insertDesignDocument(DesignDocument designDocument,
boolean development,
long timeout,
java.util.concurrent.TimeUnit timeUnit)
Inserts a
DesignDocument into development or production if it does not exist with a custom timeout. |
DesignDocument |
insertDesignDocument(DesignDocument designDocument,
long timeout,
java.util.concurrent.TimeUnit timeUnit)
Inserts a
DesignDocument into production if it does not exist with a custom timeout. |
DesignDocument |
publishDesignDocument(java.lang.String name)
Publishes a
DesignDocument from development into production with the default management timeout. |
DesignDocument |
publishDesignDocument(java.lang.String name,
boolean overwrite)
Publishes a
DesignDocument from development into production with the default management timeout. |
DesignDocument |
publishDesignDocument(java.lang.String name,
boolean overwrite,
long timeout,
java.util.concurrent.TimeUnit timeUnit)
Publishes a
DesignDocument from development into production with a custom timeout. |
DesignDocument |
publishDesignDocument(java.lang.String name,
long timeout,
java.util.concurrent.TimeUnit timeUnit)
Publishes a
DesignDocument from development into production with a custom timeout. |
java.lang.Boolean |
removeDesignDocument(java.lang.String name)
Removes a
DesignDocument from production by its name with the default management timeout. |
java.lang.Boolean |
removeDesignDocument(java.lang.String name,
boolean development)
Removes a
DesignDocument from production or development by its name with the default management timeout. |
java.lang.Boolean |
removeDesignDocument(java.lang.String name,
boolean development,
long timeout,
java.util.concurrent.TimeUnit timeUnit)
Removes a
DesignDocument from production or development by its name with a custom timeout. |
java.lang.Boolean |
removeDesignDocument(java.lang.String name,
long timeout,
java.util.concurrent.TimeUnit timeUnit)
Removes a
DesignDocument from production by its name with a custom timeout. |
DesignDocument |
upsertDesignDocument(DesignDocument designDocument)
Upserts (inserts or replaces) a
DesignDocument into production with the default management timeout. |
DesignDocument |
upsertDesignDocument(DesignDocument designDocument,
boolean development)
Upserts (inserts or replaces) a
DesignDocument into production or development with the default management timeout. |
DesignDocument |
upsertDesignDocument(DesignDocument designDocument,
boolean development,
long timeout,
java.util.concurrent.TimeUnit timeUnit)
Upserts (inserts or replaces) a
DesignDocument into production or development with a custom timeout. |
DesignDocument |
upsertDesignDocument(DesignDocument designDocument,
long timeout,
java.util.concurrent.TimeUnit timeUnit)
Upserts (inserts or replaces) a
DesignDocument into production with a custom timeout. |
AsyncBucketManager async()
Returns the underlying AsyncBucketManager
for asynchronous execution.
BucketInfo info()
Returns information about the connected bucket with the default management timeout.
This method throws:
BucketInfo
.BucketInfo info(long timeout, java.util.concurrent.TimeUnit timeUnit)
Returns information about the connected bucket with a custom timeout.
This method throws:
timeout
- the custom timeout.timeUnit
- the time unit for the custom timeout.BucketInfo
.java.lang.Boolean flush()
Flushes the bucket (removes all data) with the default management timeout.
Note that flushing takes some time on the server to be performed properly, so do not set a too low timeout. Also, flush needs to be enabled on the bucket, otherwise an exception will be raised.
This method throws:
java.lang.Boolean flush(long timeout, java.util.concurrent.TimeUnit timeUnit)
Flushes the bucket (removes all data) with a custom timeout.
Note that flushing takes some time on the server to be performed properly, so do not set a too low timeout. Also, flush needs to be enabled on the bucket, otherwise an exception will be raised.
This method throws:
timeout
- the custom timeout.timeUnit
- the time unit for the custom timeout.java.util.List<DesignDocument> getDesignDocuments()
Loads all published DesignDocument
s with the default management timeout.
This method throws:
DesignDocument
s.java.util.List<DesignDocument> getDesignDocuments(long timeout, java.util.concurrent.TimeUnit timeUnit)
Loads all published DesignDocument
s with a custom timeout.
This method throws:
timeout
- the custom timeout.timeUnit
- the time unit for the custom timeout.DesignDocument
s.java.util.List<DesignDocument> getDesignDocuments(boolean development)
Loads all DesignDocument
s from either development or production with the default management timeout.
This method throws:
development
- if DesignDocument
s should be loaded from development or from production.DesignDocument
s.java.util.List<DesignDocument> getDesignDocuments(boolean development, long timeout, java.util.concurrent.TimeUnit timeUnit)
Loads all DesignDocument
s from either development or production with a custom timeout.
This method throws:
development
- if DesignDocument
s should be loaded from development or from production.timeout
- the custom timeout.timeUnit
- the time unit for the custom timeout.DesignDocument
s.DesignDocument getDesignDocument(java.lang.String name)
Loads a published DesignDocument
by its name with the default management timeout.
If the DesignDocument
is not found, null is returned.
This method throws:
name
- the name of the DesignDocument
.DesignDocument
.DesignDocument getDesignDocument(java.lang.String name, long timeout, java.util.concurrent.TimeUnit timeUnit)
Loads a published DesignDocument
by its name with the a custom timeout.
If the DesignDocument
is not found, null is returned.
This method throws:
name
- the name of the DesignDocument
.timeout
- the custom timeout.timeUnit
- the time unit for the custom timeout.DesignDocument
.DesignDocument getDesignDocument(java.lang.String name, boolean development)
Loads a DesignDocument
by its name from either development or production with the default management timeout.
If the DesignDocument
is not found, null is returned.
This method throws:
name
- the name of the DesignDocument
.development
- if DesignDocument
should be loaded from development or from production.DesignDocument
.DesignDocument getDesignDocument(java.lang.String name, boolean development, long timeout, java.util.concurrent.TimeUnit timeUnit)
Loads a DesignDocument
s by its name from either development or production with a custom timeout.
If the DesignDocument
is not found, null is returned.
This method throws:
name
- the name of the DesignDocument
.development
- if DesignDocument
should be loaded from development or from production.timeout
- the custom timeout.timeUnit
- the time unit for the custom timeout.DesignDocument
.DesignDocument insertDesignDocument(DesignDocument designDocument)
Inserts a DesignDocument
into production if it does not exist with the default management timeout.
Note that inserting a DesignDocument
is not an atomic operation, but instead internally performs a getDesignDocument(String)
operation first. While expected to be very uncommon, a race condition may happen if two users at the same time perform this operation with the same DesignDocument
.
This method throws:
DesignDocument
exists.designDocument
- the DesignDocument
to insert.DesignDocument
on success.DesignDocument insertDesignDocument(DesignDocument designDocument, long timeout, java.util.concurrent.TimeUnit timeUnit)
Inserts a DesignDocument
into production if it does not exist with a custom timeout.
Note that inserting a DesignDocument
is not an atomic operation, but instead internally performs a getDesignDocument(String)
operation first. While expected to be very uncommon, a race condition may happen if two users at the same time perform this operation with the same DesignDocument
.
This method throws:
DesignDocument
exists.designDocument
- the DesignDocument
to insert.timeout
- the custom timeout.timeUnit
- the time unit for the custom timeout.DesignDocument
on success.DesignDocument insertDesignDocument(DesignDocument designDocument, boolean development)
Inserts a DesignDocument
into development or production if it does not exist with the default management timeout.
Note that inserting a DesignDocument
is not an atomic operation, but instead internally performs a getDesignDocument(String)
operation first. While expected to be very uncommon, a race condition may happen if two users at the same time perform this operation with the same DesignDocument
.
This method throws:
DesignDocument
exists.designDocument
- the DesignDocument
to insert.development
- if it should be inserted into development or production (published).DesignDocument
on success.DesignDocument insertDesignDocument(DesignDocument designDocument, boolean development, long timeout, java.util.concurrent.TimeUnit timeUnit)
Inserts a DesignDocument
into development or production if it does not exist with a custom timeout.
Note that inserting a DesignDocument
is not an atomic operation, but instead internally performs a getDesignDocument(String)
operation first. While expected to be very uncommon, a race condition may happen if two users at the same time perform this operation with the same DesignDocument
.
This method throws:
DesignDocument
exists.designDocument
- the DesignDocument
to insert.development
- if it should be inserted into development or production (published).timeout
- the custom timeout.timeUnit
- the time unit for the custom timeout.DesignDocument
on success.DesignDocument upsertDesignDocument(DesignDocument designDocument)
Upserts (inserts or replaces) a DesignDocument
into production with the default management timeout.
This method throws:
designDocument
- the DesignDocument
to upsert.DesignDocument
on success.DesignDocument upsertDesignDocument(DesignDocument designDocument, long timeout, java.util.concurrent.TimeUnit timeUnit)
Upserts (inserts or replaces) a DesignDocument
into production with a custom timeout.
This method throws:
designDocument
- the DesignDocument
to upsert.timeout
- the custom timeout.timeUnit
- the time unit for the custom timeout.DesignDocument
on success.DesignDocument upsertDesignDocument(DesignDocument designDocument, boolean development)
Upserts (inserts or replaces) a DesignDocument
into production or development with the default management timeout.
This method throws:
designDocument
- the DesignDocument
to upsert.development
- if the DesignDocument
should be upserted into development or production.DesignDocument
on success.DesignDocument upsertDesignDocument(DesignDocument designDocument, boolean development, long timeout, java.util.concurrent.TimeUnit timeUnit)
Upserts (inserts or replaces) a DesignDocument
into production or development with a custom timeout.
This method throws:
designDocument
- the DesignDocument
to upsert.development
- if the DesignDocument
should be upserted into development or production.timeout
- the custom timeout.timeUnit
- the time unit for the custom timeout.DesignDocument
on success.java.lang.Boolean removeDesignDocument(java.lang.String name)
Removes a DesignDocument
from production by its name with the default management timeout.
This method throws:
name
- the name of the DesignDocument
.java.lang.Boolean removeDesignDocument(java.lang.String name, long timeout, java.util.concurrent.TimeUnit timeUnit)
Removes a DesignDocument
from production by its name with a custom timeout.
This method throws:
name
- the name of the DesignDocument
.timeout
- the custom timeout.timeUnit
- the time unit for the custom timeout.java.lang.Boolean removeDesignDocument(java.lang.String name, boolean development)
Removes a DesignDocument
from production or development by its name with the default management timeout.
This method throws:
name
- the name of the DesignDocument
.development
- if the DesignDocument
should be removed from development or production.java.lang.Boolean removeDesignDocument(java.lang.String name, boolean development, long timeout, java.util.concurrent.TimeUnit timeUnit)
Removes a DesignDocument
from production or development by its name with a custom timeout.
This method throws:
name
- the name of the DesignDocument
.development
- if the DesignDocument
should be removed from development or production.timeout
- the custom timeout.timeUnit
- the time unit for the custom timeout.DesignDocument publishDesignDocument(java.lang.String name)
Publishes a DesignDocument
from development into production with the default management timeout.
Note that this method does not override a already existing DesignDocument
(see publishDesignDocument(String, boolean)
) as an alternative.
This method throws:
DesignDocument
already exists.name
- the name of the DesignDocument
to publish.DesignDocument
on success.DesignDocument publishDesignDocument(java.lang.String name, long timeout, java.util.concurrent.TimeUnit timeUnit)
Publishes a DesignDocument
from development into production with a custom timeout.
Note that this method does not override a already existing DesignDocument
(see publishDesignDocument(String, boolean)
) as an alternative.
This method throws:
DesignDocument
already exists.name
- the name of the DesignDocument
to publish.timeout
- the custom timeout.timeUnit
- the time unit for the custom timeout.DesignDocument
on success.DesignDocument publishDesignDocument(java.lang.String name, boolean overwrite)
Publishes a DesignDocument
from development into production with the default management timeout.
This method throws:
DesignDocument
already exists and override is set to false.name
- the name of the DesignDocument
to publish.overwrite
- if an existing DesignDocument
should be overridden.DesignDocument
on success.DesignDocument publishDesignDocument(java.lang.String name, boolean overwrite, long timeout, java.util.concurrent.TimeUnit timeUnit)
Publishes a DesignDocument
from development into production with a custom timeout.
This method throws:
DesignDocument
already exists and override is set to false.name
- the name of the DesignDocument
to publish.overwrite
- if an existing DesignDocument
should be overridden.timeout
- the custom timeout.timeUnit
- the time unit for the custom timeout.DesignDocument
on success.