@@ -115,16 +115,8 @@ protected void declareDefaults() {
115115 // Add parameters.
116116 declareDefault (Constants .ACCESSKEY , DSString .valueOf ("" )).setReadOnly (true );
117117 declareDefault (Constants .SECRETKEY , DSPasswordAes128 .NULL ).setReadOnly (true ).setHidden (true );
118- declareDefault (Constants .REGION , DSString . valueOf ( "" )).setReadOnly (true );
118+ declareDefault (Constants .REGION , Util . getRegions ( )).setReadOnly (true );
119119 declareDefault (Constants .ENDPOINT , DSString .valueOf ("" )).setReadOnly (true );
120-
121- // Add actions
122- declareDefault (Constants .QUERYDYNAMODB , makeQueryDynamoDBAction ());
123- declareDefault (Constants .SCANDYNAMODB , makeScanDynamoDBAction ());
124- declareDefault (Constants .PUTITEMDYNAMODB , makePutItemDynamoDBAction ());
125- declareDefault (Constants .BATCHPUTITEMSDYNAMODB , makeBatchPutItemDynamoDBAction ());
126- declareDefault (Constants .UPDATEITEMDYNAMODB , makeUpdateItemDynamoDBAction ());
127- declareDefault (Constants .DELETEITEMDYNAMODB , makeDeleteItemDynamoDBAction ());
128120 }
129121
130122 @ Override
@@ -138,6 +130,17 @@ protected void onStarted() {
138130 @ Override
139131 protected void onStable () {
140132 init ();
133+ enableDynamoDBActions ();
134+ }
135+
136+ protected void enableDynamoDBActions () {
137+ // Add actions
138+ put (Constants .QUERYDYNAMODB , makeQueryDynamoDBAction ());
139+ put (Constants .SCANDYNAMODB , makeScanDynamoDBAction ());
140+ put (Constants .PUTITEMDYNAMODB , makePutItemDynamoDBAction ());
141+ put (Constants .BATCHPUTITEMSDYNAMODB , makeBatchPutItemDynamoDBAction ());
142+ put (Constants .UPDATEITEMDYNAMODB , makeUpdateItemDynamoDBAction ());
143+ put (Constants .DELETEITEMDYNAMODB , makeDeleteItemDynamoDBAction ());
141144 }
142145
143146 ///////////////////////////////////////////////////////////////////////////
@@ -180,7 +183,7 @@ public ActionResult invoke(DSInfo info, ActionInvocation invocation) {
180183 };
181184 act .addParameter (Constants .ACCESSKEY , DSString .valueOf (getAccessKey ()), "AWS Access Key" );
182185 act .addParameter (Constants .SECRETKEY , DSString .valueOf (getSecretKey ()), "AWS Secret Key" );
183- act .addParameter (Constants .REGION , DSString . valueOf ( getRegion () ), "Region" );
186+ act .addParameter (Constants .REGION , Util . getRegions ( ), "Region" );
184187 act .addParameter (Constants .ENDPOINT , DSString .valueOf (getEndpoint ()), "End Point" );
185188 return act ;
186189 }
@@ -193,7 +196,8 @@ public ActionResult invoke(DSInfo info, ActionInvocation invocation) {
193196
194197 }
195198 };
196- act .addParameter (Constants .TABLENAME , DSValueType .STRING , "Table Name" );
199+
200+ act .addParameter (Constants .TABLENAME , Util .getTableNames (client ), "Table Name" );
197201 act .addParameter (Constants .PROJECTIONEXPRESSION , DSValueType .STRING , "ProjectionExpression" );
198202 act .addParameter (Constants .KEYCONDITIONEXPRESSION , DSValueType .STRING , "KeyConditionExpression" );
199203 act .addParameter (Constants .FILTEREXPRESSION , DSValueType .STRING , "FilterExpression" );
@@ -223,7 +227,7 @@ public ActionResult invoke(DSInfo info, ActionInvocation invocation) {
223227 return ((DynamoDBNode ) info .get ()).putItem (this ,invocation .getParameters ());
224228 }
225229 };
226- act .addParameter (Constants .TABLENAME , DSValueType . STRING , "Table Name" );
230+ act .addParameter (Constants .TABLENAME , Util . getTableNames ( client ) , "Table Name" );
227231 act .addParameter (Constants .ITEM , DSValueType .STRING , "Item" );
228232 act .addParameter (Constants .CONDITIONEXPRESSION , DSValueType .STRING , "ConditionExpression" );
229233 act .addParameter (Constants .EXPRESSIONATTRIBUTENAMES , DSValueType .STRING , "Expression Attribute Names" );
@@ -240,7 +244,7 @@ public ActionResult invoke(DSInfo info, ActionInvocation invocation) {
240244 return ((DynamoDBNode ) info .get ()).batchPutItem (this ,invocation .getParameters ());
241245 }
242246 };
243- act .addParameter (Constants .TABLENAME , DSValueType . STRING , "Table Name" );
247+ act .addParameter (Constants .TABLENAME , Util . getTableNames ( client ) , "Table Name" );
244248 act .addParameter (Constants .ITEMS , DSValueType .STRING , "Items" );
245249 act .setResultType (ResultType .VALUES );
246250 act .addColumnMetadata (Constants .RESULT , DSValueType .STRING );
@@ -254,7 +258,7 @@ public ActionResult invoke(DSInfo info, ActionInvocation invocation) {
254258 return ((DynamoDBNode ) info .get ()).scanDynamoDB (this ,invocation .getParameters ());
255259 }
256260 };
257- act .addParameter (Constants .TABLENAME , DSValueType . STRING , "Table Name" );
261+ act .addParameter (Constants .TABLENAME , Util . getTableNames ( client ) , "Table Name" );
258262 act .addParameter (Constants .PROJECTIONEXPRESSION , DSValueType .STRING , "ProjectionExpression" );
259263 act .addParameter (Constants .LIMIT , DSInt .valueOf (0 ), "Limit" );
260264 act .addParameter (Constants .FILTEREXPRESSION , DSValueType .STRING , "FilterExpression" );
@@ -282,7 +286,7 @@ public ActionResult invoke(DSInfo info, ActionInvocation invocation) {
282286 return ((DynamoDBNode ) info .get ()).updateItem (this ,invocation .getParameters ());
283287 }
284288 };
285- act .addParameter (Constants .TABLENAME , DSValueType . STRING , "Table Name" );
289+ act .addParameter (Constants .TABLENAME , Util . getTableNames ( client ) , "Table Name" );
286290 act .addParameter (Constants .PRIMARYKEY , DSValueType .STRING , "Primary Key" );
287291 act .addParameter (Constants .UPDATEEXPRESSION , DSValueType .STRING , "UpdateExpression" );
288292 act .addParameter (Constants .CONDITIONEXPRESSION , DSValueType .STRING , "ConditionExpression" );
@@ -301,7 +305,7 @@ public ActionResult invoke(DSInfo info, ActionInvocation invocation) {
301305 }
302306 };
303307 // Add parameters as needed
304- act .addParameter (Constants .TABLENAME , DSValueType . STRING , "Table Name" );
308+ act .addParameter (Constants .TABLENAME , Util . getTableNames ( client ) , "Table Name" );
305309 act .addParameter (Constants .PRIMARYKEY , DSValueType .STRING , "Primary Key" );
306310 act .addParameter (Constants .CONDITIONEXPRESSION , DSValueType .STRING , "ConditionExpression" );
307311 act .addParameter (Constants .EXPRESSIONATTRIBUTENAMES , DSValueType .STRING , "Expression Attribute Names" );
0 commit comments