public static AmazonDynamoDB getClient ( ) { if ( ddbClient != null ) { return ddbClient ; } if ( Config . IN_PRODUCTION ) { ddbClient = AmazonDynamoDBClientBuilder . standard ( ) . build ( ) ; } else { ddbClient = AmazonDynamoDBClientBuilder . standard ( ) . withCredentials ( new AWSStaticCredentialsProvider ( new BasicAWSCredentials ( "local" , "null" ) ) ) . withEndpointConfiguration ( new EndpointConfiguration ( LOCAL_ENDPOINT , "" ) ) . build ( ) ; } if ( ! existsTable ( Config . getRootAppIdentifier ( ) ) ) { createTable ( Config . getRootAppIdentifier ( ) ) ; } ddb = new DynamoDB ( ddbClient ) ; Para . addDestroyListener ( new DestroyListener ( ) { public void onDestroy ( ) { shutdownClient ( ) ; } } ) ; return ddbClient ; }
Returns a client instance for AWS DynamoDB .