C# Class Amazon.CognitoSync.SyncManager.Internal.DatasetUtils

A Utility class for all the dataset operations
Exibir arquivo Open project: aws/aws-sdk-net

Public Properties

Property Type Description
DATASET_NAME_PATTERN string
UNKNOWN_IDENTITY_ID string

Public Methods

Method Description
ComputeRecordSize ( Record record ) : long

A helper function to compute record size which equals the sum of the UTF-8 string length of record key and value. 0 if record is null.

GetIdentityId ( CognitoAWSCredentials credentials ) : string

A helper function to get the identity id of the dataset from credentials provider. If the identity id is null, UNKNOWN_IDENTITY_ID will be returned.

TruncateToSeconds ( System.DateTime dateTime ) : System.DateTime

A helper function to truncate a DateTime object to whole seconds.

ValidateDatasetName ( string datasetName ) : string

Validates the dataset name.

ValidateRecordKey ( string key ) : string

Validates the record key. It must be non empty and its length must be no greater than 128. Otherwise {@link IllegalArgumentException} will be thrown.

Method Details

ComputeRecordSize() public static method

A helper function to compute record size which equals the sum of the UTF-8 string length of record key and value. 0 if record is null.
public static ComputeRecordSize ( Record record ) : long
record Record Record.
return long

GetIdentityId() public static method

A helper function to get the identity id of the dataset from credentials provider. If the identity id is null, UNKNOWN_IDENTITY_ID will be returned.
public static GetIdentityId ( CognitoAWSCredentials credentials ) : string
credentials Amazon.CognitoIdentity.CognitoAWSCredentials The Cognito Credentials.
return string

TruncateToSeconds() public static method

A helper function to truncate a DateTime object to whole seconds.
public static TruncateToSeconds ( System.DateTime dateTime ) : System.DateTime
dateTime System.DateTime The DateTime to be truncated.
return System.DateTime

ValidateDatasetName() public static method

Validates the dataset name.
public static ValidateDatasetName ( string datasetName ) : string
datasetName string Dataset name.
return string

ValidateRecordKey() public static method

Validates the record key. It must be non empty and its length must be no greater than 128. Otherwise {@link IllegalArgumentException} will be thrown.
public static ValidateRecordKey ( string key ) : string
key string Key.
return string

Property Details

DATASET_NAME_PATTERN public_oe static_oe property

Valid dataset name pattern
public static string DATASET_NAME_PATTERN
return string

UNKNOWN_IDENTITY_ID public_oe static_oe property

Unknown identity id when the identity id is null
public static string UNKNOWN_IDENTITY_ID
return string