Search in sources :

Example 1 with RequiresEnterpriseLicense

use of org.mule.runtime.extension.api.annotation.license.RequiresEnterpriseLicense in project mule by mulesoft.

the class DefaultJavaModelLoaderDelegate method processLicenseRequirements.

private void processLicenseRequirements(ExtensionDeclarer declarer) {
    Optional<RequiresEntitlement> requiresEntitlementOptional = extensionElement.getAnnotation(RequiresEntitlement.class);
    Optional<RequiresEnterpriseLicense> requiresEnterpriseLicenseOptional = extensionElement.getAnnotation(RequiresEnterpriseLicense.class);
    boolean requiresEnterpriseLicense = requiresEnterpriseLicenseOptional.isPresent();
    boolean allowsEvaluationLicense = requiresEnterpriseLicenseOptional.map(RequiresEnterpriseLicense::allowEvaluationLicense).orElse(true);
    Optional<String> requiredEntitlement = requiresEntitlementOptional.map(RequiresEntitlement::name);
    declarer.withModelProperty(new LicenseModelProperty(requiresEnterpriseLicense, allowsEvaluationLicense, requiredEntitlement));
}
Also used : RequiresEnterpriseLicense(org.mule.runtime.extension.api.annotation.license.RequiresEnterpriseLicense) RequiresEntitlement(org.mule.runtime.extension.api.annotation.license.RequiresEntitlement) LicenseModelProperty(org.mule.runtime.module.extension.internal.loader.java.property.LicenseModelProperty)

Aggregations

RequiresEnterpriseLicense (org.mule.runtime.extension.api.annotation.license.RequiresEnterpriseLicense)1 RequiresEntitlement (org.mule.runtime.extension.api.annotation.license.RequiresEntitlement)1 LicenseModelProperty (org.mule.runtime.module.extension.internal.loader.java.property.LicenseModelProperty)1