Java SDK operations
There are eight user-defined private functions that are being invoked in the following code. We will see each and every function in detail:
public class AwsSdkDemo {
static AmazonDynamoDBClient client;
public static void main(String[] args) {
try {
initializeCredentials();
String tableName = "Tbl_Book";
if (Tables.doesTableExist(client, tableName)) {
System.out.println("Table " + tableName + " already EXISTS");
}
else {
ArrayList<AttributeDefinition> attributeDefinitions = getTableAttributes();
ArrayList<KeySchemaElement> keySchemaElements = getTableKeySchema();
LocalSecondaryIndex localSecondaryIndex = getLocalSecondaryIndex();
ArrayList<LocalSecondaryIndex> localSecondaryIndexes = newArrayList<LocalSecondaryIndex>();
localSecondaryIndexes.add(localSecondaryIndex);
GlobalSecondaryIndex globalSecondaryIndex = getGlobalSecondaryIndex...