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.
Stringurl = "base_url";
StringdataPartition = "dataparition";
Stringtoken = "token_string_value_to_access_osdu"; varclient = newOsduSimpleClient(url, dataPartition, token);
varservice = newOsduService(client);or
Stringurl = "base_url";
StringdataPartition = "dataparition";
StringawsRegion = "token_string_value_to_access_osdu"; StringcognitoClientId = "cognito_client_id";
Stringusername = "username";
Stringpassword = "password";
varclient = newOsduAWSClient(url, dataPartition, awsRegion, cognitoClientId, username, password);
varservice = newOsduService(client);Below are just a few usage examples.
JSONObjectresp = service.Search.V2.Search(query); System.out.println(resp.toString(4));JSONObjectsignedURL = service.Delivery.V2.GetSignedUrlsFromSrns(["srn", "srn"]);
System.out.println(signedURL.toString(4));