Search in sources :

Example 1 with DescribeDatasetResult

use of com.amazonaws.services.cognitosync.model.DescribeDatasetResult in project amazon-cognito-android by aws.

the class CognitoSyncStorage method getDatasetMetadata.

@Override
public DatasetMetadata getDatasetMetadata(String datasetName) throws DataStorageException {
    DescribeDatasetRequest request = new DescribeDatasetRequest();
    appendUserAgent(request, userAgent);
    request.setIdentityPoolId(identityPoolId);
    DatasetMetadata dataset = null;
    try {
        request.setIdentityId(getIdentityId());
        request.setDatasetName(datasetName);
        DescribeDatasetResult result = client.describeDataset(request);
        dataset = modelToDatasetMetadata(result.getDataset());
    } catch (AmazonClientException ace) {
        throw handleException(ace, "Failed to get metadata of dataset: " + datasetName);
    }
    return dataset;
}
Also used : DescribeDatasetRequest(com.amazonaws.services.cognitosync.model.DescribeDatasetRequest) DatasetMetadata(com.amazonaws.mobileconnectors.cognito.DatasetMetadata) AmazonClientException(com.amazonaws.AmazonClientException) DescribeDatasetResult(com.amazonaws.services.cognitosync.model.DescribeDatasetResult)

Aggregations

AmazonClientException (com.amazonaws.AmazonClientException)1 DatasetMetadata (com.amazonaws.mobileconnectors.cognito.DatasetMetadata)1 DescribeDatasetRequest (com.amazonaws.services.cognitosync.model.DescribeDatasetRequest)1 DescribeDatasetResult (com.amazonaws.services.cognitosync.model.DescribeDatasetResult)1