Commit 33cfe28f authored by Matt Wise's avatar Matt Wise
Browse files

Multi-tenant/data split

commit d09639db 
Author: Matt Wise <wsmatth@amazon.com> 
Date: Tue May 04 2021 13:00:04 GMT-0500 (Central Daylight Time) 

    use ssm to get dynamodb table info for dms registration
parent ea6c4612
......@@ -58,7 +58,7 @@
<dependency>
<groupId>org.opengroup.osdu.core.aws</groupId>
<artifactId>os-core-lib-aws</artifactId>
<version>0.3.17</version>
<version>0.9.1-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.opengroup.osdu</groupId>
......
......@@ -22,7 +22,8 @@ import javax.annotation.PostConstruct;
import javax.inject.Inject;
import org.apache.commons.lang3.StringUtils;
import org.opengroup.osdu.core.aws.dynamodb.DynamoDBQueryHelper;
import org.opengroup.osdu.core.aws.dynamodb.DynamoDBQueryHelperV2;
import org.opengroup.osdu.core.aws.dynamodb.IDynamoDBQueryHelperFactory;
import org.opengroup.osdu.core.common.logging.JaxRsDpsLog;
import org.opengroup.osdu.core.common.model.http.AppException;
import org.opengroup.osdu.core.common.model.http.DpsHeaders;
......@@ -41,15 +42,6 @@ public class DatasetDmsServiceMapImpl implements IDatasetDmsServiceMap {
@Value("${DMS_API_BASE}")
private String DMS_API_BASE;
@Value("${aws.dynamodb.table.prefix}")
String tablePrefix;
@Value("${aws.region}")
String dynamoDbRegion;
@Value("${aws.dynamodb.endpoint}")
String dynamoDbEndpoint;
@Inject
DmsRegistrationCache cache;
......@@ -59,12 +51,21 @@ public class DatasetDmsServiceMapImpl implements IDatasetDmsServiceMap {
@Inject
private JaxRsDpsLog logger;
private DynamoDBQueryHelper queryHelper;
@Value("${aws.parameter.prefix}")
private String ssmParameterPrefix;
@Value("${aws.dynamodb.dmsRegistrationTable.ssm.relativePath:/common/dataset/DmsRegistrationTable}")
private String dmsRegistrationTableRelativePath;
private DynamoDBQueryHelperV2 queryHelper;
@Inject
private IDynamoDBQueryHelperFactory queryHelperFactory;
@PostConstruct
public void init() {
queryHelper = new DynamoDBQueryHelper(dynamoDbEndpoint, dynamoDbRegion, tablePrefix);
queryHelper = queryHelperFactory.getQueryHelperUsingSSM(ssmParameterPrefix, dmsRegistrationTableRelativePath);
}
@Override
......
......@@ -40,7 +40,7 @@
<dependency>
<groupId>org.opengroup.osdu.core.aws</groupId>
<artifactId>os-core-lib-aws</artifactId>
<version>0.3.17</version>
<version>0.9.1-SNAPSHOT</version>
</dependency>
<dependency>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment