Skip to content

Commit d19f68d

Browse files
committed
Add ttl interval to ValidationParameters
1 parent ff241d5 commit d19f68d

3 files changed

Lines changed: 18 additions & 2 deletions

File tree

NetLicensingClient/src/main/java/com/labs64/netlicensing/domain/Constants.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,5 +197,9 @@ public static final class ValidationResult {
197197
public static final int DEFAULT_TTL_MINUTES = 60 * 24; // 1 day
198198
}
199199

200+
public static final class ValidationParameters {
201+
public static final String TTL_INTERVAL = "ttlInterval";
202+
}
203+
200204
// CHECKSTYLE:ON
201205
}

NetLicensingClient/src/main/java/com/labs64/netlicensing/domain/vo/ValidationParameters.java

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ public class ValidationParameters {
88
private String productNumber;
99
private String licenseeName;
1010
private String licenseeSecret;
11+
private Integer ttlInterval;
1112
private Map<String, Map<String, String>> parameters;
1213

1314
/**
@@ -26,7 +27,7 @@ public String getProductNumber() {
2627

2728
/**
2829
* Sets the name for the new licensee
29-
*
30+
*
3031
* @param licenseeName
3132
* optional human-readable licensee name in case licensee will be auto-created. This parameter must not
3233
* be the name, but can be used to store any other useful string information with new licensees, up to
@@ -42,7 +43,7 @@ public String getLicenseeName() {
4243

4344
/**
4445
* Sets the licensee secret
45-
*
46+
*
4647
* @param licenseeSecret
4748
* licensee secret stored on the client side. Refer to Licensee Secret documentation for details.
4849
*/
@@ -54,6 +55,14 @@ public String getLicenseeSecret() {
5455
return licenseeSecret;
5556
}
5657

58+
public void setTtlInterval(int ttlInterval) {
59+
this.ttlInterval = ttlInterval;
60+
}
61+
62+
public Integer getTtlInterval() {
63+
return this.ttlInterval;
64+
}
65+
5766
public Map<String, Map<String, String>> getParameters() {
5867
if (parameters == null) {
5968
parameters = new HashMap<String, Map<String, String>>();

NetLicensingClient/src/main/java/com/labs64/netlicensing/service/LicenseeService.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,9 @@ public static ValidationResult validate(final Context context, final String numb
214214
if (StringUtils.isNotBlank(validationParameters.getLicenseeSecret())) {
215215
form.param(Constants.Licensee.PROP_LICENSEE_SECRET, validationParameters.getLicenseeSecret());
216216
}
217+
if (validationParameters.getTtlInterval() != null) {
218+
form.param(Constants.ValidationParameters.TTL_INTERVAL, validationParameters.getTtlInterval().toString());
219+
}
217220
int pmIndex = 0;
218221
for (final Entry<String, Map<String, String>> productModuleValidationParams : validationParameters
219222
.getParameters().entrySet()) {

0 commit comments

Comments
 (0)