Java 类com.amazonaws.mobileconnectors.cognito.CognitoSyncManager 实例源码

项目:react-native-cognito    文件:ReactCognitoModule.java   
@ReactMethod
public void initCredentialsProvider(String identityPoolId, String token, String region)
{
    RegionUtils regionUtils = new RegionUtils();
    Region awsRegion = regionUtils.getRegion(region);

    cognitoCredentialsProvider = new CognitoCachingCredentialsProvider(
        mActivityContext.getApplicationContext(),
        identityPoolId,
        // awsRegion);
        Regions.EU_WEST_1);

    cognitoClient = new CognitoSyncManager(
        mActivityContext.getApplicationContext(),
        // awsRegion,
        Regions.EU_WEST_1,
        cognitoCredentialsProvider);
}
项目:PlatePicks-Android    文件:AWSMobileClient.java   
private AWSMobileClient(final Context context,
                        final String cognitoIdentityPoolID,
                        final Regions cognitoRegion,
                        final String mobileAnalyticsAppID,
                        final IdentityManager identityManager,
                        final ClientConfiguration clientConfiguration) {

    this.context = context;
    this.identityManager = identityManager;
    this.clientConfiguration = clientConfiguration;

    try {
        this.mobileAnalyticsManager =
            MobileAnalyticsManager.
                getOrCreateInstance(context,
                                    AWSConfiguration.AMAZON_MOBILE_ANALYTICS_APP_ID,
                                    AWSConfiguration.AMAZON_MOBILE_ANALYTICS_REGION,
                                    identityManager.getCredentialsProvider(),
                                    new AnalyticsConfig(clientConfiguration));
    }
    catch (final InitializationException ie) {
        Log.e(LOG_TAG, "Unable to initalize Amazon Mobile Analytics. " + ie.getMessage(), ie);
    }

    this.syncManager = new CognitoSyncManager(context, AWSConfiguration.AMAZON_COGNITO_REGION,
        identityManager.getCredentialsProvider(), clientConfiguration);
    this.dynamoDBClient = new AmazonDynamoDBClient(identityManager.getCredentialsProvider(), clientConfiguration);
    this.dynamoDBMapper = new DynamoDBMapper(dynamoDBClient);
}
项目:snake-game-aws    文件:AWSClientManager.java   
public static void init(Context context)
{
       provider = new CognitoCachingCredentialsProvider(context, 
               AWS_ACCOUNT_ID, COGNITO_POOL_ID, COGNTIO_ROLE_UNAUTH,
               COGNITO_ROLE_AUTH, Regions.US_EAST_1);

       //initialize the clients
       cognitosync = new CognitoSyncManager(context, Regions.US_EAST_1, provider);        
    manager = new TransferManager(provider);
    ddb = new AmazonDynamoDBClient(provider);
    //ddbmapper = new DynamoDBMapper(ddb);
    analytics = MobileAnalyticsManager.getOrCreateInstance(context, MOBILE_ANALYTICS_APP_ID, Regions.US_EAST_1, provider);
    kinesis = new KinesisRecorder(context.getDir(KINESIS_DIRECTORY_NAME, 0), Regions.US_EAST_1, provider);
    lambda = new LambdaInvokerFactory(context, Regions.US_WEST_2, provider);
}
项目:snake-game-aws    文件:AWSClientManager.java   
/**
 * Gets the singleton instance of the CognitoClient. init() must be call
 * prior to this.
 * 
 * @return an instance of CognitoClient
 */
public static CognitoSyncManager getCognitoSync() {
    if (cognitosync == null) {
        throw new IllegalStateException("client not initialized yet");
    }
    return cognitosync;
}
项目:aws-mobile-self-paced-labs-samples    文件:AWSClientManager.java   
/**
 * Gets the singleton instance of the CognitoClient. init() must be call
 * prior to this.
 * 
 * @return an instance of CognitoClient
 */
public static CognitoSyncManager getCognitoSync() {
    if (cognitosync == null) {
        throw new IllegalStateException("client not initialized yet");
    }
    return cognitosync;
}
项目:aws-sdk-android-samples    文件:CognitoSyncClientManager.java   
/**
 * Gets the singleton instance of the CognitoClient. init() must be called
 * prior to this.
 * 
 * @return an instance of CognitoClient
 */
public static CognitoSyncManager getInstance() {
    if (syncClient == null) {
        throw new IllegalStateException("CognitoSyncClientManager not initialized yet");
    }
    return syncClient;
}
项目:aws-cognito-sync-issues    文件:AccountManager.java   
/**
 * Hidden default constructor (singleton)
 */
private AccountManager() {

    // Initializing the CredentialsProvider
    credentialsProvider = new CognitoCachingCredentialsProvider (
            context,
            context.getString(R.string.aws_identity_pool), // Identity Pool ID
            Regions.EU_WEST_1 // Put your own region here

    );



    // Initializing the Sync Manager
    syncManager = new CognitoSyncManager(
            context,
            Regions.EU_WEST_1,
            credentialsProvider);

    dataset = syncManager.openOrCreateDataset(DATASET_NAME);

    Log.v(TAG, "Created AccountManager...");

}
项目:PlatePicks-Android    文件:AWSMobileClient.java   
/**
 * Gets the Amazon Cognito Sync Manager, which is responsible for saving and
 * loading user profile data, such as game state or user settings.
 * @return sync manager
 */
public CognitoSyncManager getSyncManager() {
    return syncManager;
}