private <T> T applyToLicense(ProductLicenseFn<T> fn) { LicenseInfo licenseInfo = fisheyeAccessor.getLicenseInfo(); ProductLicense fishEyeLicense = licenseInfo.getFisheyeLicense(); ProductLicense crucibleLicense = licenseInfo.getCrucibleLicense(); if (fishEyeLicense != null) { return fn.call(fishEyeLicense); } else if (crucibleLicense != null) { return fn.call(crucibleLicense); } else { return null; } }
@Override public String getApplicationServerID() { LicenseInfo productLicense = AppConfig.getsConfig().getLicense(); if (productLicense.isFishEye()) { return productLicense.getFisheyeLicense().getServerId(); } else { return productLicense.getCrucibleLicense().getServerId(); } }
@Override public ApplicationLicenseInfo getLicenseInfo() { ProductLicense license = AppConfig.getsConfig().getLicense().getFisheyeLicense(); return new ProductLicenseInfo(license); }
if (productLicense.isCrucibleOnly()) licenseProps.setValue(LICENSE_SEN, productLicense.getCrucibleLicense().getSupportEntitlementNumber()); licenseProps.setValue(LICENSE_SERVER_ID, productLicense.getCrucibleLicense().getServerId()); else if (productLicense.isFishEye()) licenseProps.setValue(LICENSE_SEN, productLicense.getFisheyeLicense().getSupportEntitlementNumber()); licenseProps.setValue(LICENSE_SERVER_ID, productLicense.getFisheyeLicense().getServerId()); licenseProps.setValue(LICENSE_EXPIRES, productLicense.getSoftExpiryValue().toString()); String upgradesMaintenence = ""; if (productLicense.getLatestBuildAllowedValue() != null) upgradesMaintenence = this.getText(LICENSE_EXPIRES) + " " + productLicense.getLatestBuildAllowedValue().toString(); licenseProps.setValue(LICENSE_PRODUCT, productLicense.getProductName()); licenseProps.setValue(LICENSE_OWNER, productLicense.getOwner()); licenseProps.setValue(LICENSE_DESCRIPTION, productLicense.getDescription()); if (productLicense.getCrucibleLicense() != null) String maxCRUUsers = productLicense.getCrucibleLicense().isUnlimitedNumberOfUsers() ? LICENSE_UNLIMITED_USERS : "" + productLicense.getCrucibleLicense().getMaximumNumberOfUsers(); licenseProps.setValue(MAX_CRUCIBLE_USERS, maxCRUUsers); licenseProps.setValue(LICENSE_DESCRIPTION_CRUCIBLE, productLicense.getCrucibleLicense().getDescription()); licenseProps.setValue(LICENSE_ORGANISATION, productLicense.getOwnerStatement()); if (productLicense.getFisheyeLicense() != null)
public boolean isApplicationSetUp() { // this code is copied from TotalityFilter.requresSetup() method final RootConfig rootConfig = AppConfig.getsConfig(); final AdminConfig acfg = rootConfig.getAdminConfig(); final boolean requiresSetup = !acfg.haveDoneInitialSetup() || (rootConfig.getLicense() == null) || rootConfig.getLicense().isTerminated(); return !requiresSetup; }
@Override public String getApplicationSEN() { LicenseInfo productLicense = AppConfig.getsConfig().getLicense(); if (productLicense.isFishEye()) { return productLicense.getFisheyeLicense().getSupportEntitlementNumber(); } else { return productLicense.getCrucibleLicense().getSupportEntitlementNumber(); } }