All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.customware.license.atlassian.restriction.SupportEntitlementNumberRestriction Maven / Gradle / Ivy

The newest version!
package net.customware.license.atlassian.restriction;

import net.customware.license.support.simple.SimpleLicenseContent;
import net.customware.license.support.simple.SimpleRestrictionException;

public class SupportEntitlementNumberRestriction extends AbstractLicenseRestriction {

    @Override
    protected void checkRestriction(Object context, SimpleLicenseContent content, Object attributeValue) throws SimpleRestrictionException {
        com.atlassian.license.License license = getLicense(context);
        String sen = (String) attributeValue;
        if (sen != null && sen.equals(license.getSupportEntitlementNumber()))
            throw new SimpleRestrictionException("This license is issued to the instance with the Support Entitlement Number:  " + sen + ", however, the detected Support Entitlement Number for this installation is: " + license.getSupportEntitlementNumber() + ".");
    }

    public static void setSupportEntitlementNumber(SimpleLicenseContent content, String sen) {
        content.setAttribute(SupportEntitlementNumberRestriction.class, sen);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy