diff --git a/examples/README.md b/examples/README.md new file mode 100644 index 00000000..02c5b685 --- /dev/null +++ b/examples/README.md @@ -0,0 +1,42 @@ +# OpenTDF Java SDK Examples + +This directory contains example code demonstrating how to use the OpenTDF Java SDK. + +## Running the Examples + +The examples can be run using the `exec-maven-plugin`. The general format is: + +```bash +mvn -f examples/pom.xml exec:java@ +``` + +Replace `` with the name of the example you want to run. For example, to run the `EncryptExample`, use the following command: + +```bash +mvn -f examples/pom.xml exec:java@EncryptExample +``` + +### Available Examples + +* `CreateAttribute` +* `CreateNamespace` +* `CreateSubjectConditionSet` +* `CreateSubjectMapping` +* `DecryptCollectionExample` +* `DecryptExample` +* `EncryptCollectionExample` +* `EncryptExample` +* `GetDecisions` +* `GetEntitlements` +* `GetManifestInformation` +* `ListAttributes` +* `ListNamespaces` +* `ListSubjectMappings` + +### Example with Arguments + +Some examples, like `GetManifestInformation`, require command-line arguments. You can pass arguments to the examples using the `exec.args` property. For example: + +```bash +mvn -f examples/pom.xml exec:java@GetManifestInformation -Dexec.args="my.ciphertext" +``` diff --git a/examples/pom.xml b/examples/pom.xml index 3bcd1e02..c1f07ac5 100644 --- a/examples/pom.xml +++ b/examples/pom.xml @@ -18,6 +18,7 @@ UTF-8 11 protocol/go/v0.3.0 + false @@ -121,9 +122,92 @@ org.codehaus.mojo exec-maven-plugin 3.0.0 - - io.opentdf.platform.App - + + + CreateAttribute + + io.opentdf.platform.CreateAttribute + + + + CreateNamespace + + io.opentdf.platform.CreateNamespace + + + + CreateSubjectConditionSet + + io.opentdf.platform.CreateSubjectConditionSet + + + + CreateSubjectMapping + + io.opentdf.platform.CreateSubjectMapping + + + + DecryptCollectionExample + + io.opentdf.platform.DecryptCollectionExample + + + + DecryptExample + + io.opentdf.platform.DecryptExample + + + + EncryptCollectionExample + + io.opentdf.platform.EncryptCollectionExample + + + + EncryptExample + + io.opentdf.platform.EncryptExample + + + + GetDecisions + + io.opentdf.platform.GetDecisions + + + + GetEntitlements + + io.opentdf.platform.GetEntitlements + + + + GetManifestInformation + + io.opentdf.platform.GetManifestInformation + + + + ListAttributes + + io.opentdf.platform.ListAttributes + + + + ListNamespaces + + io.opentdf.platform.ListNamespaces + + + + ListSubjectMappings + + io.opentdf.platform.ListSubjectMappings + + +