Skip to content

Commit ca4a669

Browse files
committed
sign out CLS licenses, handle "server" licenses without error
1 parent 711eff4 commit ca4a669

3 files changed

Lines changed: 15 additions & 1 deletion

File tree

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -332,6 +332,11 @@ public void execute(CredentialsCallbackInfo info) {
332332

333333
boolean licenseObtained = obtainLicense(licenseOptions);
334334
if(licenseObtained){
335+
// We want to release this CLS license when we complete our session such
336+
// that if we start a new session with a different auth the engine does not
337+
// attempt to "remember" this previously acquired license/auth.
338+
engine.signOutAtClose();
339+
335340
Utilities utilities = engine.getUtilities();
336341
ThirdPartyDependencyChecker.logAllDependencyInfo(utilities);
337342

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ public static List<String> getLicenseFeatures(LicenceProperties license){
8888
}
8989

9090
public static String summarizeLicense(AvailableLicence license) {
91-
String result = String.format("[%s/%s/%s, %s, Count:%s, Workers: %s, Features: %s]",
91+
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(),

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,16 @@ 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+
// A license of this type will throw a null pointer exception due to it having a null workers value
51+
if(license.getShortName().equalsIgnoreCase("server")) {
52+
logger.info("!!! Ignoring 'Nuix Server' license as we cannot claim it for our needs...");
53+
return false;
54+
}
55+
56+
logger.info("Checking License: "+LicenseFeaturesLogger.summarizeLicense(license));
57+
5058
int workerCount = ((LicenceProperties)license).getWorkers();
59+
5160
// Verify the minimum worker count
5261
if(minWorkers > 0 && workerCount < minWorkers) {
5362
logger.info(String.format("!!! License has %s workers, filter specifies a minimum of %s",workerCount,minWorkers));

0 commit comments

Comments
 (0)