diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 3f52a995952c508611662f536ba2c52ad873a8d3..20dbe077639a019c4131d3ad38dd76b1ac66f028 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -29,6 +29,6 @@ publish artifacts on central: - echo "${GPG_KEY_SECRET}" | gpg --batch --import - gpg --list-keys script: - - mvn -P release clean deploy --settings .ci-maven-settings.xml -B -U + - mvn -e -X -P release clean deploy --settings .ci-maven-settings.xml -B -U only: - /^genesys\-client\-api\-/ diff --git a/CHANGELOG.md b/CHANGELOG.md index ce9857de51beaea848ff1658fd925aeddb2811c0..201782472b7991cac93f30df308a775ae0405a7e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,8 +1,18 @@ # Genesys Client API changelog +## Release 1.3 + +November 2018. + +Minor updates to the Genesys client library: + +- 96dc203 Retry on Gateway timeout response +- 39f2a0a Support blank OAuth client secret +- 2d6c53c Support for Password grant (username+password combo) + ## Release 1.2 October 2017 - - 4aeb301 Logging - - 4c12425 Upgraded to scribe-java:4.2.0 +- 4aeb301 Logging +- 4c12425 Upgraded to scribe-java:4.2.0 diff --git a/README.md b/README.md index 7a1f2b038a7ac97999310458f16221c1656f572c..f930ea827111e3caaca34011c94e0c4d2986526e 100644 --- a/README.md +++ b/README.md @@ -92,7 +92,7 @@ try { org.genesys-pgr genesys-client-api - 1.2 + 1.3 ``` @@ -102,7 +102,7 @@ Or for the development version: org.genesys-pgr genesys-client-api - 1.3-SNAPSHOT + 1.4-SNAPSHOT ``` diff --git a/pom.xml b/pom.xml index b730d416772de88d63e42d19a0635cd6e8592d7c..2024b7bbd8a3b132f93f0474a6056343fc265b04 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ 4.0.0 org.genesys-pgr genesys-client-api - 1.3-SNAPSHOT + 1.3 Genesys API client library jar https://bitbucket.org/genesys2/genesys-client-api @@ -20,7 +20,7 @@ https://bitbucket.org/genesys2/genesys-client-api.git scm:git:git@bitbucket.org:genesys2/genesys-client-api.git git@bitbucket.org:genesys2/genesys-client-api.git - HEAD + genesys-client-api-1.3 diff --git a/src/main/java/org/genesys2/client/oauth/GenesysClient.java b/src/main/java/org/genesys2/client/oauth/GenesysClient.java index b9c7d458922953ee6da24f7eae48f4bd45f16599..d45fd2be79e455101f663b872aaa83e7d89d77c5 100644 --- a/src/main/java/org/genesys2/client/oauth/GenesysClient.java +++ b/src/main/java/org/genesys2/client/oauth/GenesysClient.java @@ -89,6 +89,12 @@ public class GenesysClient { /** * Instantiates a new genesys client. + * + * @param baseUrl the base url + * @param clientId the client id + * @param clientSecret the client secret + * @param callbackUrl the callback url + * @param scope the scope */ public GenesysClient(final String baseUrl, final String clientId, final String clientSecret, final String callbackUrl, String scope) { this.baseUrl = baseUrl; @@ -103,6 +109,7 @@ public class GenesysClient { * Load client configuration from {@link Properties}. * * @param properties the properties + * @return the genesys client */ public static GenesysClient build(final Properties properties) { @@ -117,6 +124,11 @@ public class GenesysClient { properties.getProperty("client.scope")); } + /** + * Gets the authorization url. + * + * @return the authorization url + */ public String getAuthorizationUrl() { return service.getAuthorizationUrl(); } @@ -144,9 +156,9 @@ public class GenesysClient { * * @param url the url * @return the string - * @throws OAuthAuthenticationException the o auth authentication exception - * @throws PleaseRetryException the please retry exception - * @throws GenesysApiException the genesys api exception + * @throws OAuthAuthenticationException authentication exception + * @throws PleaseRetryException exception indicating the call shold be re-attempted + * @throws GenesysApiException the Genesys API exception */ public String query(final String url) throws OAuthAuthenticationException, PleaseRetryException, GenesysApiException { return query(Verb.GET, url, null, null); @@ -158,9 +170,9 @@ public class GenesysClient { * @param method the HTTP method * @param url the url * @return the string - * @throws OAuthAuthenticationException the o auth authentication exception - * @throws PleaseRetryException the please retry exception - * @throws GenesysApiException the genesys api exception + * @throws OAuthAuthenticationException authentication exception + * @throws PleaseRetryException exception indicating the call shold be re-attempted + * @throws GenesysApiException the Genesys API exception */ public String query(final Verb method, final String url) throws OAuthAuthenticationException, PleaseRetryException, GenesysApiException { return query(method, url, null, null); @@ -174,10 +186,10 @@ public class GenesysClient { * @param queryString the query string * @param postBody the post body * @return the string - * @throws OAuthAuthenticationException the o auth authentication exception - * @throws PleaseRetryException the please retry exception + * @throws OAuthAuthenticationException authentication exception + * @throws PleaseRetryException exception indicating the call shold be re-attempted * @throws HttpRedirectException the http redirect exception - * @throws GenesysApiException the genesys api exception + * @throws GenesysApiException the Genesys API exception */ public String query(final Verb method, final String url, final Map queryString, final String postBody) throws OAuthAuthenticationException, PleaseRetryException, HttpRedirectException, GenesysApiException { @@ -298,7 +310,7 @@ public class GenesysClient { /** * Refresh accessToken with refreshToken. * - * @throws GenesysApiException the genesys api exception + * @throws GenesysApiException the Genesys API exception */ public void refreshAccessToken() throws GenesysApiException { if (tokens.hasRefreshToken()) { @@ -324,7 +336,7 @@ public class GenesysClient { * @param acceNumb the acce numb * @param genus the genus * @return the string - * @throws GenesysApiException the genesys api exception + * @throws GenesysApiException the Genesys API exception */ public String accessionExists(final String instCode, final String acceNumb, final String genus) throws GenesysApiException { @@ -361,8 +373,8 @@ public class GenesysClient { * @param instCode the inst code * @param accns the accns * @return the string - * @throws GenesysApiException the genesys api exception - * @throws PleaseRetryException the please retry exception + * @throws GenesysApiException the Genesys API exception + * @throws PleaseRetryException exception indicating the call shold be re-attempted * @throws JsonProcessingException the json processing exception * @deprecated Please use {@link #updateAccessions(String, Collection)} with only the instCode, * acceNumb, (genus, ) and mlsStat provided. @@ -411,7 +423,7 @@ public class GenesysClient { * @param instCode the inst code * @param accns the accns * @return the string - * @throws GenesysApiException the genesys api exception + * @throws GenesysApiException the Genesys API exception * @throws InterruptedException the interrupted exception * @throws JsonProcessingException the json processing exception */ @@ -444,7 +456,7 @@ public class GenesysClient { * @param organizationSlug the organization slug * @param institutes the institutes * @return the string - * @throws GenesysApiException the genesys api exception + * @throws GenesysApiException the Genesys API exception */ public String updateOrganizationMembers(final String organizationSlug, final ArrayNode institutes) throws GenesysApiException { LOG.debug("Sending: {}", institutes); @@ -467,7 +479,7 @@ public class GenesysClient { * @param instCode the inst code * @param batch the batch * @return the string - * @throws GenesysApiException the genesys api exception + * @throws GenesysApiException the Genesys API exception */ public String updateAccessionNames(final String instCode, final Collection batch) throws GenesysApiException { LOG.debug("Sending: {}", batch); @@ -491,7 +503,7 @@ public class GenesysClient { * @param instCode the inst code * @param array the array * @return the string - * @throws GenesysApiException the genesys api exception + * @throws GenesysApiException the Genesys API exception * * @deprecated Use {@link #deleteAccessionsByName(String, String)} */ @@ -506,7 +518,7 @@ public class GenesysClient { * @param instCode the inst code * @param jsonAccessionId3List the json accession id3 list * @return the string - * @throws GenesysApiException the genesys api exception + * @throws GenesysApiException the Genesys API exception */ public String deleteAccessionsByName(final String instCode, final String jsonAccessionId3List) throws GenesysApiException { return query(Verb.POST, "/acn/" + instCode + "/delete-named", null, jsonAccessionId3List); @@ -518,9 +530,9 @@ public class GenesysClient { * @param instCode the inst code * @param ids the ids * @return the string - * @throws OAuthAuthenticationException the o auth authentication exception - * @throws PleaseRetryException the please retry exception - * @throws GenesysApiException the genesys api exception + * @throws OAuthAuthenticationException authentication exception + * @throws PleaseRetryException exception indicating the call shold be re-attempted + * @throws GenesysApiException the Genesys API exception * * @deprecated Use */ @@ -535,15 +547,22 @@ public class GenesysClient { * @param instCode the inst code * @param jsonAccessionIdList the json accession id list * @return the string - * @throws OAuthAuthenticationException the o auth authentication exception - * @throws PleaseRetryException the please retry exception - * @throws GenesysApiException the genesys api exception + * @throws OAuthAuthenticationException authentication exception + * @throws PleaseRetryException exception indicating the call shold be re-attempted + * @throws GenesysApiException the Genesys API exception */ public String deleteAccessionsByGenesysId(final String instCode, final String jsonAccessionIdList) throws OAuthAuthenticationException, PleaseRetryException, GenesysApiException { return query(Verb.POST, "/acn/" + instCode + "/delete", null, jsonAccessionIdList); } + /** + * Authenticate. + * + * @param uname the uname + * @param password the password + * @throws OAuthAuthenticationException when authentication fails + */ public void authenticate(String uname, String password) throws OAuthAuthenticationException { try { OAuth2AccessToken accessToken = service.getAccessTokenPasswordGrant(uname, password); @@ -566,7 +585,7 @@ public class GenesysClient { * Obtain access and refresh tokens with verifier code. * * @param verifierCode the verifier code - * @throws OAuthAuthenticationException + * @throws OAuthAuthenticationException when authentication fails */ public void authenticate(final String verifierCode) throws OAuthAuthenticationException { try { @@ -590,9 +609,9 @@ public class GenesysClient { * Me. * * @return the string - * @throws OAuthAuthenticationException the o auth authentication exception - * @throws PleaseRetryException the please retry exception - * @throws GenesysApiException the genesys api exception + * @throws OAuthAuthenticationException when authentication fails + * @throws PleaseRetryException exception indicating the call should be attempted again + * @throws GenesysApiException the Genesys API exception */ public String me() throws OAuthAuthenticationException, PleaseRetryException, GenesysApiException { return query("/me"); @@ -603,9 +622,9 @@ public class GenesysClient { * * @param shortName the short name * @return the crop - * @throws OAuthAuthenticationException the o auth authentication exception - * @throws PleaseRetryException the please retry exception - * @throws GenesysApiException the genesys api exception + * @throws OAuthAuthenticationException authentication exception + * @throws PleaseRetryException exception indicating the call shold be re-attempted + * @throws GenesysApiException the Genesys API exception */ public String getCrop(final String shortName) throws OAuthAuthenticationException, PleaseRetryException, GenesysApiException { if (!shortName.matches("^\\w+$")) { @@ -618,9 +637,9 @@ public class GenesysClient { * List parameters. * * @return the string - * @throws OAuthAuthenticationException the o auth authentication exception - * @throws PleaseRetryException the please retry exception - * @throws GenesysApiException the genesys api exception + * @throws OAuthAuthenticationException authentication exception + * @throws PleaseRetryException exception indicating the call shold be re-attempted + * @throws GenesysApiException the Genesys API exception */ public String listParameters() throws OAuthAuthenticationException, PleaseRetryException, GenesysApiException { return query("/kpi/parameter/list"); @@ -631,9 +650,9 @@ public class GenesysClient { * * @param node the node * @return the string - * @throws OAuthAuthenticationException the o auth authentication exception - * @throws PleaseRetryException the please retry exception - * @throws GenesysApiException the genesys api exception + * @throws OAuthAuthenticationException authentication exception + * @throws PleaseRetryException exception indicating the call shold be re-attempted + * @throws GenesysApiException the Genesys API exception */ public String putParameter(final ObjectNode node) throws OAuthAuthenticationException, PleaseRetryException, GenesysApiException { return query(Verb.POST, "/kpi/parameter", null, node.toString()); @@ -644,9 +663,9 @@ public class GenesysClient { * * @param name the name * @return the parameter - * @throws OAuthAuthenticationException the o auth authentication exception - * @throws PleaseRetryException the please retry exception - * @throws GenesysApiException the genesys api exception + * @throws OAuthAuthenticationException authentication exception + * @throws PleaseRetryException exception indicating the call shold be re-attempted + * @throws GenesysApiException the Genesys API exception */ public String getParameter(final String name) throws OAuthAuthenticationException, PleaseRetryException, GenesysApiException { return query("/kpi/parameter/" + name); @@ -656,9 +675,9 @@ public class GenesysClient { * List dimensions. * * @return the string - * @throws OAuthAuthenticationException the o auth authentication exception - * @throws PleaseRetryException the please retry exception - * @throws GenesysApiException the genesys api exception + * @throws OAuthAuthenticationException authentication exception + * @throws PleaseRetryException exception indicating the call shold be re-attempted + * @throws GenesysApiException the Genesys API exception */ public String listDimensions() throws OAuthAuthenticationException, PleaseRetryException, GenesysApiException { return query("/kpi/dimension/list"); @@ -669,9 +688,9 @@ public class GenesysClient { * * @param id the id * @return the dimension - * @throws OAuthAuthenticationException the o auth authentication exception - * @throws PleaseRetryException the please retry exception - * @throws GenesysApiException the genesys api exception + * @throws OAuthAuthenticationException authentication exception + * @throws PleaseRetryException exception indicating the call shold be re-attempted + * @throws GenesysApiException the Genesys API exception */ public String getDimension(final long id) throws OAuthAuthenticationException, PleaseRetryException, GenesysApiException { return query("/kpi/dimension/" + id); @@ -682,9 +701,9 @@ public class GenesysClient { * * @param node the node * @return the string - * @throws OAuthAuthenticationException the o auth authentication exception - * @throws PleaseRetryException the please retry exception - * @throws GenesysApiException the genesys api exception + * @throws OAuthAuthenticationException authentication exception + * @throws PleaseRetryException exception indicating the call shold be re-attempted + * @throws GenesysApiException the Genesys API exception */ public String putDimension(final ObjectNode node) throws OAuthAuthenticationException, PleaseRetryException, GenesysApiException { return query(Verb.POST, "/kpi/dimension", null, node.toString()); @@ -694,9 +713,9 @@ public class GenesysClient { * List executions. * * @return the string - * @throws OAuthAuthenticationException the o auth authentication exception - * @throws PleaseRetryException the please retry exception - * @throws GenesysApiException the genesys api exception + * @throws OAuthAuthenticationException authentication exception + * @throws PleaseRetryException exception indicating the call shold be re-attempted + * @throws GenesysApiException the Genesys API exception */ public String listExecutions() throws OAuthAuthenticationException, PleaseRetryException, GenesysApiException { return query("/kpi/execution/list"); @@ -707,9 +726,9 @@ public class GenesysClient { * * @param name the name * @return the execution - * @throws OAuthAuthenticationException the o auth authentication exception - * @throws PleaseRetryException the please retry exception - * @throws GenesysApiException the genesys api exception + * @throws OAuthAuthenticationException authentication exception + * @throws PleaseRetryException exception indicating the call shold be re-attempted + * @throws GenesysApiException the Genesys API exception */ public String getExecution(final String name) throws OAuthAuthenticationException, PleaseRetryException, GenesysApiException { return query("/kpi/execution/" + name); @@ -720,9 +739,9 @@ public class GenesysClient { * * @param node the node * @return the string - * @throws OAuthAuthenticationException the o auth authentication exception - * @throws PleaseRetryException the please retry exception - * @throws GenesysApiException the genesys api exception + * @throws OAuthAuthenticationException authentication exception + * @throws PleaseRetryException exception indicating the call shold be re-attempted + * @throws GenesysApiException the Genesys API exception */ public String putExecution(final ObjectNode node) throws OAuthAuthenticationException, PleaseRetryException, GenesysApiException { return query(Verb.POST, "/kpi/execution", null, node.toString()); @@ -733,9 +752,9 @@ public class GenesysClient { * * @param name the name * @return the string - * @throws OAuthAuthenticationException the o auth authentication exception - * @throws PleaseRetryException the please retry exception - * @throws GenesysApiException the genesys api exception + * @throws OAuthAuthenticationException authentication exception + * @throws PleaseRetryException exception indicating the call shold be re-attempted + * @throws GenesysApiException the Genesys API exception */ public String kpiExecute(final String name) throws OAuthAuthenticationException, PleaseRetryException, GenesysApiException { return query(Verb.POST, "/kpi/execution/" + name + "/execute", null, null); @@ -746,9 +765,9 @@ public class GenesysClient { * * @param id the id * @return the string - * @throws OAuthAuthenticationException the o auth authentication exception - * @throws PleaseRetryException the please retry exception - * @throws GenesysApiException the genesys api exception + * @throws OAuthAuthenticationException authentication exception + * @throws PleaseRetryException exception indicating the call shold be re-attempted + * @throws GenesysApiException the Genesys API exception */ public String deleteDimension(final long id) throws OAuthAuthenticationException, PleaseRetryException, GenesysApiException { return query(Verb.DELETE, "/kpi/dimension/" + id, null, null); @@ -759,9 +778,9 @@ public class GenesysClient { * * @param name the name * @return the string - * @throws OAuthAuthenticationException the o auth authentication exception - * @throws PleaseRetryException the please retry exception - * @throws GenesysApiException the genesys api exception + * @throws OAuthAuthenticationException authentication exception + * @throws PleaseRetryException exception indicating the call shold be re-attempted + * @throws GenesysApiException the Genesys API exception */ public String deleteExecution(final String name) throws OAuthAuthenticationException, PleaseRetryException, GenesysApiException { return query(Verb.DELETE, "/kpi/execution/" + name, null, null); @@ -772,9 +791,9 @@ public class GenesysClient { * * @param name the name * @return the string - * @throws OAuthAuthenticationException the o auth authentication exception - * @throws PleaseRetryException the please retry exception - * @throws GenesysApiException the genesys api exception + * @throws OAuthAuthenticationException authentication exception + * @throws PleaseRetryException exception indicating the call shold be re-attempted + * @throws GenesysApiException the Genesys API exception */ public String deleteParameter(final String name) throws OAuthAuthenticationException, PleaseRetryException, GenesysApiException { return query(Verb.DELETE, "/kpi/parameter/" + name, null, null); @@ -784,9 +803,9 @@ public class GenesysClient { * List crops. * * @return the string - * @throws OAuthAuthenticationException the o auth authentication exception - * @throws PleaseRetryException the please retry exception - * @throws GenesysApiException the genesys api exception + * @throws OAuthAuthenticationException authentication exception + * @throws PleaseRetryException exception indicating the call shold be re-attempted + * @throws GenesysApiException the Genesys API exception */ public String listCrops() throws OAuthAuthenticationException, PleaseRetryException, GenesysApiException { return query("/crops"); @@ -797,9 +816,9 @@ public class GenesysClient { * * @param node the node * @return the string - * @throws OAuthAuthenticationException the o auth authentication exception - * @throws PleaseRetryException the please retry exception - * @throws GenesysApiException the genesys api exception + * @throws OAuthAuthenticationException authentication exception + * @throws PleaseRetryException exception indicating the call shold be re-attempted + * @throws GenesysApiException the Genesys API exception */ public String putCrop(final ObjectNode node) throws OAuthAuthenticationException, PleaseRetryException, GenesysApiException { return query(Verb.POST, "/crops", null, node.toString()); @@ -810,9 +829,9 @@ public class GenesysClient { * * @param shortName the short name * @return the string - * @throws OAuthAuthenticationException the o auth authentication exception - * @throws PleaseRetryException the please retry exception - * @throws GenesysApiException the genesys api exception + * @throws OAuthAuthenticationException authentication exception + * @throws PleaseRetryException exception indicating the call shold be re-attempted + * @throws GenesysApiException the Genesys API exception */ public String deleteCrop(final String shortName) throws OAuthAuthenticationException, PleaseRetryException, GenesysApiException { return query(Verb.DELETE, "/crops/" + shortName, null, null); @@ -823,9 +842,9 @@ public class GenesysClient { * * @param shortName the short name * @return the crop rules - * @throws OAuthAuthenticationException the o auth authentication exception - * @throws PleaseRetryException the please retry exception - * @throws GenesysApiException the genesys api exception + * @throws OAuthAuthenticationException authentication exception + * @throws PleaseRetryException exception indicating the call shold be re-attempted + * @throws GenesysApiException the Genesys API exception */ public String getCropRules(final String shortName) throws OAuthAuthenticationException, PleaseRetryException, GenesysApiException { return query("/crops/" + shortName + "/rules"); @@ -837,9 +856,9 @@ public class GenesysClient { * @param shortName the short name * @param currentCropRules the current crop rules * @return the string - * @throws OAuthAuthenticationException the o auth authentication exception - * @throws PleaseRetryException the please retry exception - * @throws GenesysApiException the genesys api exception + * @throws OAuthAuthenticationException authentication exception + * @throws PleaseRetryException exception indicating the call shold be re-attempted + * @throws GenesysApiException the Genesys API exception */ public String putCropRules(final String shortName, final ArrayNode currentCropRules) throws OAuthAuthenticationException, PleaseRetryException, GenesysApiException { return query(Verb.PUT, "/crops/" + shortName + "/rules", null, currentCropRules.toString()); @@ -849,9 +868,9 @@ public class GenesysClient { * Rebuild crop taxa. * * @return the string - * @throws OAuthAuthenticationException the o auth authentication exception - * @throws PleaseRetryException the please retry exception - * @throws GenesysApiException the genesys api exception + * @throws OAuthAuthenticationException authentication exception + * @throws PleaseRetryException exception indicating the call shold be re-attempted + * @throws GenesysApiException the Genesys API exception */ public String rebuildCropTaxa() throws OAuthAuthenticationException, PleaseRetryException, GenesysApiException { return query(Verb.POST, "/crops/rebuild", null, null); @@ -862,9 +881,9 @@ public class GenesysClient { * * @param shortName the short name * @return the string - * @throws OAuthAuthenticationException the o auth authentication exception - * @throws PleaseRetryException the please retry exception - * @throws GenesysApiException the genesys api exception + * @throws OAuthAuthenticationException authentication exception + * @throws PleaseRetryException exception indicating the call shold be re-attempted + * @throws GenesysApiException the Genesys API exception */ public String rebuildCropTaxa(final String shortName) throws OAuthAuthenticationException, PleaseRetryException, GenesysApiException { return query(Verb.POST, "/crops/" + shortName + "/rebuild", null, null); @@ -875,9 +894,9 @@ public class GenesysClient { * * @param page the page * @return the string - * @throws OAuthAuthenticationException the o auth authentication exception - * @throws PleaseRetryException the please retry exception - * @throws GenesysApiException the genesys api exception + * @throws OAuthAuthenticationException authentication exception + * @throws PleaseRetryException exception indicating the call shold be re-attempted + * @throws GenesysApiException the Genesys API exception */ public String listOrganizations(final int page) throws OAuthAuthenticationException, PleaseRetryException, GenesysApiException { final Map qs = new HashMap(); @@ -890,9 +909,9 @@ public class GenesysClient { * * @param slug the slug * @return the organization - * @throws OAuthAuthenticationException the o auth authentication exception - * @throws PleaseRetryException the please retry exception - * @throws GenesysApiException the genesys api exception + * @throws OAuthAuthenticationException authentication exception + * @throws PleaseRetryException exception indicating the call shold be re-attempted + * @throws GenesysApiException the Genesys API exception */ public String getOrganization(final String slug) throws OAuthAuthenticationException, PleaseRetryException, GenesysApiException { return query("/org/" + slug); @@ -903,9 +922,9 @@ public class GenesysClient { * * @param org the org * @return the string - * @throws OAuthAuthenticationException the o auth authentication exception - * @throws PleaseRetryException the please retry exception - * @throws GenesysApiException the genesys api exception + * @throws OAuthAuthenticationException authentication exception + * @throws PleaseRetryException exception indicating the call shold be re-attempted + * @throws GenesysApiException the Genesys API exception */ public String updateOrganization(final ObjectNode org) throws OAuthAuthenticationException, PleaseRetryException, GenesysApiException { return query(Verb.POST, "/org", null, org.toString()); @@ -916,9 +935,9 @@ public class GenesysClient { * * @param slug the slug * @return the string - * @throws OAuthAuthenticationException the o auth authentication exception - * @throws PleaseRetryException the please retry exception - * @throws GenesysApiException the genesys api exception + * @throws OAuthAuthenticationException authentication exception + * @throws PleaseRetryException exception indicating the call shold be re-attempted + * @throws GenesysApiException the Genesys API exception */ public String deleteOrganization(final String slug) throws OAuthAuthenticationException, PleaseRetryException, GenesysApiException { return query(Verb.DELETE, "/org/" + slug, null, null); @@ -929,9 +948,9 @@ public class GenesysClient { * * @param slug the slug * @return the organization members - * @throws OAuthAuthenticationException the o auth authentication exception - * @throws PleaseRetryException the please retry exception - * @throws GenesysApiException the genesys api exception + * @throws OAuthAuthenticationException authentication exception + * @throws PleaseRetryException exception indicating the call shold be re-attempted + * @throws GenesysApiException the Genesys API exception */ public String getOrganizationMembers(final String slug) throws OAuthAuthenticationException, PleaseRetryException, GenesysApiException { return query("/org/" + slug + "/institutes"); @@ -943,9 +962,9 @@ public class GenesysClient { * @param slug the slug * @param currentMembers the current members * @return the string - * @throws OAuthAuthenticationException the o auth authentication exception - * @throws PleaseRetryException the please retry exception - * @throws GenesysApiException the genesys api exception + * @throws OAuthAuthenticationException authentication exception + * @throws PleaseRetryException exception indicating the call shold be re-attempted + * @throws GenesysApiException the Genesys API exception */ public String putOrganizationMembers(final String slug, final ArrayNode currentMembers) throws OAuthAuthenticationException, PleaseRetryException, GenesysApiException { return query(Verb.PUT, "/org/" + slug + "/set-institutes", null, currentMembers.toString()); @@ -957,9 +976,9 @@ public class GenesysClient { * @param slug the slug * @param language the language * @return the organization blurp - * @throws OAuthAuthenticationException the o auth authentication exception - * @throws PleaseRetryException the please retry exception - * @throws GenesysApiException the genesys api exception + * @throws OAuthAuthenticationException authentication exception + * @throws PleaseRetryException exception indicating the call shold be re-attempted + * @throws GenesysApiException the Genesys API exception */ public String getOrganizationBlurp(final String slug, final String language) throws OAuthAuthenticationException, PleaseRetryException, GenesysApiException { return query("/org/" + slug + "/blurp/" + language); @@ -971,9 +990,9 @@ public class GenesysClient { * @param slug the slug * @param blurp the blurp * @return the string - * @throws OAuthAuthenticationException the o auth authentication exception - * @throws PleaseRetryException the please retry exception - * @throws GenesysApiException the genesys api exception + * @throws OAuthAuthenticationException authentication exception + * @throws PleaseRetryException exception indicating the call shold be re-attempted + * @throws GenesysApiException the Genesys API exception */ public String updateOrganizationBlurp(final String slug, final ObjectNode blurp) throws OAuthAuthenticationException, PleaseRetryException, GenesysApiException { return query(Verb.PUT, "/org/" + slug + "/blurp", null, blurp.toString()); @@ -986,9 +1005,9 @@ public class GenesysClient { * @param dimensionFilter the dimension filter * @param page the page * @return the string - * @throws OAuthAuthenticationException the o auth authentication exception - * @throws PleaseRetryException the please retry exception - * @throws GenesysApiException the genesys api exception + * @throws OAuthAuthenticationException authentication exception + * @throws PleaseRetryException exception indicating the call shold be re-attempted + * @throws GenesysApiException the Genesys API exception */ public String listObservations(final String executionName, final String dimensionFilter, final int page) throws OAuthAuthenticationException, PleaseRetryException, GenesysApiException { @@ -1004,9 +1023,9 @@ public class GenesysClient { * @param page the page * @param query the query * @return the string - * @throws OAuthAuthenticationException the o auth authentication exception - * @throws PleaseRetryException the please retry exception - * @throws GenesysApiException the genesys api exception + * @throws OAuthAuthenticationException authentication exception + * @throws PleaseRetryException exception indicating the call shold be re-attempted + * @throws GenesysApiException the Genesys API exception */ public String listAccessions(final String instCode, final int page, final String query) throws OAuthAuthenticationException, PleaseRetryException, GenesysApiException { final Map params = new HashMap(); @@ -1022,10 +1041,10 @@ public class GenesysClient { * @param instCode institute code (MCPD INSTCODE) * @param page 1 for first page * @return the string - * @throws OAuthAuthenticationException the o auth authentication exception - * @throws PleaseRetryException the please retry exception + * @throws OAuthAuthenticationException authentication exception + * @throws PleaseRetryException exception indicating the call shold be re-attempted * @throws HttpRedirectException the http redirect exception - * @throws GenesysApiException the genesys api exception + * @throws GenesysApiException the Genesys API exception */ public String listGalleries(final String instCode, final int page) throws OAuthAuthenticationException, PleaseRetryException, HttpRedirectException, GenesysApiException { return query(Verb.GET, String.format("/img/%1$s/_galleries", instCode), Collections.singletonMap("page", Integer.toString(page)), null); @@ -1037,9 +1056,9 @@ public class GenesysClient { * @param instCode institute code (MCPD INSTCODE) * @param acceNumb the acce numb * @return the list - * @throws OAuthAuthenticationException the o auth authentication exception - * @throws PleaseRetryException the please retry exception - * @throws GenesysApiException the genesys api exception + * @throws OAuthAuthenticationException authentication exception + * @throws PleaseRetryException exception indicating the call shold be re-attempted + * @throws GenesysApiException the Genesys API exception * @throws JsonParseException the json parse exception * @throws JsonMappingException the json mapping exception * @throws IOException Signals that an I/O exception has occurred. @@ -1060,7 +1079,7 @@ public class GenesysClient { * @param file image to upload * @param contentType the content type * @return the repository image - * @throws GenesysApiException the genesys api exception + * @throws GenesysApiException the Genesys API exception * @throws IOException if file cannot be read */ public RepositoryImage uploadImage(final String instCode, final String acceNumb, final File file, final String contentType) throws GenesysApiException, IOException { @@ -1086,9 +1105,9 @@ public class GenesysClient { * @param instCode institute code (MCPD INSTCODE) * @param acceNumb accession number (MCPD ACCENUMB) * @param uuid Repository image UUID as assigned by Genesys - * @throws OAuthAuthenticationException the o auth authentication exception - * @throws PleaseRetryException the please retry exception - * @throws GenesysApiException the genesys api exception + * @throws OAuthAuthenticationException authentication exception + * @throws PleaseRetryException exception indicating the call shold be re-attempted + * @throws GenesysApiException the Genesys API exception */ public void deleteImage(final String instCode, final String acceNumb, final UUID uuid) throws OAuthAuthenticationException, PleaseRetryException, GenesysApiException { query(Verb.DELETE, String.format("/img/%1$s/acn/%2$s/%3$s", instCode, acceNumb, uuid)); @@ -1101,7 +1120,7 @@ public class GenesysClient { * @param acceNumb accession number (MCPD ACCENUMB) * @param uuid Repository image UUID as assigned by Genesys * @return the metadata - * @throws GenesysApiException the genesys api exception + * @throws GenesysApiException the Genesys API exception * @throws IOException Signals that an I/O exception has occurred. */ public RepositoryImage getImageMetadata(final String instCode, final String acceNumb, final UUID uuid) throws GenesysApiException, IOException { @@ -1121,7 +1140,7 @@ public class GenesysClient { * @param uuid Repository image UUID as assigned by Genesys * @param imageData the image data * @return the metadata - * @throws GenesysApiException the genesys api exception + * @throws GenesysApiException the Genesys API exception * @throws IOException Signals that an I/O exception has occurred. */ public RepositoryImage putImageMetadata(final String instCode, final String acceNumb, final UUID uuid, final RepositoryImage imageData)