Skip to content

Commit aee93a2

Browse files
committed
force use of non-deprecated getWorkers method, dependency updates
1 parent 962bd80 commit aee93a2

3 files changed

Lines changed: 23 additions & 17 deletions

File tree

IntelliJ/build.gradle

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,27 +7,26 @@ plugins {
77
}
88

99
group 'com.nuix'
10-
version '9.6.5.283'
10+
version '9.10.9.584'
1111

1212
repositories {
1313
mavenCentral()
1414
flatDir { dirs 'engine/lib' }
1515
}
1616

1717
dependencies {
18-
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.2'
19-
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.8.2'
18+
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.9.0'
19+
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.9.0'
2020

2121
// Used for logging
22-
implementation 'org.apache.logging.log4j:log4j-api:2.17.1'
23-
implementation 'org.apache.logging.log4j:log4j-core:2.17.1'
22+
implementation 'org.apache.logging.log4j:log4j-api:2.19.0'
23+
implementation 'org.apache.logging.log4j:log4j-core:2.19.0'
2424

2525
// Required for various date objects
26-
implementation 'joda-time:joda-time:2.10.13'
26+
implementation 'joda-time:joda-time:2.12.0'
2727

2828
// Reference Nuix dependencies
29-
implementation fileTree(dir: 'engine/lib', include: 'nuix-scripting*.jar')
30-
implementation fileTree(dir: 'engine/lib', include: 'nuix-engine*.jar')
29+
implementation fileTree(dir: 'engine/lib', include: '*nuix*.jar')
3130
runtimeOnly fileTree(dir: 'engine/lib', include: '*.jar')
3231
}
3332

@@ -46,6 +45,9 @@ String rootLogDir = rootProject.rootDir.getAbsolutePath() + "\\logs"
4645
String envPath = engineBinDirectory + ";" + engineX86BinDirectory
4746

4847
def defaultJvmArgs = [
48+
"-Xms2g", // Set minimum heap (memory) size
49+
"-Xmx4g", // Set maximum heap (memory) size
50+
4951
// Necessary for newer versions of Nuix. Without this you will likely see
5052
// an error regarding loading the BouncyCastle crypto library at run-time
5153
"--add-exports=java.base/jdk.internal.loader=ALL-UNNAMED",
@@ -59,9 +61,14 @@ def defaultJvmArgs = [
5961

6062
// Specify a temp directory accessible to the user running our code
6163
"-Djava.io.tmpdir=\"${System.getenv("LOCALAPPDATA")}\\Temp\\Nuix\"",
64+
65+
// Forward ENV user and pass
66+
"-DLicense.UserName=${System.getenv("NUIX_USERNAME")}",
67+
"-DLicense.Password=${System.getenv("NUIX_PASSWORD")}",
6268
]
6369

6470
task BasicInitialization(type: JavaExec) {
71+
System.out.println(String.join("\n",defaultJvmArgs))
6572
classpath sourceSets.main.runtimeClasspath
6673
group = "Examples"
6774
mainClass = "com.nuix.javaenginesimple.examples.BasicInitializationExample"

IntelliJ/src/main/java/com/nuix/javaenginesimple/LicenseFeaturesLogger.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
public class LicenseFeaturesLogger {
1919
// Obtain a logger instance for this class
2020
private final static Logger logger = LogManager.getLogger("LicenseFeatures");
21-
21+
2222
// List of license features
2323
// List generated from 9.2 license profiles documentation found here:
2424
// https://download.nuix.com/releases/desktop/stable/docs/en/reference/licence-profiles.html
@@ -74,7 +74,7 @@ public class LicenseFeaturesLogger {
7474
public static String[] getKnownFeatures() {
7575
return knownFeatures;
7676
}
77-
77+
7878
public static List<String> getLicenseFeatures(LicenceProperties license){
7979
List<String> result = new ArrayList<String>();
8080
for (int i = 0; i < knownFeatures.length; i++) {
@@ -86,20 +86,20 @@ public static List<String> getLicenseFeatures(LicenceProperties license){
8686
}
8787
return result;
8888
}
89-
89+
9090
public static String summarizeLicense(AvailableLicence license) {
9191
String result = String.format("[%s/%s/%s, %s, Count:%s, Workers: %s, Features: %s]",
9292
license.getSource().getLocation(),
9393
license.getSource().getType(),
9494
license.getShortName(),
9595
license.getDescription(),
9696
license.getCount(),
97-
license.getWorkers(),
97+
((LicenceProperties)license).getWorkers(),
9898
String.join("; ", getLicenseFeatures(license))
9999
);
100100
return result;
101101
}
102-
102+
103103
/***
104104
* Logs a listing of whether each feature is present or not on the provided license.
105105
* @param license The license to log feature presence information about

IntelliJ/src/main/java/com/nuix/javaenginesimple/LicenseFilter.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
import java.util.ArrayList;
44
import java.util.List;
55

6+
import nuix.LicenceProperties;
7+
import nuix.engine.AvailableLicence;
68
import org.apache.logging.log4j.LogManager;
79
import org.apache.logging.log4j.Logger;
810

9-
import nuix.engine.AvailableLicence;
10-
1111
/***
1212
* Specifies minimum requirements you may have when obtaining a license. Used by {@link EngineWrapper} when iterating available
1313
* licenses to determine which one to pick from those available.
@@ -47,8 +47,7 @@ public void acquireAnyLicense() {
4747
* @return True if all requirements met, false if any requirement has not been met.
4848
*/
4949
public boolean isValid(AvailableLicence license) {
50-
51-
int workerCount = license.getWorkers();
50+
int workerCount = ((LicenceProperties)license).getWorkers();
5251
// Verify the minimum worker count
5352
if(minWorkers > 0 && workerCount < minWorkers) {
5453
logger.info(String.format("!!! License has %s workers, filter specifies a minimum of %s",workerCount,minWorkers));

0 commit comments

Comments
 (0)