本文整理汇总了Java中com.amazonaws.services.dynamodb.model.ResourceNotFoundException类的典型用法代码示例。如果您正苦于以下问题:Java ResourceNotFoundException类的具体用法?Java ResourceNotFoundException怎么用?Java ResourceNotFoundException使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ResourceNotFoundException类属于com.amazonaws.services.dynamodb.model包,在下文中一共展示了ResourceNotFoundException类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getTableSchema
import com.amazonaws.services.dynamodb.model.ResourceNotFoundException; //导入依赖的package包/类
/**
* Retrieves the table description for the specific resource name
* @param tableName
* @return
*/
private TableDescription getTableSchema(String tableName){
TableDescription tableDescription = null;
try{
DescribeTableRequest describeTableRequest = new DescribeTableRequest().withTableName(tableName);
tableDescription = dynamoDBClient.describeTable(describeTableRequest).getTable();
}
catch(ResourceNotFoundException e){
LOG.error("Error while getting table schema: " + tableName);
return tableDescription;
}
return tableDescription;
}
示例2: checkResource
import com.amazonaws.services.dynamodb.model.ResourceNotFoundException; //导入依赖的package包/类
/**
* Checks if a resource exists or not
* @param tableName Table name to be checked
* @return
*/
public TableDescription checkResource(String tableName){
TableDescription tableDescription = null;
try{
DescribeTableRequest describeTableRequest = new DescribeTableRequest().withTableName(tableName);
tableDescription = dynamoDBClient.describeTable(describeTableRequest).getTable();
}
catch(ResourceNotFoundException e){
tableDescription = null;
}
return tableDescription;
}