From 53f35eb1ec66cfa457a11ffc5c877c418b3e78ab Mon Sep 17 00:00:00 2001 From: Yvonne Allen Date: Mon, 16 Nov 2020 12:22:00 -0500 Subject: [PATCH 1/2] fixed javadoc warnings --- build.gradle | 1 - .../java/com/vonage/client/auth/AuthCollection.java | 1 + .../java/com/vonage/client/auth/RequestSigning.java | 1 + .../vonage/client/auth/hashutils/AbstractHasher.java | 2 ++ .../com/vonage/client/auth/hashutils/HashUtil.java | 1 + .../java/com/vonage/client/incoming/DtmfResult.java | 6 +++++- .../java/com/vonage/client/numbers/NumbersClient.java | 4 ++++ .../vonage/client/numbers/SearchNumbersFilter.java | 3 ++- .../vonage/client/numbers/SearchNumbersResponse.java | 3 ++- src/main/java/com/vonage/client/sms/SmsClient.java | 5 +++++ .../java/com/vonage/client/sms/messages/Message.java | 3 ++- .../com/vonage/client/sms/messages/TextMessage.java | 1 + .../java/com/vonage/client/verify/Psd2Request.java | 5 +++++ .../client/verify/VerifyClientVerifyEndpointTest.java | 11 +++++------ 14 files changed, 36 insertions(+), 11 deletions(-) diff --git a/build.gradle b/build.gradle index ef6162506..be1e3170f 100644 --- a/build.gradle +++ b/build.gradle @@ -172,7 +172,6 @@ task zip(type: Zip) { } task depJar(type: Jar, dependsOn: configurations.runtime) { - archivesBaseName = archivesBaseName + '-with-dependencies' from { configurations.runtime.collect { it.isDirectory() ? it : zipTree(it) } } with jar } diff --git a/src/main/java/com/vonage/client/auth/AuthCollection.java b/src/main/java/com/vonage/client/auth/AuthCollection.java index 5939623a7..dbee0a4eb 100644 --- a/src/main/java/com/vonage/client/auth/AuthCollection.java +++ b/src/main/java/com/vonage/client/auth/AuthCollection.java @@ -63,6 +63,7 @@ public void add(AuthMethod auth) { * * @throws VonageUnacceptableAuthException if no matching AuthMethod is found. */ + @SuppressWarnings("unchecked") public T getAuth(Class type) throws VonageUnacceptableAuthException { for (AuthMethod availableAuthMethod : authList) { if (type.isInstance(availableAuthMethod)) { diff --git a/src/main/java/com/vonage/client/auth/RequestSigning.java b/src/main/java/com/vonage/client/auth/RequestSigning.java index 037cd8e46..ec7cd4474 100644 --- a/src/main/java/com/vonage/client/auth/RequestSigning.java +++ b/src/main/java/com/vonage/client/auth/RequestSigning.java @@ -160,6 +160,7 @@ public static boolean verifyRequestSignature(HttpServletRequest request, String * * @param request The HttpServletRequest to be verified. * @param secretKey The pre-shared secret key used by the sender of the request to create the signature. + * @param hashType Hash type to be used to construct request parameters. * * @return true if the signature is correct for this request and secret key. */ diff --git a/src/main/java/com/vonage/client/auth/hashutils/AbstractHasher.java b/src/main/java/com/vonage/client/auth/hashutils/AbstractHasher.java index d912e34d7..7bd298e59 100644 --- a/src/main/java/com/vonage/client/auth/hashutils/AbstractHasher.java +++ b/src/main/java/com/vonage/client/auth/hashutils/AbstractHasher.java @@ -31,6 +31,7 @@ public String calculate(String input) throws NoSuchAlgorithmException, InvalidKe * @return hashed representation of the input string * @throws NoSuchAlgorithmException if the algorithm is not available. * @throws UnsupportedEncodingException if the encoding type is invalid + * @throws InvalidKeyException Only applicable to HMAC encoding types, when a bad key is provided. */ public String calculate(String input, String secretKey, String encoding) throws UnsupportedEncodingException, NoSuchAlgorithmException, InvalidKeyException { return calculate(input + secretKey, encoding); @@ -44,6 +45,7 @@ public String calculate(String input, String secretKey, String encoding) throws * @return hashed representation of the input string * @throws NoSuchAlgorithmException if the algorithm is not available. * @throws UnsupportedEncodingException if the encoding type is invalid + * @throws InvalidKeyException Only applicable to HMAC encoding types, when a bad key is provided. */ public abstract String calculate(String input, String encoding) throws NoSuchAlgorithmException, UnsupportedEncodingException, InvalidKeyException; diff --git a/src/main/java/com/vonage/client/auth/hashutils/HashUtil.java b/src/main/java/com/vonage/client/auth/hashutils/HashUtil.java index a5b768b47..8756d3c04 100644 --- a/src/main/java/com/vonage/client/auth/hashutils/HashUtil.java +++ b/src/main/java/com/vonage/client/auth/hashutils/HashUtil.java @@ -39,6 +39,7 @@ public static String calculate(String input, HashType hashType) throws NoSuchAlg * @return representation of the input string with given hash type * @throws NoSuchAlgorithmException if the algorithm is not available. * @throws InvalidKeyException Only applicable to HMAC encoding types, when a bad key is provided. + * @throws UnsupportedEncodingException if the specified encoding is unavailable. */ public static String calculate(String input, String encoding, HashType hashType) throws NoSuchAlgorithmException, UnsupportedEncodingException, InvalidKeyException { return hashTypes.get(hashType).calculate(input, encoding); diff --git a/src/main/java/com/vonage/client/incoming/DtmfResult.java b/src/main/java/com/vonage/client/incoming/DtmfResult.java index 884a63b84..418110f9a 100644 --- a/src/main/java/com/vonage/client/incoming/DtmfResult.java +++ b/src/main/java/com/vonage/client/incoming/DtmfResult.java @@ -25,12 +25,16 @@ public class DtmfResult { /** * - * @return + * @return The buttons pressed by the user */ public String getDigits() { return digits; } + /** + * + * @return Whether the DTMF input timed out: true if it did, false if not + */ @JsonProperty("timed_out") public boolean isTimedOut() { return timedOut; diff --git a/src/main/java/com/vonage/client/numbers/NumbersClient.java b/src/main/java/com/vonage/client/numbers/NumbersClient.java index a939b9209..57bda7ae7 100644 --- a/src/main/java/com/vonage/client/numbers/NumbersClient.java +++ b/src/main/java/com/vonage/client/numbers/NumbersClient.java @@ -68,6 +68,8 @@ public ListNumbersResponse listNumbers(ListNumbersFilter filter) throws VonageRe /** * Search for available Vonage Virtual Numbers. * + * @param country country to search available numbers from + * @return available Vonage Virtual Numbers * @throws VonageResponseParseException if the response from the API could not be parsed. * @throws VonageClientException if an error is returned by the server. */ @@ -78,6 +80,8 @@ public SearchNumbersResponse searchNumbers(String country) throws VonageResponse /** * Search for available Vonage Virtual Numbers. * + * @param filter search for available Vonage Virtual Number with filters + * @return available Vonage Virtual Numbers * @throws VonageResponseParseException if the response from the API could not be parsed. * @throws VonageClientException if an error is returned by the server. */ diff --git a/src/main/java/com/vonage/client/numbers/SearchNumbersFilter.java b/src/main/java/com/vonage/client/numbers/SearchNumbersFilter.java index 0ef10453f..bc011c1a3 100644 --- a/src/main/java/com/vonage/client/numbers/SearchNumbersFilter.java +++ b/src/main/java/com/vonage/client/numbers/SearchNumbersFilter.java @@ -95,7 +95,8 @@ public SearchPattern getSearchPattern() { } /** - * @param searchPattern + * @param searchPattern The pattern you want to search for. Use the * wildcard to match the start or end of the number. + * For example, *123* matches all numbers that contain the pattern 123. */ public void setSearchPattern(SearchPattern searchPattern) { this.searchPattern = searchPattern; diff --git a/src/main/java/com/vonage/client/numbers/SearchNumbersResponse.java b/src/main/java/com/vonage/client/numbers/SearchNumbersResponse.java index 1fb78214a..e107a6c0f 100644 --- a/src/main/java/com/vonage/client/numbers/SearchNumbersResponse.java +++ b/src/main/java/com/vonage/client/numbers/SearchNumbersResponse.java @@ -30,7 +30,7 @@ public class SearchNumbersResponse { private AvailableNumber[] numbers = new AvailableNumber[]{}; /** - * Get the number of responses returned by the Vonage API. + * @return the number of responses returned by the Vonage API. */ public int getCount() { return count; @@ -38,6 +38,7 @@ public int getCount() { /** * Obtain an array of matching numbers than are available to buy. + * @return list of available numbers */ public AvailableNumber[] getNumbers() { return numbers; diff --git a/src/main/java/com/vonage/client/sms/SmsClient.java b/src/main/java/com/vonage/client/sms/SmsClient.java index c9dab7878..9c4aa13f3 100644 --- a/src/main/java/com/vonage/client/sms/SmsClient.java +++ b/src/main/java/com/vonage/client/sms/SmsClient.java @@ -40,6 +40,7 @@ public class SmsClient { /** * Create a new SmsClient. + * @param httpWrapper Http Wrapper used to create a Sms Request */ public SmsClient(HttpWrapper httpWrapper) { message = new SendMessageEndpoint(httpWrapper); @@ -80,6 +81,8 @@ public SmsSubmissionResponse submitMessage(Message message) throws VonageRespons * #searchMessages(String, String...)} instead. *

* + * @param request request to search for a sms message + * @return sms messages that match the search criteria * @throws VonageClientException if there was a problem with the Vonage request or response objects. * @throws VonageResponseParseException if the response from the API could not be parsed. */ @@ -125,6 +128,8 @@ public SearchSmsResponse searchMessages(Date date, String to) throws VonageRespo *

* You should probably use {@link #searchRejectedMessages(Date, String)} instead. * + * @param request search for rejected SMS transactions + * * @return rejection data matching the provided criteria * * @throws VonageClientException if there was a problem with the Vonage request or response objects. diff --git a/src/main/java/com/vonage/client/sms/messages/Message.java b/src/main/java/com/vonage/client/sms/messages/Message.java index 182dde86f..23d37736a 100644 --- a/src/main/java/com/vonage/client/sms/messages/Message.java +++ b/src/main/java/com/vonage/client/sms/messages/Message.java @@ -72,6 +72,7 @@ protected Message(final MessageType type, * valid short-code / long code that can be replied to, or a short text description of the application * sending the message (Max 15 chars) * @param to the phone number of the handset you wish to send the message to + * @param statusReportRequired flag to enable status updates about the delivery of this message */ protected Message(final MessageType type, final String from, @@ -148,7 +149,7 @@ public void setCallbackUrl(String callbackUrl) { } /** - * Get the value of the 'status-report-req' parameter. + * @return get the value of the 'status-report-req' parameter. */ public boolean getStatusReportRequired() { return statusReportRequired; diff --git a/src/main/java/com/vonage/client/sms/messages/TextMessage.java b/src/main/java/com/vonage/client/sms/messages/TextMessage.java index fe27c2e00..3d26f23c0 100644 --- a/src/main/java/com/vonage/client/sms/messages/TextMessage.java +++ b/src/main/java/com/vonage/client/sms/messages/TextMessage.java @@ -53,6 +53,7 @@ public TextMessage(final String from, * description of the application sending the message (Max 11 chars) * @param to the phone number of the handset that you wish to send the message to * @param messageBody The text of the message to be sent to the handset + * @param unicode set this flag to true if the message needs to be submitted as a unicode message */ public TextMessage(final String from, final String to, diff --git a/src/main/java/com/vonage/client/verify/Psd2Request.java b/src/main/java/com/vonage/client/verify/Psd2Request.java index 07410b118..10e791f7f 100644 --- a/src/main/java/com/vonage/client/verify/Psd2Request.java +++ b/src/main/java/com/vonage/client/verify/Psd2Request.java @@ -95,6 +95,11 @@ public int getId() { } /** + * @param number The recipient's phone number in E.164 + * format. + * @param amount The decimal amount of the payment to be confirmed, in Euros. + * @param payee An alphanumeric string to indicate to the user the name of the recipient that they + * are confirming a payment to. * @return A new Builder to start building. */ public static Builder builder(String number, Double amount, String payee) { diff --git a/src/test/java/com/vonage/client/verify/VerifyClientVerifyEndpointTest.java b/src/test/java/com/vonage/client/verify/VerifyClientVerifyEndpointTest.java index 805bbd378..9d6810f9d 100644 --- a/src/test/java/com/vonage/client/verify/VerifyClientVerifyEndpointTest.java +++ b/src/test/java/com/vonage/client/verify/VerifyClientVerifyEndpointTest.java @@ -133,12 +133,11 @@ public void testVerifyWithNonNumericStatus() throws Exception { + " \"error_text\": \"error\"\n" + "}" )); - VerifyResponse response = client.verify(new VerifyRequest("447700900999", - "TestBrand", - "15555215554", - 6, - Locale.US - )); + VerifyResponse response = client.verify(VerifyRequest.builder("447700900999","TestBrand") + .senderId("15555215554") + .length(6) + .locale(Locale.US) + .build()); assertEquals(VerifyStatus.INTERNAL_ERROR, response.getStatus()); assertEquals("error", response.getErrorText()); From 5948dab81da17f70b619db7eef89eb374afdc8a5 Mon Sep 17 00:00:00 2001 From: Yvonne Allen Date: Mon, 16 Nov 2020 13:09:19 -0500 Subject: [PATCH 2/2] =?UTF-8?q?Bump=20version:=205.6.0=20=E2=86=92=206.0.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .bumpversion.cfg | 2 +- README.md | 6 +++--- build.gradle | 2 +- src/main/java/com/vonage/client/HttpWrapper.java | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.bumpversion.cfg b/.bumpversion.cfg index 795af75a9..1eeee81e2 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,7 +1,7 @@ [bumpversion] commit = True tag = True -current_version = 5.6.0 +current_version = 6.0.0 parse = (?P\d+)\.(?P\d+)\.(?P\d+)(\-(?P[a-z]+))? serialize = {major}.{minor}.{patch} diff --git a/README.md b/README.md index c187598c4..0fe350177 100644 --- a/README.md +++ b/README.md @@ -34,7 +34,7 @@ For Gradle 3.4 or Higher: ```groovy dependencies { - implementation 'com.vonage:client:5.6.0' + implementation 'com.vonage:client:6.0.0' } ``` @@ -42,7 +42,7 @@ For older versions: ```groovy dependencies { - compile 'com.vonage:client:5.6.0' + compile 'com.vonage:client:6.0.0' } ``` @@ -54,7 +54,7 @@ Add the following to the correct place in your project's POM file: com.vonage client - 5.6.0 + 6.0.0 ``` diff --git a/build.gradle b/build.gradle index be1e3170f..068f9bd19 100644 --- a/build.gradle +++ b/build.gradle @@ -16,7 +16,7 @@ plugins { group = "com.vonage" archivesBaseName = "client" -version = "5.6.0" +version = "6.0.0" sourceCompatibility = "1.8" targetCompatibility = "1.8" diff --git a/src/main/java/com/vonage/client/HttpWrapper.java b/src/main/java/com/vonage/client/HttpWrapper.java index e2d2a0d7a..0da92a7cc 100644 --- a/src/main/java/com/vonage/client/HttpWrapper.java +++ b/src/main/java/com/vonage/client/HttpWrapper.java @@ -31,7 +31,7 @@ */ public class HttpWrapper { private static final String CLIENT_NAME = "vonage-java-sdk"; - private static final String CLIENT_VERSION = "5.6.0"; + private static final String CLIENT_VERSION = "6.0.0"; private static final String JAVA_VERSION = System.getProperty("java.version"); private AuthCollection authCollection;