Skip to content
Snippets Groups Projects
Commit dea9283b authored by Spencer Sutton's avatar Spencer Sutton
Browse files

Legal int test update aws

commit 64df8896 
Author: Spencer Sutton <spencerpsutton@yahoo.com> 
Date: Fri May 07 2021 13:48:53 GMT-0500 (Central Daylight Time) 

    Updating legal doc


commit 64a5bccd 
Author: Spencer Sutton <spencerpsutton@yahoo.com> 
Date: Fri May 07 2021 13:47:45 GMT-0500 (Central Daylight Time) 

    More cleanup


commit 29f09c4b 
Author: Spencer Sutton <spencerpsutton@yahoo.com> 
Date: Fri May 07 2021 13:42:23 GMT-0500 (Central Daylight Time) 

    Some cleanup


commit a663c3f1 
Author: Spencer Sutton <spencerpsutton@yahoo.com> 
Date: Fri May 07 2021 13:41:31 GMT-0500 (Central Daylight Time) 

    Updating legal testing aws pom


commit 0222a310 
Author: Spencer Sutton <spencerpsutton@yahoo.com> 
Date: Fri May 07 2021 13:40:36 GMT-0500 (Central Daylight Time) 

    Merge branch 'dev' of codecommit::us-east-1://default@os-legal into multi-tenant


commit ac28485a 
Author: Spencer Sutton <spencerpsutton@yahoo.com> 
Date: Fri May 07 2021 13:39:44 GMT-0500 (Central Daylight Time) 

    Reverting previous debug change


commit a956a5a1 
Author: Spencer Sutton <spencerpsutton@yahoo.com> 
Date: Fri May 07 2021 13:39:12 GMT-0500 (Central Daylight Time) 

    Fixing int tests


commit 09734341 
Author: Spencer Sutton <spencerpsutton@yahoo.com> 
Date: Fri May 07 2021 10:44:52 GMT-0500 (Central Daylight Time) 

    Temp debugging deployed


commit d958f657 
Author: Spencer Sutton <spencerpsutton@yahoo.com> 
Date: Wed May 05 2021 15:46:13 GMT-0500 (Central Daylight Time) 

    Merged


commit 7fc77652 
Author: Spencer Sutton <spencerpsutton@yahoo.com> 
Date: Wed May 05 2021 15:33:56 GMT-0500 (Central Daylight Time) 

    Removing superfluos code


commit 57a24b40 
Author: Spencer Sutton <spencerpsutton@yahoo.com> 
Date: Wed May 05 2021 13:01:23 GMT-0500 (Central Daylight Time) 

    Consolidating s3 client classes


commit c6f635ba 
Author: Spencer Sutton <spencerpsutton@yahoo.com> 
Date: Wed May 05 2021 12:40:15 GMT-0500 (Central Daylight Time) 

    Cleaning up


commit 5c9e8475 
Author: Spencer Sutton <spencerpsutton@yahoo.com> 
Date: Wed May 05 2021 11:59:24 GMT-0500 (Central Daylight Time) 

    Updating core lib aws version


commit e3e0f9c4 
Author: Spencer Sutton <spencerpsutton@yahoo.com> 
Date: Wed May 05 2021 11:45:09 GMT-0500 (Central Daylight Time) 

    Adjusting  tests for mult-tenancy


commit 7064328e 
Author: Spencer Sutton <spencerpsutton@yahoo.com> 
Date: Wed May 05 2021 10:57:11 GMT-0500 (Central Daylight Time) 

    Deleted accidental key


commit a65471ea 
Author: Spencer Sutton <spencerpsutton@yahoo.com> 
Date: Wed May 05 2021 10:56:30 GMT-0500 (Central Daylight Time) 

    Updating to be multi-tenant
parent 94ed83bb
No related branches found
No related tags found
1 merge request!113Multi-tenancy
......@@ -45,7 +45,7 @@
<dependency>
<groupId>org.opengroup.osdu.core.aws</groupId>
<artifactId>os-core-lib-aws</artifactId>
<version>0.3.16</version>
<version>0.9.0-SNAPSHOT</version>
</dependency>
<!-- AWS managed packages -->
......
......@@ -21,10 +21,10 @@ import java.util.List;
import com.amazonaws.services.s3.AmazonS3;
import org.opengroup.osdu.core.aws.cognito.AWSCognitoClient;
import org.opengroup.osdu.core.aws.dynamodb.DynamoDBQueryHelper;
import org.opengroup.osdu.core.aws.dynamodb.DynamoDBQueryHelperFactory;
import org.opengroup.osdu.core.aws.dynamodb.DynamoDBQueryHelperV2;
import org.opengroup.osdu.core.aws.s3.S3Config;
import org.opengroup.osdu.core.common.model.legal.Properties;
import org.springframework.beans.factory.annotation.Value;
public class AwsLegalTagUtils extends LegalTagUtils {
private static final String FILE_NAME = "Legal_COO.json";
......@@ -77,6 +77,7 @@ public class AwsLegalTagUtils extends LegalTagUtils {
doc.setDescription("Expired integration test tag");
doc.setName(integrationTagTestName);
doc.setId(Integer.toString(integrationTagTestName.hashCode()));
doc.setDataPartitionId(getMyDataPartition());
org.opengroup.osdu.core.common.model.legal.Properties properties = new org.opengroup.osdu.core.common.model.legal.Properties();
List countryOfOrigin = new ArrayList();
......@@ -92,11 +93,8 @@ public class AwsLegalTagUtils extends LegalTagUtils {
properties.setExportClassification("EAR99");
doc.setProperties(properties);
String tablePrefix = String.format("%s%s", System.getenv(TABLE_PREFIX), "-");
String dynamoDbRegion = System.getenv(DYNAMO_DB_REGION);
String dynamoDbEndpoint = System.getenv(DYNAMO_DB_ENDPOINT);
DynamoDBQueryHelper queryHelper = new DynamoDBQueryHelper(dynamoDbEndpoint, dynamoDbRegion, tablePrefix);
DynamoDBQueryHelperFactory dynamoDBQueryHelperFactory = new DynamoDBQueryHelperFactory();
DynamoDBQueryHelperV2 queryHelper = dynamoDBQueryHelperFactory.getQueryHelperForPartition(getMyDataPartition(), "legal/legalTable");
// delete legal tag if it exists
if(queryHelper.keyExistsInTable(LegalDoc.class, doc)){
......@@ -105,4 +103,6 @@ public class AwsLegalTagUtils extends LegalTagUtils {
queryHelper.save(doc);
}
}
......@@ -14,10 +14,7 @@
package org.opengroup.osdu.legal.util;
import com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBAttribute;
import com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBHashKey;
import com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBTable;
import com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBTypeConverted;
import com.amazonaws.services.dynamodbv2.datamodeling.*;
import org.opengroup.osdu.core.common.model.legal.Properties;
......@@ -27,6 +24,9 @@ public class LegalDoc {
@DynamoDBHashKey(attributeName = "Id")
private String id;
@DynamoDBRangeKey(attributeName = "dataPartitionId")
private String dataPartitionId;
@DynamoDBAttribute(attributeName = "Name")
private String name;
......@@ -49,6 +49,14 @@ public class LegalDoc {
this.id = id;
}
public String getDataPartitionId(){
return dataPartitionId;
}
public void setDataPartitionId(String tenant){
this.dataPartitionId = tenant;
}
public void setName(String name) {
this.name = name;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment