/** * Retrieves encoded Service Desk license string from plugin store or the upgrade location if it exists. No * validation is performed, so returned license may be malformed or may not be a Service Desk license. * * @return the encoded Service Desk license string from plugin store or the upgrade location if it exists. */ public Option<String> getCurrentOrUpgrade() { return get().orElse(this::getUpgrade); }
public final String getApiBaseUrl() { return getConfiguredBaseUrl() .orElse(new Supplier<Option<String>>() { @Override public Option<String> get() { return getHipChatDevBaseUrl(); } }) .getOrElse(API_BASE_URI).trim(); }
@VisibleForTesting Predicate<String> getAuthorizedSubjectPredicate() { Iterable<String> iterable = getAuthorizedSubjectsIterableFromFilterConfig() .orElse(getAuthorizedSubjectsIterableFromSpring()) .getOrError(Suppliers.ofInstance( "Missing bean with name " + AUTHORIZED_SUBJECTS_BEAN_NAME + " or servlet filter init-param with key " + AUTHORIZED_SUBJECTS_INIT_PARAM_KEY )); return Predicates.in(ImmutableList.copyOf(iterable)); }
@Override public final String getApiBaseUrl() { return getConfiguredBaseUrl() .orElse(new Supplier<Option<String>>() { @Override public Option<String> get() { return getHipChatDevBaseUrl(); } }) .getOrElse(API_BASE_URI).trim(); }
private Option<License> sdLicenseForCloud() { return licenseDao.getLicenses().license(ApplicationKeys.SERVICE_DESK) .filter(LicenseUtils::isServiceDeskLicense) .orElse(licenseDao::get6xLicense) .filter(LicenseUtils::isServiceDeskLicense); } }
private Option<License> retrieveLicense() { if (featureManager.isOnDemand()) { return sdLicenseForCloud(); } else { return sdLicenseSupplier.getCurrentOrUpgrade() .map(License::new) .orElse(this::get6xSdLicenseFromOldStoreSafely); } }
public Option<StatusCategory> getStatusCategory(QueryLiteral rawValue) { if ((rawValue.getSourceOperand() instanceof EmptyOperand)) { return Option.some(statusCategoryManager.getDefaultStatusCategory()); } else { return forId(rawValue.getLongValue()) .orElse(forKey(rawValue.getStringValue())) .orElse(forName(rawValue.getStringValue())); } }
}).orElse(new Supplier<Option<AttachmentArchive>>()
private HelpUrlsParser createHelpUrlParser(final LoaderKey key) { return parserBuilderFactory.newBuilder() .defaultUrl(DEFAULT_HELP_URL, i18n.getInstance(key.locale).getText("jira.help.paths.help.title")) .applicationHelpSpace(applicationHelpSpaceProvider.getHelpSpace(key.applicationKey) // if application does not define help space uri fallback to core .orElse(applicationHelpSpaceProvider.getHelpSpace(ApplicationKeys.CORE))) .build(); }