A simple java client for the OSDU data platform.
BYOT: Bring your own token. Great for backend service or business logic that supplements a front-end application.
This client assumes you are obtaining a token yourself (e.g. via your application's login form or otheer mechanism. With this SimpleOsduClient, you simply provide that token. With this simplicity, you are also then responsible for refreshing the token as needed and re-instantiating the client with the new token.
String url = "base_url";
String dataPartition = "dataparition";
String token = "token_string_value_to_access_osdu";
var client = new OsduSimpleClient(url, dataPartition, token);
var service = new OsduService(client);
or
String url = "base_url";
String dataPartition = "dataparition";
String awsRegion = "token_string_value_to_access_osdu";
String cognitoClientId = "cognito_client_id";
String username = "username";
String password = "password";
var client = new OsduAWSClient(url, dataPartition, awsRegion, cognitoClientId, username, password);
var service = new OsduService(client);
Below are just a few usage examples.
JSONObject resp = service.Search.V2.Search(query);
System.out.println(resp.toString(4));
JSONObject signedURL = service.Delivery.V2.GetSignedUrlsFromSrns(["srn", "srn"]);
System.out.println(signedURL.toString(4));