Skip to content

Commit 1889e31

Browse files
feat(Examples): Finish workshop example (#216)
1 parent 80a3ac0 commit 1889e31

File tree

5 files changed

+961
-81
lines changed

5 files changed

+961
-81
lines changed

Examples/runtimes/java/DynamoDbEncryption/src/main/java/software/amazon/cryptography/examples/searchableencryption/complexexample/BeaconConfig.java

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,15 @@
3333
public class BeaconConfig {
3434

3535
/*
36+
* This file is used in an example to demonstrate complex queries
37+
* you can perform using beacons.
38+
* The example data used is for demonstrative purposes only,
39+
* and might not meet the distribution and correlation uniqueness
40+
* recommendations for beacons.
41+
* See our documentation for whether beacons are
42+
* right for your particular data set:
43+
* https://docs.aws.amazon.com/database-encryption-sdk/latest/devguide/searchable-encryption.html#are-beacons-right-for-me
44+
*
3645
* This file sets up all the searchable encryption configuration required to execute the examples from
3746
* our workshop using the encryption client.
3847
*/
@@ -503,16 +512,16 @@ public static DynamoDbClient SetupBeaconConfig(String ddbTableName, String branc
503512
// and add constructors with general conditions at the end of the list. This would allow a given
504513
// item would trigger the constructor most specific to its attributes.
505514
List<Constructor> pk0ConstructorList = new ArrayList<>();
515+
pk0ConstructorList.add(employeeIdConstructor);
506516
pk0ConstructorList.add(buildingConstructor);
507517
pk0ConstructorList.add(ticketNumberConstructor);
508518
pk0ConstructorList.add(projectNameConstructor);
509-
pk0ConstructorList.add(employeeIdConstructor);
510519

511520
List<Constructor> sk0ConstructorList = new ArrayList<>();
512521
sk0ConstructorList.add(ticketModTimeConstructor);
513522
sk0ConstructorList.add(meetingStartFloorRoomConstructor);
514-
sk0ConstructorList.add(projectNameConstructor);
515523
sk0ConstructorList.add(timeCardStartEmployeeEmailConstructor);
524+
sk0ConstructorList.add(projectNameConstructor);
516525
sk0ConstructorList.add(employeeIdConstructor);
517526

518527
List<Constructor> pk1ConstructorList = new ArrayList<>();

Examples/runtimes/java/DynamoDbEncryption/src/main/java/software/amazon/cryptography/examples/searchableencryption/complexexample/ComplexSearchableEncryptionExample.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,16 @@
44

55
public class ComplexSearchableEncryptionExample {
66

7+
/*
8+
* This file is used in an example to demonstrate complex queries
9+
* you can perform using beacons.
10+
* The example data used is for demonstrative purposes only,
11+
* and might not meet the distribution and correlation uniqueness
12+
* recommendations for beacons.
13+
* See our documentation for whether beacons are
14+
* right for your particular data set:
15+
* https://docs.aws.amazon.com/database-encryption-sdk/latest/devguide/searchable-encryption.html#are-beacons-right-for-me
16+
*/
717
public static void runExample(String ddbTableName, String branchKeyId, String branchKeyWrappingKmsKeyArn, String branchKeyDdbTableName) {
818
DynamoDbClient ddb = BeaconConfig.SetupBeaconConfig(ddbTableName, branchKeyId, branchKeyWrappingKmsKeyArn, branchKeyDdbTableName);
919
PutRequests.putAllItemsToTable(ddbTableName, ddb);

0 commit comments

Comments
 (0)