@@ -115,16 +115,8 @@ protected void declareDefaults() {
115
115
// Add parameters.
116
116
declareDefault (Constants .ACCESSKEY , DSString .valueOf ("" )).setReadOnly (true );
117
117
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 );
119
119
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 ());
128
120
}
129
121
130
122
@ Override
@@ -138,6 +130,17 @@ protected void onStarted() {
138
130
@ Override
139
131
protected void onStable () {
140
132
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 ());
141
144
}
142
145
143
146
///////////////////////////////////////////////////////////////////////////
@@ -180,7 +183,7 @@ public ActionResult invoke(DSInfo info, ActionInvocation invocation) {
180
183
};
181
184
act .addParameter (Constants .ACCESSKEY , DSString .valueOf (getAccessKey ()), "AWS Access Key" );
182
185
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" );
184
187
act .addParameter (Constants .ENDPOINT , DSString .valueOf (getEndpoint ()), "End Point" );
185
188
return act ;
186
189
}
@@ -193,7 +196,8 @@ public ActionResult invoke(DSInfo info, ActionInvocation invocation) {
193
196
194
197
}
195
198
};
196
- act .addParameter (Constants .TABLENAME , DSValueType .STRING , "Table Name" );
199
+
200
+ act .addParameter (Constants .TABLENAME , Util .getTableNames (client ), "Table Name" );
197
201
act .addParameter (Constants .PROJECTIONEXPRESSION , DSValueType .STRING , "ProjectionExpression" );
198
202
act .addParameter (Constants .KEYCONDITIONEXPRESSION , DSValueType .STRING , "KeyConditionExpression" );
199
203
act .addParameter (Constants .FILTEREXPRESSION , DSValueType .STRING , "FilterExpression" );
@@ -223,7 +227,7 @@ public ActionResult invoke(DSInfo info, ActionInvocation invocation) {
223
227
return ((DynamoDBNode ) info .get ()).putItem (this ,invocation .getParameters ());
224
228
}
225
229
};
226
- act .addParameter (Constants .TABLENAME , DSValueType . STRING , "Table Name" );
230
+ act .addParameter (Constants .TABLENAME , Util . getTableNames ( client ) , "Table Name" );
227
231
act .addParameter (Constants .ITEM , DSValueType .STRING , "Item" );
228
232
act .addParameter (Constants .CONDITIONEXPRESSION , DSValueType .STRING , "ConditionExpression" );
229
233
act .addParameter (Constants .EXPRESSIONATTRIBUTENAMES , DSValueType .STRING , "Expression Attribute Names" );
@@ -240,7 +244,7 @@ public ActionResult invoke(DSInfo info, ActionInvocation invocation) {
240
244
return ((DynamoDBNode ) info .get ()).batchPutItem (this ,invocation .getParameters ());
241
245
}
242
246
};
243
- act .addParameter (Constants .TABLENAME , DSValueType . STRING , "Table Name" );
247
+ act .addParameter (Constants .TABLENAME , Util . getTableNames ( client ) , "Table Name" );
244
248
act .addParameter (Constants .ITEMS , DSValueType .STRING , "Items" );
245
249
act .setResultType (ResultType .VALUES );
246
250
act .addColumnMetadata (Constants .RESULT , DSValueType .STRING );
@@ -254,7 +258,7 @@ public ActionResult invoke(DSInfo info, ActionInvocation invocation) {
254
258
return ((DynamoDBNode ) info .get ()).scanDynamoDB (this ,invocation .getParameters ());
255
259
}
256
260
};
257
- act .addParameter (Constants .TABLENAME , DSValueType . STRING , "Table Name" );
261
+ act .addParameter (Constants .TABLENAME , Util . getTableNames ( client ) , "Table Name" );
258
262
act .addParameter (Constants .PROJECTIONEXPRESSION , DSValueType .STRING , "ProjectionExpression" );
259
263
act .addParameter (Constants .LIMIT , DSInt .valueOf (0 ), "Limit" );
260
264
act .addParameter (Constants .FILTEREXPRESSION , DSValueType .STRING , "FilterExpression" );
@@ -282,7 +286,7 @@ public ActionResult invoke(DSInfo info, ActionInvocation invocation) {
282
286
return ((DynamoDBNode ) info .get ()).updateItem (this ,invocation .getParameters ());
283
287
}
284
288
};
285
- act .addParameter (Constants .TABLENAME , DSValueType . STRING , "Table Name" );
289
+ act .addParameter (Constants .TABLENAME , Util . getTableNames ( client ) , "Table Name" );
286
290
act .addParameter (Constants .PRIMARYKEY , DSValueType .STRING , "Primary Key" );
287
291
act .addParameter (Constants .UPDATEEXPRESSION , DSValueType .STRING , "UpdateExpression" );
288
292
act .addParameter (Constants .CONDITIONEXPRESSION , DSValueType .STRING , "ConditionExpression" );
@@ -301,7 +305,7 @@ public ActionResult invoke(DSInfo info, ActionInvocation invocation) {
301
305
}
302
306
};
303
307
// Add parameters as needed
304
- act .addParameter (Constants .TABLENAME , DSValueType . STRING , "Table Name" );
308
+ act .addParameter (Constants .TABLENAME , Util . getTableNames ( client ) , "Table Name" );
305
309
act .addParameter (Constants .PRIMARYKEY , DSValueType .STRING , "Primary Key" );
306
310
act .addParameter (Constants .CONDITIONEXPRESSION , DSValueType .STRING , "ConditionExpression" );
307
311
act .addParameter (Constants .EXPRESSIONATTRIBUTENAMES , DSValueType .STRING , "Expression Attribute Names" );
0 commit comments