|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.baidubce.AbstractBceClient
com.baidubce.services.moladb.MolaDbClient
public class MolaDbClient
Represents the MolaDb client to access MolaDb.
Field Summary |
---|
Fields inherited from class com.baidubce.AbstractBceClient |
---|
config, DEFAULT_CONTENT_TYPE, DEFAULT_ENCODING, DEFAULT_SERVICE_DOMAIN, URL_PREFIX |
Constructor Summary | |
---|---|
MolaDbClient(MolaDbClientConfiguration conf)
Constructs a new Moladb client using the client configuration to access Moladb. |
Method Summary | |
---|---|
BatchGetItemResponse |
batchGetItem(BatchGetItemRequest request)
The BatchGetItem operation get items with the given primary keys from Moladb. |
BatchWriteItemResponse |
batchWriteItem(BatchWriteItemRequest request)
The BatchWriteItem operation write items with to Moladb. |
CreateInstanceResponse |
createInstance(CreateInstanceRequest request)
Creates a new instance under same account. |
protected InternalRequest |
createRequest(HttpMethodName httpMethod,
String... pathVariables)
|
protected InternalRequest |
createRequestUnderInstance(HttpMethodName httpMethod,
String... pathVariables)
|
CreateTableResponse |
createTable(CreateTableRequest request)
Create a table in moladb |
DeleteInstanceResponse |
deleteInstance(DeleteInstanceRequest request)
Delete instance from Moladb |
DeleteInstanceResponse |
deleteInstance(String instanceName)
Delete instance from Moladb |
DeleteItemResponse |
deleteItem(DeleteItemRequest request)
The DeleteItem operation delete the item with the given primary key. |
DeleteTableResponse |
deleteTable(DeleteTableRequest request)
Delete a table from moladb |
DeleteTableResponse |
deleteTable(String tableName)
Delete the specified table from moladb |
protected void |
fillInHeadAndBody(AbstractBceRequest request,
InternalRequest httpRequest)
|
String |
getDefaultInstanceName()
Get the default instance name. |
GetInstanceResponse |
getInstance(GetInstanceRequest request)
Get instance detail from Moladb |
GetInstanceResponse |
getInstance(String instanceName)
Get instance detail from Moladb |
GetItemResponse |
getItem(GetItemRequest request)
The GetItem operation returns a set of attributes for the item with the given primary key. |
GetTableResponse |
getTable(GetTableRequest request)
Get the table details from moladb |
GetTableResponse |
getTable(String tableName)
Get the table details from moladb |
ListInstancesResponse |
listInstances()
Get all instance names created by this account |
ListInstancesResponse |
listInstances(ListInstancesRequest request)
Get the instance name list created by this account |
ListTablesResponse |
listTables()
List all table names under the specified instance name from moladb |
ListTablesResponse |
listTables(ListTablesRequest request)
List all table names under the specified instance name from moladb |
PutItemResponse |
putItem(PutItemRequest request)
Creates a new item, or replaces an old item with a new item. |
QueryResponse |
query(QueryRequest request)
The Query operation get items from Moladb with Hash Key and an interval of Range Key |
void |
setDefaultInstanceName(String instanceName)
Set the default instance name. |
UpdateItemResponse |
updateItem(UpdateItemRequest request)
The UpdateItem operation update the item with the given primary key. |
UpdateTableResponse |
updateTable(UpdateTableRequest request)
Update a table in moladb |
Methods inherited from class com.baidubce.AbstractBceClient |
---|
getClient, getEndpoint, getServiceId, invokeHttpClient, isRegionSupported, setClient, shutdown |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MolaDbClient(MolaDbClientConfiguration conf)
conf
- The Moladb client configuration options controlling how this client
connects to Moladb (e.g. proxy settings, retry counts, etc).Method Detail |
---|
public void setDefaultInstanceName(String instanceName)
Set the default instance name. Operation on tables and items will be carried on this instance
instanceName
- Default instance name to be set
public String getDefaultInstanceName()
Get the default instance name.
public CreateInstanceResponse createInstance(CreateInstanceRequest request)
Creates a new instance under same account.
request
- Container for the necessary parameters to
execute the Create instance service method on Moladb.
BceClientException
- If any internal errors are encountered inside the client while
attempting to make the request or handle the responseContent. For example
if a network connection is not available.
BceServiceException
- If an error responseContent is returned by Moladb indicating
either a problem with the data in the request, or a server side issue.public GetInstanceResponse getInstance(String instanceName)
Get instance detail from Moladb
instanceName
- Name of the instance to be got from Moladb.
BceClientException
- If any internal errors are encountered inside the client while
attempting to make the request or handle the responseContent. For example
if a network connection is not available.
BceServiceException
- If an error responseContent is returned by Moladb indicating
either a problem with the data in the request, or a server side issue.public GetInstanceResponse getInstance(GetInstanceRequest request)
Get instance detail from Moladb
request
- Container for the necessary parameters to
execute the Get instance service method on Moladb.
BceClientException
- If any internal errors are encountered inside the client while
attempting to make the request or handle the responseContent. For example
if a network connection is not available.
BceServiceException
- If an error responseContent is returned by Moladb indicating
either a problem with the data in the request, or a server side issue.public DeleteInstanceResponse deleteInstance(DeleteInstanceRequest request)
Delete instance from Moladb
NOTE: There MUST be no table within the instance to be deleted.
request
- Container for the necessary parameters to
execute the Delete instance service method on Moladb.
BceClientException
- If any internal errors are encountered inside the client while
attempting to make the request or handle the responseContent. For example
if a network connection is not available.
BceServiceException
- If an error responseContent is returned by Moladb indicating
either a problem with the data in the request, or a server side issue.public DeleteInstanceResponse deleteInstance(String instanceName)
Delete instance from Moladb
NOTE: There MUST be no table within the instance to be deleted.
instanceName
- the name of instance to be deleted.
BceClientException
- If any internal errors are encountered inside the client while
attempting to make the request or handle the responseContent. For example
if a network connection is not available.
BceServiceException
- If an error responseContent is returned by Moladb indicating
either a problem with the data in the request, or a server side issue.public ListInstancesResponse listInstances()
Get all instance names created by this account
BceClientException
- If any internal errors are encountered inside the client while
attempting to make the request or handle the responseContent. For example
if a network connection is not available.
BceServiceException
- If an error responseContent is returned by Moladb indicating
either a problem with the data in the request, or a server side issue.public ListInstancesResponse listInstances(ListInstancesRequest request)
Get the instance name list created by this account
request
- Container for the necessary parameters to
execute the list instance service method on Moladb.
BceClientException
- If any internal errors are encountered inside the client while
attempting to make the request or handle the responseContent. For example
if a network connection is not available.
BceServiceException
- If an error responseContent is returned by Moladb indicating
either a problem with the data in the request, or a server side issue.public CreateTableResponse createTable(CreateTableRequest request)
Create a table in moladb
request
- Container for the necessary parameters to
execute the create table service method on Moladb.
BceClientException
- If any internal errors are encountered inside the client while
attempting to make the request or handle the responseContent. For example
if a network connection is not available.
BceServiceException
- If an error responseContent is returned by Moladb indicating
either a problem with the data in the request, or a server side issue.public DeleteTableResponse deleteTable(String tableName)
Delete the specified table from moladb
tableName
- Name of the table to be deleted from Moladb.
BceClientException
- If any internal errors are encountered inside the client while
attempting to make the request or handle the responseContent. For example
if a network connection is not available.
BceServiceException
- If an error responseContent is returned by Moladb indicating
either a problem with the data in the request, or a server side issue.public DeleteTableResponse deleteTable(DeleteTableRequest request)
Delete a table from moladb
request
- Container for the necessary parameters to
execute the delete table service method on Moladb.
BceClientException
- If any internal errors are encountered inside the client while
attempting to make the request or handle the responseContent. For example
if a network connection is not available.
BceServiceException
- If an error responseContent is returned by Moladb indicating
either a problem with the data in the request, or a server side issue.public UpdateTableResponse updateTable(UpdateTableRequest request)
Update a table in moladb
request
- Container for the necessary parameters to
execute the update table service method on Moladb.
BceClientException
- If any internal errors are encountered inside the client while
attempting to make the request or handle the responseContent. For example
if a network connection is not available.
BceServiceException
- If an error responseContent is returned by Moladb indicating
either a problem with the data in the request, or a server side issue.public GetTableResponse getTable(String tableName)
Get the table details from moladb
tableName
- Name of table to be get from Moladb.
BceClientException
- If any internal errors are encountered inside the client while
attempting to make the request or handle the responseContent. For example
if a network connection is not available.
BceServiceException
- If an error responseContent is returned by Moladb indicating
either a problem with the data in the request, or a server side issue.public GetTableResponse getTable(GetTableRequest request)
Get the table details from moladb
request
- Container for the necessary parameters to
execute the GetTable service method on Moladb.
BceClientException
- If any internal errors are encountered inside the client while
attempting to make the request or handle the responseContent. For example
if a network connection is not available.
BceServiceException
- If an error responseContent is returned by Moladb indicating
either a problem with the data in the request, or a server side issue.public ListTablesResponse listTables()
List all table names under the specified instance name from moladb
BceClientException
- If any internal errors are encountered inside the client while
attempting to make the request or handle the responseContent. For example
if a network connection is not available.
BceServiceException
- If an error responseContent is returned by Moladb indicating
either a problem with the data in the request, or a server side issue.public ListTablesResponse listTables(ListTablesRequest request)
List all table names under the specified instance name from moladb
request
- Container for the necessary parameters to
execute the ListTables service method on Moladb.
BceClientException
- If any internal errors are encountered inside the client while
attempting to make the request or handle the responseContent. For example
if a network connection is not available.
BceServiceException
- If an error responseContent is returned by Moladb indicating
either a problem with the data in the request, or a server side issue.public PutItemResponse putItem(PutItemRequest request)
Creates a new item, or replaces an old item with a new item. If an item that has the same primary key as the new item already exists in the specified table, the new item completely replaces the existing item. You can perform a conditional put operation (add a new item if one with the specified primary key doesn't exist), or replace an existing item if it has certain attribute values.
When you add an item, the primary key attribute(s) are the only required attributes. Attribute values cannot be null. String and Binary type attributes must have lengths greater than zero. Set type attributes cannot be empty.
request
- Container for the necessary parameters to
execute the PutItem service method on Moladb.
BceClientException
- If any internal errors are encountered inside the client while
attempting to make the request or handle the responseContent. For example
if a network connection is not available.
BceServiceException
- If an error responseContent is returned by Moladb indicating
either a problem with the data in the request, or a server side issue.public GetItemResponse getItem(GetItemRequest request) throws BceClientException, BceServiceException
The GetItem operation returns a set of attributes for the item with the given primary key. If there is no matching item, GetItem does not return any data.
GetItem provides an eventually consistent read by default. If
your application requires a strongly consistent read, set
ConsistentRead to true
. Although a strongly
consistent read might take more time than an eventually consistent
read, it always returns the last updated value.
request
- Container for the necessary parameters to execute the
GetItem request.
BceClientException
- If any internal errors are encountered inside the client while
attempting to make the request or handle the responseContent. For example
if a network connection is not available.
BceServiceException
- If an error responseContent is returned by Moladb indicating
either a problem with the data in the request, or a server side issue.public DeleteItemResponse deleteItem(DeleteItemRequest request) throws BceClientException, BceServiceException
The DeleteItem operation delete the item with the given primary key. If there is no matching item, DeleteItem does not return any data.
request
- Container for the necessary parameters to execute the
DeleteItem request.
BceClientException
- If any internal errors are encountered inside the client while
attempting to make the request or handle the responseContent. For example
if a network connection is not available.
BceServiceException
- If an error responseContent is returned by Moladb indicating
either a problem with the data in the request, or a server side issue.public UpdateItemResponse updateItem(UpdateItemRequest request) throws BceClientException, BceServiceException
The UpdateItem operation update the item with the given primary key. If there is no matching item, UpdateItem does not return any data.
request
- Container for the necessary parameters to execute the
UpdateItem request.
BceClientException
- If any internal errors are encountered inside the client while
attempting to make the request or handle the responseContent. For example
if a network connection is not available.
BceServiceException
- If an error responseContent is returned by Moladb indicating
either a problem with the data in the request, or a server side issue.public BatchGetItemResponse batchGetItem(BatchGetItemRequest request) throws BceClientException, BceServiceException
The BatchGetItem operation get items with the given primary keys from Moladb. If there is no matching item, BatchGetItem does not return any data.
The BatchGetItem can get items from multi tables with corresponding keys. These tables MUST under same instance.
request
- Container for the necessary parameters to execute the
BatchGetItem request.
BceClientException
- If any internal errors are encountered inside the client while
attempting to make the request or handle the responseContent. For example
if a network connection is not available.
BceServiceException
- If an error responseContent is returned by Moladb indicating
either a problem with the data in the request, or a server side issue.public BatchWriteItemResponse batchWriteItem(BatchWriteItemRequest request) throws BceClientException, BceServiceException
The BatchWriteItem operation write items with to Moladb.
The BatchGetItem can write items within multi tables. These tables MUST under same instance.
request
- Container for the necessary parameters to execute the
BatchWriteItem request.
BceClientException
- If any internal errors are encountered inside the client while
attempting to make the request or handle the responseContent. For example
if a network connection is not available.
BceServiceException
- If an error responseContent is returned by Moladb indicating
either a problem with the data in the request, or a server side issue.public QueryResponse query(QueryRequest request) throws BceClientException, BceServiceException
The Query operation get items from Moladb with Hash Key and an interval of Range Key
The Query operation is only support on tables whose Primary key type is HashAndRange Key
request
- Container for the necessary parameters to execute the
Query request.
BceClientException
- If any internal errors are encountered inside the client while
attempting to make the request or handle the responseContent. For example
if a network connection is not available.
BceServiceException
- If an error responseContent is returned by Moladb indicating
either a problem with the data in the request, or a server side issue.protected InternalRequest createRequest(HttpMethodName httpMethod, String... pathVariables)
protected InternalRequest createRequestUnderInstance(HttpMethodName httpMethod, String... pathVariables)
protected void fillInHeadAndBody(AbstractBceRequest request, InternalRequest httpRequest)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |