diff --git a/bundles/org.eclipse.passage.lbc.base/src/org/eclipse/passage/lbc/internal/base/mine/PersonalLicenseGenerated.java b/bundles/org.eclipse.passage.lbc.base/src/org/eclipse/passage/lbc/internal/base/mine/PersonalLicenseGenerated.java index 9cb00addc..b8a48b968 100644 --- a/bundles/org.eclipse.passage.lbc.base/src/org/eclipse/passage/lbc/internal/base/mine/PersonalLicenseGenerated.java +++ b/bundles/org.eclipse.passage.lbc.base/src/org/eclipse/passage/lbc/internal/base/mine/PersonalLicenseGenerated.java @@ -64,14 +64,16 @@ private LicenseGrant grant(Condition condition) { LicensesFactory licenseFactory = LicensesFactory.eINSTANCE; LicenseGrant grant = licenseFactory.createLicenseGrant(); grant.setIdentifier(condition.identifier()); - grant.setFeatureIdentifier(condition.feature()); - grant.setMatchVersion(condition.versionMatch().version()); - grant.setMatchRule(condition.versionMatch().rule().identifier()); + grant.getFeature().setIdentifier(condition.feature()); + grant.getFeature().setVersion(condition.versionMatch().version()); + grant.getFeature().setMatchingRule(condition.versionMatch().rule().identifier()); grant.setCapacity(1); - grant.setConditionExpression(condition.evaluationInstructions().expression()); - grant.setConditionType(condition.evaluationInstructions().type().identifier()); - grant.setValidFrom(date(condition, ValidityPeriodClosed::from)); - grant.setValidUntil(date(condition, ValidityPeriodClosed::to)); + grant.getUserAuthentication().setExpression(condition.evaluationInstructions().expression()); + grant.getUserAuthentication().setType(condition.evaluationInstructions().type().identifier()); + ((org.eclipse.passage.lic.licenses.model.api.ValidityPeriodClosed) grant.getValid()) + .setFrom(date(condition, ValidityPeriodClosed::from)); + ((org.eclipse.passage.lic.licenses.model.api.ValidityPeriodClosed) grant.getValid()) + .setUntil(date(condition, ValidityPeriodClosed::to)); return grant; } diff --git a/bundles/org.eclipse.passage.lic.emf/src/org/eclipse/passage/lic/emf/migration/EnsureStructure.java b/bundles/org.eclipse.passage.lic.emf/src/org/eclipse/passage/lic/emf/migration/EnsureStructure.java new file mode 100644 index 000000000..d80cdf4df --- /dev/null +++ b/bundles/org.eclipse.passage.lic.emf/src/org/eclipse/passage/lic/emf/migration/EnsureStructure.java @@ -0,0 +1,27 @@ +/******************************************************************************* + * Copyright (c) 2021 ArSysOp + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * https://www.eclipse.org/legal/epl-2.0/. + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * ArSysOp - initial API and implementation + *******************************************************************************/ +package org.eclipse.passage.lic.emf.migration; + +import java.util.List; +import java.util.function.Function; + +import org.eclipse.emf.ecore.EObject; + +/** + * Helps to ensure that inner data structures exists for the given EObject + * + * @since 2.0 + */ +public interface EnsureStructure extends Function> { + +} diff --git a/bundles/org.eclipse.passage.lic.emf/src/org/eclipse/passage/lic/emf/xmi/MigratingResourceHandler.java b/bundles/org.eclipse.passage.lic.emf/src/org/eclipse/passage/lic/emf/xmi/MigratingResourceHandler.java index d41ab9d96..c91b2a0ec 100644 --- a/bundles/org.eclipse.passage.lic.emf/src/org/eclipse/passage/lic/emf/xmi/MigratingResourceHandler.java +++ b/bundles/org.eclipse.passage.lic.emf/src/org/eclipse/passage/lic/emf/xmi/MigratingResourceHandler.java @@ -20,6 +20,9 @@ import org.eclipse.emf.ecore.xmi.XMLResource; import org.eclipse.emf.ecore.xmi.impl.BasicResourceHandler; import org.eclipse.emf.ecore.xml.type.AnyType; +import org.eclipse.passage.lic.emf.migration.EFeatureRoutes; +import org.eclipse.passage.lic.emf.migration.EnsureStructure; +import org.eclipse.passage.lic.internal.emf.migration.RecognizeFeatures; /** * Adds hooks for migrating legacy data @@ -43,5 +46,11 @@ public void postLoad(XMLResource resource, InputStream inputStream, Map op resource.getEObjectToExtensionMap().entrySet().forEach(this::convertEntry); } - protected abstract void convertEntry(Entry entry); + protected void convertEntry(Entry entry) { + new RecognizeFeatures(entry.getValue(), attributes(), structures()).mixed(entry.getKey()); + } + + protected abstract EFeatureRoutes attributes(); + + protected abstract EnsureStructure structures(); } diff --git a/bundles/org.eclipse.passage.lic.emf/src/org/eclipse/passage/lic/internal/emf/migration/RecognizeFeatures.java b/bundles/org.eclipse.passage.lic.emf/src/org/eclipse/passage/lic/internal/emf/migration/RecognizeFeatures.java index 8e846aa76..7b8030707 100644 --- a/bundles/org.eclipse.passage.lic.emf/src/org/eclipse/passage/lic/internal/emf/migration/RecognizeFeatures.java +++ b/bundles/org.eclipse.passage.lic.emf/src/org/eclipse/passage/lic/internal/emf/migration/RecognizeFeatures.java @@ -28,6 +28,7 @@ import org.eclipse.emf.ecore.util.FeatureMap.Entry; import org.eclipse.emf.ecore.xml.type.AnyType; import org.eclipse.passage.lic.emf.migration.EFeatureRoutes; +import org.eclipse.passage.lic.emf.migration.EnsureStructure; /** * @since 2.0 @@ -36,16 +37,18 @@ public final class RecognizeFeatures { private final AnyType any; private final EFeatureRoutes features; + private final EnsureStructure ensure; - public RecognizeFeatures(AnyType any, EFeatureRoutes features) { + public RecognizeFeatures(AnyType any, EFeatureRoutes features, EnsureStructure ensure) { Objects.requireNonNull(any, "ApplyFeatureMap::any"); //$NON-NLS-1$ Objects.requireNonNull(features, "ApplyFeatureMap::features"); //$NON-NLS-1$ this.any = any; this.features = features; + this.ensure = ensure; } @SuppressWarnings("unchecked") - public RecognizeFeatures mixed(EObject object) { + public void mixed(EObject object) { EList references = object.eClass().getEAllReferences(); for (Iterator iterator = any.getMixed().iterator(); iterator.hasNext();) { Entry entry = iterator.next(); @@ -60,7 +63,9 @@ public RecognizeFeatures mixed(EObject object) { if (value instanceof AnyType) { AnyType child = (AnyType) value; EObject created = type.getEPackage().getEFactoryInstance().create(type); - new RecognizeFeatures(child, features).attributes(created); + RecognizeFeatures restore = new RecognizeFeatures(child, features, ensure); + restore.attributes(created); + ensure.apply(created).forEach(restore::attributes); if (feature.isMany()) { ((List) object.eGet(feature)).add(created); } else { @@ -68,7 +73,7 @@ public RecognizeFeatures mixed(EObject object) { } } } - return this; + ensure.apply(object).forEach(this::attributes); } private Optional candidate(EObject object, Entry entry, @@ -77,7 +82,7 @@ private Optional candidate(EObject object, Entry entry, .filter(all::contains); } - public RecognizeFeatures attributes(EObject object) { + public void attributes(EObject object) { EList attributes = object.eClass().getEAllAttributes(); for (Iterator iterator = any.getAnyAttribute().iterator(); iterator.hasNext();) { Entry entry = iterator.next(); @@ -92,7 +97,6 @@ public RecognizeFeatures attributes(EObject object) { String.valueOf(entry.getValue())); object.eSet(feature, value); } - return this; } } diff --git a/bundles/org.eclipse.passage.lic.features.model/src/org/eclipse/passage/lic/internal/features/model/migration/FeaturesResourceHandler.java b/bundles/org.eclipse.passage.lic.features.model/src/org/eclipse/passage/lic/internal/features/model/migration/FeaturesResourceHandler.java index 432223e8f..843659851 100644 --- a/bundles/org.eclipse.passage.lic.features.model/src/org/eclipse/passage/lic/internal/features/model/migration/FeaturesResourceHandler.java +++ b/bundles/org.eclipse.passage.lic.features.model/src/org/eclipse/passage/lic/internal/features/model/migration/FeaturesResourceHandler.java @@ -12,14 +12,15 @@ *******************************************************************************/ package org.eclipse.passage.lic.internal.features.model.migration; -import java.util.Map.Entry; +import java.util.Collections; -import org.eclipse.emf.ecore.EObject; import org.eclipse.emf.ecore.EPackage; -import org.eclipse.emf.ecore.xml.type.AnyType; import org.eclipse.passage.lic.emf.migration.DelegateClassifiers; import org.eclipse.passage.lic.emf.migration.EClassRoutes; +import org.eclipse.passage.lic.emf.migration.EFeatureRoutes; +import org.eclipse.passage.lic.emf.migration.EnsureStructure; import org.eclipse.passage.lic.emf.migration.SimpleClassRoutes; +import org.eclipse.passage.lic.emf.migration.SimpleFeatureRoutes; import org.eclipse.passage.lic.emf.xmi.MigratingResourceHandler; import org.eclipse.passage.lic.features.model.meta.FeaturesPackage; @@ -32,8 +33,13 @@ protected void ensureMigrations() { } @Override - protected void convertEntry(Entry entry) { - // not yet needed + protected EFeatureRoutes attributes() { + return new SimpleFeatureRoutes(); + } + + @Override + protected EnsureStructure structures() { + return e -> Collections.emptyList(); } private void migrate033() { diff --git a/bundles/org.eclipse.passage.lic.licenses.ecore/model/licenses.ecore b/bundles/org.eclipse.passage.lic.licenses.ecore/model/licenses.ecore index 53cc478ce..b94e9b7be 100644 --- a/bundles/org.eclipse.passage.lic.licenses.ecore/model/licenses.ecore +++ b/bundles/org.eclipse.passage.lic.licenses.ecore/model/licenses.ecore @@ -6,13 +6,15 @@ abstract="true" interface="true"/> - + - @@ -53,15 +55,12 @@ eType="#//FloatingLicensePack" containment="true"/> - - - + - + - - - - - - - + + + + + + + - + - + + + * + * @generated + */ +public class FeatureRefItemProvider extends ItemProviderAdapter implements IEditingDomainItemProvider, + IStructuredItemContentProvider, ITreeItemContentProvider, IItemLabelProvider, IItemPropertySource { + /** + * This constructs an instance from a factory and a notifier. + * + * + * @generated + */ + public FeatureRefItemProvider(AdapterFactory adapterFactory) { + super(adapterFactory); + } + + /** + * This returns the property descriptors for the adapted class. + * + * + * @generated + */ + @Override + public List getPropertyDescriptors(Object object) { + if (itemPropertyDescriptors == null) { + super.getPropertyDescriptors(object); + + addIdentifierPropertyDescriptor(object); + addVersionPropertyDescriptor(object); + addMatchingRulePropertyDescriptor(object); + } + return itemPropertyDescriptors; + } + + /** + * This adds a property descriptor for the Identifier feature. + * + * + * @generated + */ + protected void addIdentifierPropertyDescriptor(Object object) { + itemPropertyDescriptors + .add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), + getResourceLocator(), getString("_UI_FeatureRef_identifier_feature"), //$NON-NLS-1$ + getString("_UI_PropertyDescriptor_description", "_UI_FeatureRef_identifier_feature", //$NON-NLS-1$//$NON-NLS-2$ + "_UI_FeatureRef_type"), //$NON-NLS-1$ + LicensesPackage.eINSTANCE.getFeatureRef_Identifier(), true, false, false, + ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); + } + + /** + * This adds a property descriptor for the Version feature. + * + * + * @generated + */ + protected void addVersionPropertyDescriptor(Object object) { + itemPropertyDescriptors + .add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), + getResourceLocator(), getString("_UI_FeatureRef_version_feature"), //$NON-NLS-1$ + getString("_UI_PropertyDescriptor_description", "_UI_FeatureRef_version_feature", //$NON-NLS-1$//$NON-NLS-2$ + "_UI_FeatureRef_type"), //$NON-NLS-1$ + LicensesPackage.eINSTANCE.getFeatureRef_Version(), true, false, false, + ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); + } + + /** + * This adds a property descriptor for the Matching Rule feature. + * + * + * @generated + */ + protected void addMatchingRulePropertyDescriptor(Object object) { + itemPropertyDescriptors + .add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), + getResourceLocator(), getString("_UI_FeatureRef_matchingRule_feature"), //$NON-NLS-1$ + getString("_UI_PropertyDescriptor_description", "_UI_FeatureRef_matchingRule_feature", //$NON-NLS-1$//$NON-NLS-2$ + "_UI_FeatureRef_type"), //$NON-NLS-1$ + LicensesPackage.eINSTANCE.getFeatureRef_MatchingRule(), true, false, false, + ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); + } + + /** + * This returns FeatureRef.gif. + * + * + * @generated + */ + @Override + public Object getImage(Object object) { + return overlayImage(object, getResourceLocator().getImage("full/obj16/FeatureRef")); //$NON-NLS-1$ + } + + /** + * + * + * @generated + */ + @Override + protected boolean shouldComposeCreationImage() { + return true; + } + + /** + * This returns the label text for the adapted class. + * + * + * @generated + */ + @Override + public String getText(Object object) { + String label = ((FeatureRef) object).getIdentifier(); + return label == null || label.length() == 0 ? getString("_UI_FeatureRef_type") : //$NON-NLS-1$ + getString("_UI_FeatureRef_type") + " " + label; //$NON-NLS-1$ //$NON-NLS-2$ + } + + /** + * This handles model notifications by calling {@link #updateChildren} to update any cached + * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}. + * + * + * @generated + */ + @Override + public void notifyChanged(Notification notification) { + updateChildren(notification); + + switch (notification.getFeatureID(FeatureRef.class)) { + case LicensesPackage.FEATURE_REF__IDENTIFIER: + case LicensesPackage.FEATURE_REF__VERSION: + case LicensesPackage.FEATURE_REF__MATCHING_RULE: + fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true)); + return; + default: + super.notifyChanged(notification); + return; + } + } + + /** + * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children + * that can be created under this object. + * + * + * @generated + */ + @Override + protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { + super.collectNewChildDescriptors(newChildDescriptors, object); + } + + /** + * Return the resource locator for this item provider's resources. + * + * + * @generated + */ + @Override + public ResourceLocator getResourceLocator() { + return LicensesEditPlugin.INSTANCE; + } + +} diff --git a/bundles/org.eclipse.passage.lic.licenses.edit/src-gen/org/eclipse/passage/lic/licenses/edit/providers/LicenseGrantItemProvider.java b/bundles/org.eclipse.passage.lic.licenses.edit/src-gen/org/eclipse/passage/lic/licenses/edit/providers/LicenseGrantItemProvider.java index 66175368e..08e14b7f9 100644 --- a/bundles/org.eclipse.passage.lic.licenses.edit/src-gen/org/eclipse/passage/lic/licenses/edit/providers/LicenseGrantItemProvider.java +++ b/bundles/org.eclipse.passage.lic.licenses.edit/src-gen/org/eclipse/passage/lic/licenses/edit/providers/LicenseGrantItemProvider.java @@ -21,6 +21,7 @@ import org.eclipse.emf.common.notify.AdapterFactory; import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.common.util.ResourceLocator; +import org.eclipse.emf.ecore.EStructuralFeature; import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; import org.eclipse.emf.edit.provider.IItemLabelProvider; @@ -33,6 +34,8 @@ import org.eclipse.emf.edit.provider.ViewerNotification; import org.eclipse.passage.lic.licenses.edit.LicensesEditPlugin; import org.eclipse.passage.lic.licenses.model.api.LicenseGrant; +import org.eclipse.passage.lic.licenses.model.api.ValidityPeriodClosed; +import org.eclipse.passage.lic.licenses.model.meta.LicensesFactory; import org.eclipse.passage.lic.licenses.model.meta.LicensesPackage; /** @@ -68,13 +71,6 @@ public List getPropertyDescriptors(Object object) { super.getPropertyDescriptors(object); addIdentifierPropertyDescriptor(object); - addFeatureIdentifierPropertyDescriptor(object); - addMatchVersionPropertyDescriptor(object); - addMatchRulePropertyDescriptor(object); - addValidFromPropertyDescriptor(object); - addValidUntilPropertyDescriptor(object); - addConditionTypePropertyDescriptor(object); - addConditionExpressionPropertyDescriptor(object); addCapacityPropertyDescriptor(object); } return itemPropertyDescriptors; @@ -98,139 +94,52 @@ protected void addIdentifierPropertyDescriptor(Object object) { } /** - * This adds a property descriptor for the Feature Identifier feature. - * - * - * - * @generated - */ - protected void addFeatureIdentifierPropertyDescriptor(Object object) { - itemPropertyDescriptors - .add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), - getResourceLocator(), getString("_UI_LicenseGrant_featureIdentifier_feature"), //$NON-NLS-1$ - getString("_UI_PropertyDescriptor_description", "_UI_LicenseGrant_featureIdentifier_feature", //$NON-NLS-1$//$NON-NLS-2$ - "_UI_LicenseGrant_type"), //$NON-NLS-1$ - LicensesPackage.eINSTANCE.getLicenseGrant_FeatureIdentifier(), true, false, false, - ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); - } - - /** - * This adds a property descriptor for the Match Version feature. - * - * - * - * @generated - */ - protected void addMatchVersionPropertyDescriptor(Object object) { - itemPropertyDescriptors - .add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), - getResourceLocator(), getString("_UI_LicenseGrant_matchVersion_feature"), //$NON-NLS-1$ - getString("_UI_PropertyDescriptor_description", "_UI_LicenseGrant_matchVersion_feature", //$NON-NLS-1$//$NON-NLS-2$ - "_UI_LicenseGrant_type"), //$NON-NLS-1$ - LicensesPackage.eINSTANCE.getLicenseGrant_MatchVersion(), true, false, false, - ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); - } - - /** - * This adds a property descriptor for the Match Rule feature. - * - * - * - * @generated - */ - protected void addMatchRulePropertyDescriptor(Object object) { - itemPropertyDescriptors - .add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), - getResourceLocator(), getString("_UI_LicenseGrant_matchRule_feature"), //$NON-NLS-1$ - getString("_UI_PropertyDescriptor_description", "_UI_LicenseGrant_matchRule_feature", //$NON-NLS-1$//$NON-NLS-2$ - "_UI_LicenseGrant_type"), //$NON-NLS-1$ - LicensesPackage.eINSTANCE.getLicenseGrant_MatchRule(), true, false, false, - ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); - } - - /** - * This adds a property descriptor for the Valid From feature. - * - * - * - * @generated - */ - protected void addValidFromPropertyDescriptor(Object object) { - itemPropertyDescriptors - .add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), - getResourceLocator(), getString("_UI_LicenseGrant_validFrom_feature"), //$NON-NLS-1$ - getString("_UI_PropertyDescriptor_description", "_UI_LicenseGrant_validFrom_feature", //$NON-NLS-1$//$NON-NLS-2$ - "_UI_LicenseGrant_type"), //$NON-NLS-1$ - LicensesPackage.eINSTANCE.getLicenseGrant_ValidFrom(), true, false, false, - ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); - } - - /** - * This adds a property descriptor for the Valid Until feature. + * This adds a property descriptor for the Capacity feature. * * * * @generated */ - protected void addValidUntilPropertyDescriptor(Object object) { + protected void addCapacityPropertyDescriptor(Object object) { itemPropertyDescriptors .add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), - getResourceLocator(), getString("_UI_LicenseGrant_validUntil_feature"), //$NON-NLS-1$ - getString("_UI_PropertyDescriptor_description", "_UI_LicenseGrant_validUntil_feature", //$NON-NLS-1$//$NON-NLS-2$ + getResourceLocator(), getString("_UI_LicenseGrant_capacity_feature"), //$NON-NLS-1$ + getString("_UI_PropertyDescriptor_description", "_UI_LicenseGrant_capacity_feature", //$NON-NLS-1$//$NON-NLS-2$ "_UI_LicenseGrant_type"), //$NON-NLS-1$ - LicensesPackage.eINSTANCE.getLicenseGrant_ValidUntil(), true, false, false, - ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); + LicensesPackage.eINSTANCE.getLicenseGrant_Capacity(), true, false, false, + ItemPropertyDescriptor.INTEGRAL_VALUE_IMAGE, null, null)); } /** - * This adds a property descriptor for the Condition Type feature. + * This specifies how to implement {@link #getChildren} and is used to deduce an appropriate feature for an + * {@link org.eclipse.emf.edit.command.AddCommand}, {@link org.eclipse.emf.edit.command.RemoveCommand} or + * {@link org.eclipse.emf.edit.command.MoveCommand} in {@link #createCommand}. * - * * * @generated */ - protected void addConditionTypePropertyDescriptor(Object object) { - itemPropertyDescriptors - .add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), - getResourceLocator(), getString("_UI_LicenseGrant_conditionType_feature"), //$NON-NLS-1$ - getString("_UI_PropertyDescriptor_description", "_UI_LicenseGrant_conditionType_feature", //$NON-NLS-1$//$NON-NLS-2$ - "_UI_LicenseGrant_type"), //$NON-NLS-1$ - LicensesPackage.eINSTANCE.getLicenseGrant_ConditionType(), true, false, false, - ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); + @Override + public Collection getChildrenFeatures(Object object) { + if (childrenFeatures == null) { + super.getChildrenFeatures(object); + childrenFeatures.add(LicensesPackage.eINSTANCE.getLicenseGrant_Feature()); + childrenFeatures.add(LicensesPackage.eINSTANCE.getLicenseGrant_Valid()); + childrenFeatures.add(LicensesPackage.eINSTANCE.getLicenseGrant_UserAuthentication()); + } + return childrenFeatures; } /** - * This adds a property descriptor for the Condition Expression feature. * - * * * @generated */ - protected void addConditionExpressionPropertyDescriptor(Object object) { - itemPropertyDescriptors - .add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), - getResourceLocator(), getString("_UI_LicenseGrant_conditionExpression_feature"), //$NON-NLS-1$ - getString("_UI_PropertyDescriptor_description", "_UI_LicenseGrant_conditionExpression_feature", //$NON-NLS-1$//$NON-NLS-2$ - "_UI_LicenseGrant_type"), //$NON-NLS-1$ - LicensesPackage.eINSTANCE.getLicenseGrant_ConditionExpression(), true, false, false, - ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); - } + @Override + protected EStructuralFeature getChildFeature(Object object, Object child) { + // Check the type of the specified child object and return the proper feature to use for + // adding (see {@link AddCommand}) it as a child. - /** - * This adds a property descriptor for the Capacity feature. - * - * - * - * @generated - */ - protected void addCapacityPropertyDescriptor(Object object) { - itemPropertyDescriptors - .add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), - getResourceLocator(), getString("_UI_LicenseGrant_capacity_feature"), //$NON-NLS-1$ - getString("_UI_PropertyDescriptor_description", "_UI_LicenseGrant_capacity_feature", //$NON-NLS-1$//$NON-NLS-2$ - "_UI_LicenseGrant_type"), //$NON-NLS-1$ - LicensesPackage.eINSTANCE.getLicenseGrant_Capacity(), true, false, false, - ItemPropertyDescriptor.INTEGRAL_VALUE_IMAGE, null, null)); + return super.getChildFeature(object, child); } /** @@ -272,15 +181,15 @@ public String getText(Object object) { String unknownDate = String.valueOf('?'); String from = unknownDate; String until = unknownDate; - LicenseGrant licenseGrant = (LicenseGrant) object; - String feature = licenseGrant.getFeatureIdentifier(); - String version = licenseGrant.getMatchVersion(); - String rule = licenseGrant.getMatchRule(); - Date validFrom = licenseGrant.getValidFrom(); + LicenseGrant grant = (LicenseGrant) object; + String feature = grant.getFeature().getIdentifier(); + String version = grant.getFeature().getVersion(); + String rule = grant.getFeature().getMatchingRule(); + Date validFrom = ((ValidityPeriodClosed) grant.getValid()).getFrom(); if (validFrom != null) { from = LocalDateTime.ofInstant(validFrom.toInstant(), ZoneId.systemDefault()).toLocalDate().toString(); } - Date validUntil = licenseGrant.getValidUntil(); + Date validUntil = ((ValidityPeriodClosed) grant.getValid()).getUntil(); if (validUntil != null) { until = LocalDateTime.ofInstant(validUntil.toInstant(), ZoneId.systemDefault()).toLocalDate().toString(); } @@ -306,16 +215,14 @@ public void notifyChanged(Notification notification) { switch (notification.getFeatureID(LicenseGrant.class)) { case LicensesPackage.LICENSE_GRANT__IDENTIFIER: - case LicensesPackage.LICENSE_GRANT__FEATURE_IDENTIFIER: - case LicensesPackage.LICENSE_GRANT__MATCH_VERSION: - case LicensesPackage.LICENSE_GRANT__MATCH_RULE: - case LicensesPackage.LICENSE_GRANT__VALID_FROM: - case LicensesPackage.LICENSE_GRANT__VALID_UNTIL: - case LicensesPackage.LICENSE_GRANT__CONDITION_TYPE: - case LicensesPackage.LICENSE_GRANT__CONDITION_EXPRESSION: case LicensesPackage.LICENSE_GRANT__CAPACITY: fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true)); return; + case LicensesPackage.LICENSE_GRANT__FEATURE: + case LicensesPackage.LICENSE_GRANT__VALID: + case LicensesPackage.LICENSE_GRANT__USER_AUTHENTICATION: + fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false)); + return; default: super.notifyChanged(notification); return; @@ -333,6 +240,15 @@ public void notifyChanged(Notification notification) { @Override protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { super.collectNewChildDescriptors(newChildDescriptors, object); + + newChildDescriptors.add(createChildParameter(LicensesPackage.eINSTANCE.getLicenseGrant_Feature(), + LicensesFactory.eINSTANCE.createFeatureRef())); + + newChildDescriptors.add(createChildParameter(LicensesPackage.eINSTANCE.getLicenseGrant_Valid(), + LicensesFactory.eINSTANCE.createValidityPeriodClosed())); + + newChildDescriptors.add(createChildParameter(LicensesPackage.eINSTANCE.getLicenseGrant_UserAuthentication(), + LicensesFactory.eINSTANCE.createEvaluationInstructions())); } /** diff --git a/bundles/org.eclipse.passage.lic.licenses.edit/src-gen/org/eclipse/passage/lic/licenses/edit/providers/LicensePlanFeatureItemProvider.java b/bundles/org.eclipse.passage.lic.licenses.edit/src-gen/org/eclipse/passage/lic/licenses/edit/providers/LicensePlanFeatureItemProvider.java index 010051cc2..a7b855225 100644 --- a/bundles/org.eclipse.passage.lic.licenses.edit/src-gen/org/eclipse/passage/lic/licenses/edit/providers/LicensePlanFeatureItemProvider.java +++ b/bundles/org.eclipse.passage.lic.licenses.edit/src-gen/org/eclipse/passage/lic/licenses/edit/providers/LicensePlanFeatureItemProvider.java @@ -18,6 +18,7 @@ import org.eclipse.emf.common.notify.AdapterFactory; import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.common.util.ResourceLocator; +import org.eclipse.emf.ecore.EStructuralFeature; import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; import org.eclipse.emf.edit.provider.IItemLabelProvider; @@ -25,11 +26,11 @@ import org.eclipse.emf.edit.provider.IItemPropertySource; import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; import org.eclipse.emf.edit.provider.ITreeItemContentProvider; -import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; import org.eclipse.emf.edit.provider.ItemProviderAdapter; import org.eclipse.emf.edit.provider.ViewerNotification; import org.eclipse.passage.lic.licenses.edit.LicensesEditPlugin; import org.eclipse.passage.lic.licenses.model.api.LicensePlanFeature; +import org.eclipse.passage.lic.licenses.model.meta.LicensesFactory; import org.eclipse.passage.lic.licenses.model.meta.LicensesPackage; /** @@ -61,75 +62,54 @@ public List getPropertyDescriptors(Object object) { if (itemPropertyDescriptors == null) { super.getPropertyDescriptors(object); - addFeatureIdentifierPropertyDescriptor(object); - addMatchVersionPropertyDescriptor(object); - addMatchRulePropertyDescriptor(object); addLicensePlanPropertyDescriptor(object); } return itemPropertyDescriptors; } /** - * This adds a property descriptor for the Feature Identifier feature. + * This adds a property descriptor for the License Plan feature. * * * @generated */ - protected void addFeatureIdentifierPropertyDescriptor(Object object) { - itemPropertyDescriptors - .add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), - getResourceLocator(), getString("_UI_LicensePlanFeature_featureIdentifier_feature"), //$NON-NLS-1$ - getString("_UI_PropertyDescriptor_description", //$NON-NLS-1$ - "_UI_LicensePlanFeature_featureIdentifier_feature", "_UI_LicensePlanFeature_type"), //$NON-NLS-1$ //$NON-NLS-2$ - LicensesPackage.eINSTANCE.getLicensePlanFeature_FeatureIdentifier(), true, false, false, - ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); + protected void addLicensePlanPropertyDescriptor(Object object) { + itemPropertyDescriptors.add(createItemPropertyDescriptor( + ((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getResourceLocator(), + getString("_UI_LicensePlanFeature_licensePlan_feature"), //$NON-NLS-1$ + getString("_UI_PropertyDescriptor_description", "_UI_LicensePlanFeature_licensePlan_feature", //$NON-NLS-1$//$NON-NLS-2$ + "_UI_LicensePlanFeature_type"), //$NON-NLS-1$ + LicensesPackage.eINSTANCE.getLicensePlanFeature_LicensePlan(), true, false, true, null, null, null)); } /** - * This adds a property descriptor for the Match Version feature. + * This specifies how to implement {@link #getChildren} and is used to deduce an appropriate feature for an + * {@link org.eclipse.emf.edit.command.AddCommand}, {@link org.eclipse.emf.edit.command.RemoveCommand} or + * {@link org.eclipse.emf.edit.command.MoveCommand} in {@link #createCommand}. * * * @generated */ - protected void addMatchVersionPropertyDescriptor(Object object) { - itemPropertyDescriptors - .add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), - getResourceLocator(), getString("_UI_LicensePlanFeature_matchVersion_feature"), //$NON-NLS-1$ - getString("_UI_PropertyDescriptor_description", "_UI_LicensePlanFeature_matchVersion_feature", //$NON-NLS-1$//$NON-NLS-2$ - "_UI_LicensePlanFeature_type"), //$NON-NLS-1$ - LicensesPackage.eINSTANCE.getLicensePlanFeature_MatchVersion(), true, false, false, - ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); + @Override + public Collection getChildrenFeatures(Object object) { + if (childrenFeatures == null) { + super.getChildrenFeatures(object); + childrenFeatures.add(LicensesPackage.eINSTANCE.getLicensePlanFeature_Feature()); + } + return childrenFeatures; } /** - * This adds a property descriptor for the Match Rule feature. * * * @generated */ - protected void addMatchRulePropertyDescriptor(Object object) { - itemPropertyDescriptors - .add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), - getResourceLocator(), getString("_UI_LicensePlanFeature_matchRule_feature"), //$NON-NLS-1$ - getString("_UI_PropertyDescriptor_description", "_UI_LicensePlanFeature_matchRule_feature", //$NON-NLS-1$//$NON-NLS-2$ - "_UI_LicensePlanFeature_type"), //$NON-NLS-1$ - LicensesPackage.eINSTANCE.getLicensePlanFeature_MatchRule(), true, false, false, - ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); - } + @Override + protected EStructuralFeature getChildFeature(Object object, Object child) { + // Check the type of the specified child object and return the proper feature to use for + // adding (see {@link AddCommand}) it as a child. - /** - * This adds a property descriptor for the License Plan feature. - * - * - * @generated - */ - protected void addLicensePlanPropertyDescriptor(Object object) { - itemPropertyDescriptors.add(createItemPropertyDescriptor( - ((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getResourceLocator(), - getString("_UI_LicensePlanFeature_licensePlan_feature"), //$NON-NLS-1$ - getString("_UI_PropertyDescriptor_description", "_UI_LicensePlanFeature_licensePlan_feature", //$NON-NLS-1$//$NON-NLS-2$ - "_UI_LicensePlanFeature_type"), //$NON-NLS-1$ - LicensesPackage.eINSTANCE.getLicensePlanFeature_LicensePlan(), true, false, true, null, null, null)); + return super.getChildFeature(object, child); } /** @@ -164,12 +144,12 @@ protected boolean shouldComposeCreationImage() { */ @Override public String getText(Object object) { - LicensePlanFeature licensePlanFeature = (LicensePlanFeature) object; - String identifier = licensePlanFeature.getFeatureIdentifier(); + LicensePlanFeature planFeature = (LicensePlanFeature) object; + String identifier = planFeature.getFeature().getIdentifier(); if (identifier == null || identifier.length() == 0) { identifier = getString("_UI_LicensePlanFeature_type"); //$NON-NLS-1$ } - String version = licensePlanFeature.getMatchVersion(); + String version = planFeature.getFeature().getVersion(); if (version == null || version.length() == 0) { return identifier; } @@ -188,10 +168,8 @@ public void notifyChanged(Notification notification) { updateChildren(notification); switch (notification.getFeatureID(LicensePlanFeature.class)) { - case LicensesPackage.LICENSE_PLAN_FEATURE__FEATURE_IDENTIFIER: - case LicensesPackage.LICENSE_PLAN_FEATURE__MATCH_VERSION: - case LicensesPackage.LICENSE_PLAN_FEATURE__MATCH_RULE: - fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true)); + case LicensesPackage.LICENSE_PLAN_FEATURE__FEATURE: + fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false)); return; default: super.notifyChanged(notification); @@ -209,6 +187,9 @@ public void notifyChanged(Notification notification) { @Override protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { super.collectNewChildDescriptors(newChildDescriptors, object); + + newChildDescriptors.add(createChildParameter(LicensesPackage.eINSTANCE.getLicensePlanFeature_Feature(), + LicensesFactory.eINSTANCE.createFeatureRef())); } /** diff --git a/bundles/org.eclipse.passage.lic.licenses.edit/src-gen/org/eclipse/passage/lic/licenses/edit/providers/LicensesItemProviderAdapterFactory.java b/bundles/org.eclipse.passage.lic.licenses.edit/src-gen/org/eclipse/passage/lic/licenses/edit/providers/LicensesItemProviderAdapterFactory.java index 2dda476fd..ddc0d7812 100644 --- a/bundles/org.eclipse.passage.lic.licenses.edit/src-gen/org/eclipse/passage/lic/licenses/edit/providers/LicensesItemProviderAdapterFactory.java +++ b/bundles/org.eclipse.passage.lic.licenses.edit/src-gen/org/eclipse/passage/lic/licenses/edit/providers/LicensesItemProviderAdapterFactory.java @@ -271,6 +271,29 @@ public Adapter createProductRefAdapter() { return productRefItemProvider; } + /** + * This keeps track of the one adapter used for all {@link org.eclipse.passage.lic.licenses.model.api.FeatureRef} instances. + * + * + * @generated + */ + protected FeatureRefItemProvider featureRefItemProvider; + + /** + * This creates an adapter for a {@link org.eclipse.passage.lic.licenses.model.api.FeatureRef}. + * + * + * @generated + */ + @Override + public Adapter createFeatureRefAdapter() { + if (featureRefItemProvider == null) { + featureRefItemProvider = new FeatureRefItemProvider(this); + } + + return featureRefItemProvider; + } + /** * This keeps track of the one adapter used for all {@link org.eclipse.passage.lic.licenses.model.api.UserRef} instances. * @@ -652,10 +675,12 @@ public void dispose() { personalLicenseRequisitesItemProvider.dispose(); if (floatingLicenseRequisitesItemProvider != null) floatingLicenseRequisitesItemProvider.dispose(); - if (productRefItemProvider != null) - productRefItemProvider.dispose(); if (userRefItemProvider != null) userRefItemProvider.dispose(); + if (productRefItemProvider != null) + productRefItemProvider.dispose(); + if (featureRefItemProvider != null) + featureRefItemProvider.dispose(); if (companyRefItemProvider != null) companyRefItemProvider.dispose(); if (floatingServerItemProvider != null) diff --git a/bundles/org.eclipse.passage.lic.licenses.model/model/licenses.genmodel b/bundles/org.eclipse.passage.lic.licenses.model/model/licenses.genmodel index 15b6c74cb..0ef9e523b 100644 --- a/bundles/org.eclipse.passage.lic.licenses.model/model/licenses.genmodel +++ b/bundles/org.eclipse.passage.lic.licenses.model/model/licenses.genmodel @@ -20,10 +20,11 @@ ecorePackage="../../org.eclipse.passage.lic.licenses.ecore/model/licenses.ecore#/"> - + - + + @@ -45,9 +46,7 @@ - - - + @@ -56,13 +55,9 @@ - - - - - - - + + + @@ -85,13 +80,18 @@ + + + + - - - + + + + diff --git a/bundles/org.eclipse.passage.lic.licenses.model/src-gen/org/eclipse/passage/lic/licenses/model/api/FeatureRef.java b/bundles/org.eclipse.passage.lic.licenses.model/src-gen/org/eclipse/passage/lic/licenses/model/api/FeatureRef.java new file mode 100644 index 000000000..397d9077c --- /dev/null +++ b/bundles/org.eclipse.passage.lic.licenses.model/src-gen/org/eclipse/passage/lic/licenses/model/api/FeatureRef.java @@ -0,0 +1,107 @@ +/******************************************************************************* + * Copyright (c) 2018, 2021 ArSysOp + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * https://www.eclipse.org/legal/epl-2.0/. + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * ArSysOp - initial API and implementation + *******************************************************************************/ +package org.eclipse.passage.lic.licenses.model.api; + +import org.eclipse.emf.ecore.EObject; + +import org.eclipse.passage.lic.licenses.FeatureRefDescriptor; + +/** + * + * A representation of the model object 'Feature Ref'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link org.eclipse.passage.lic.licenses.model.api.FeatureRef#getIdentifier Identifier}
  • + *
  • {@link org.eclipse.passage.lic.licenses.model.api.FeatureRef#getVersion Version}
  • + *
  • {@link org.eclipse.passage.lic.licenses.model.api.FeatureRef#getMatchingRule Matching Rule}
  • + *
+ * + * @see org.eclipse.passage.lic.licenses.model.meta.LicensesPackage#getFeatureRef() + * @model superTypes="org.eclipse.passage.lic.licenses.model.api.FeatureRefDescriptor" + * @generated + */ +public interface FeatureRef extends EObject, FeatureRefDescriptor { + /** + * Returns the value of the 'Identifier' attribute. + * + * + * @return the value of the 'Identifier' attribute. + * @see #setIdentifier(String) + * @see org.eclipse.passage.lic.licenses.model.meta.LicensesPackage#getFeatureRef_Identifier() + * @model required="true" + * @generated + */ + @Override + String getIdentifier(); + + /** + * Sets the value of the '{@link org.eclipse.passage.lic.licenses.model.api.FeatureRef#getIdentifier Identifier}' attribute. + * + * + * @param value the new value of the 'Identifier' attribute. + * @see #getIdentifier() + * @generated + */ + void setIdentifier(String value); + + /** + * Returns the value of the 'Version' attribute. + * + * + * @return the value of the 'Version' attribute. + * @see #setVersion(String) + * @see org.eclipse.passage.lic.licenses.model.meta.LicensesPackage#getFeatureRef_Version() + * @model required="true" + * @generated + */ + @Override + String getVersion(); + + /** + * Sets the value of the '{@link org.eclipse.passage.lic.licenses.model.api.FeatureRef#getVersion Version}' attribute. + * + * + * @param value the new value of the 'Version' attribute. + * @see #getVersion() + * @generated + */ + void setVersion(String value); + + /** + * Returns the value of the 'Matching Rule' attribute. + * + * + * @return the value of the 'Matching Rule' attribute. + * @see #setMatchingRule(String) + * @see org.eclipse.passage.lic.licenses.model.meta.LicensesPackage#getFeatureRef_MatchingRule() + * @model required="true" + * @generated + */ + @Override + String getMatchingRule(); + + /** + * Sets the value of the '{@link org.eclipse.passage.lic.licenses.model.api.FeatureRef#getMatchingRule Matching Rule}' attribute. + * + * + * @param value the new value of the 'Matching Rule' attribute. + * @see #getMatchingRule() + * @generated + */ + void setMatchingRule(String value); + +} // FeatureRef diff --git a/bundles/org.eclipse.passage.lic.licenses.model/src-gen/org/eclipse/passage/lic/licenses/model/api/LicenseGrant.java b/bundles/org.eclipse.passage.lic.licenses.model/src-gen/org/eclipse/passage/lic/licenses/model/api/LicenseGrant.java index ed58c17b5..f6082a7be 100644 --- a/bundles/org.eclipse.passage.lic.licenses.model/src-gen/org/eclipse/passage/lic/licenses/model/api/LicenseGrant.java +++ b/bundles/org.eclipse.passage.lic.licenses.model/src-gen/org/eclipse/passage/lic/licenses/model/api/LicenseGrant.java @@ -12,8 +12,6 @@ *******************************************************************************/ package org.eclipse.passage.lic.licenses.model.api; -import java.util.Date; - import org.eclipse.emf.ecore.EObject; import org.eclipse.passage.lic.licenses.LicenseGrantDescriptor; @@ -28,13 +26,9 @@ *

*
    *
  • {@link org.eclipse.passage.lic.licenses.model.api.LicenseGrant#getIdentifier Identifier}
  • - *
  • {@link org.eclipse.passage.lic.licenses.model.api.LicenseGrant#getFeatureIdentifier Feature Identifier}
  • - *
  • {@link org.eclipse.passage.lic.licenses.model.api.LicenseGrant#getMatchVersion Match Version}
  • - *
  • {@link org.eclipse.passage.lic.licenses.model.api.LicenseGrant#getMatchRule Match Rule}
  • - *
  • {@link org.eclipse.passage.lic.licenses.model.api.LicenseGrant#getValidFrom Valid From}
  • - *
  • {@link org.eclipse.passage.lic.licenses.model.api.LicenseGrant#getValidUntil Valid Until}
  • - *
  • {@link org.eclipse.passage.lic.licenses.model.api.LicenseGrant#getConditionType Condition Type}
  • - *
  • {@link org.eclipse.passage.lic.licenses.model.api.LicenseGrant#getConditionExpression Condition Expression}
  • + *
  • {@link org.eclipse.passage.lic.licenses.model.api.LicenseGrant#getFeature Feature}
  • + *
  • {@link org.eclipse.passage.lic.licenses.model.api.LicenseGrant#getValid Valid}
  • + *
  • {@link org.eclipse.passage.lic.licenses.model.api.LicenseGrant#getUserAuthentication User Authentication}
  • *
  • {@link org.eclipse.passage.lic.licenses.model.api.LicenseGrant#getCapacity Capacity}
  • *
  • {@link org.eclipse.passage.lic.licenses.model.api.LicenseGrant#getLicensePack License Pack}
  • *
@@ -68,166 +62,73 @@ public interface LicenseGrant extends EObject, LicenseGrantDescriptor { void setIdentifier(String value); /** - * Returns the value of the 'Feature Identifier' attribute. - * - * - * @return the value of the 'Feature Identifier' attribute. - * @see #setFeatureIdentifier(String) - * @see org.eclipse.passage.lic.licenses.model.meta.LicensesPackage#getLicenseGrant_FeatureIdentifier() - * @model required="true" - * @generated - */ - @Override - String getFeatureIdentifier(); - - /** - * Sets the value of the '{@link org.eclipse.passage.lic.licenses.model.api.LicenseGrant#getFeatureIdentifier Feature Identifier}' attribute. - * - * - * @param value the new value of the 'Feature Identifier' attribute. - * @see #getFeatureIdentifier() - * @generated - */ - void setFeatureIdentifier(String value); - - /** - * Returns the value of the 'Match Version' attribute. - * The default value is "0.0.0". - * - * - * @return the value of the 'Match Version' attribute. - * @see #setMatchVersion(String) - * @see org.eclipse.passage.lic.licenses.model.meta.LicensesPackage#getLicenseGrant_MatchVersion() - * @model default="0.0.0" required="true" - * @generated - */ - @Override - String getMatchVersion(); - - /** - * Sets the value of the '{@link org.eclipse.passage.lic.licenses.model.api.LicenseGrant#getMatchVersion Match Version}' attribute. - * - * - * @param value the new value of the 'Match Version' attribute. - * @see #getMatchVersion() - * @generated - */ - void setMatchVersion(String value); - - /** - * Returns the value of the 'Match Rule' attribute. - * - * - * @return the value of the 'Match Rule' attribute. - * @see #setMatchRule(String) - * @see org.eclipse.passage.lic.licenses.model.meta.LicensesPackage#getLicenseGrant_MatchRule() - * @model - * @generated - */ - @Override - String getMatchRule(); - - /** - * Sets the value of the '{@link org.eclipse.passage.lic.licenses.model.api.LicenseGrant#getMatchRule Match Rule}' attribute. - * - * - * @param value the new value of the 'Match Rule' attribute. - * @see #getMatchRule() - * @generated - */ - void setMatchRule(String value); - - /** - * Returns the value of the 'Valid From' attribute. - * - * - * @return the value of the 'Valid From' attribute. - * @see #setValidFrom(Date) - * @see org.eclipse.passage.lic.licenses.model.meta.LicensesPackage#getLicenseGrant_ValidFrom() - * @model required="true" - * @generated - */ - @Override - Date getValidFrom(); - - /** - * Sets the value of the '{@link org.eclipse.passage.lic.licenses.model.api.LicenseGrant#getValidFrom Valid From}' attribute. - * - * - * @param value the new value of the 'Valid From' attribute. - * @see #getValidFrom() - * @generated - */ - void setValidFrom(Date value); - - /** - * Returns the value of the 'Valid Until' attribute. + * Returns the value of the 'Feature' containment reference. * * - * @return the value of the 'Valid Until' attribute. - * @see #setValidUntil(Date) - * @see org.eclipse.passage.lic.licenses.model.meta.LicensesPackage#getLicenseGrant_ValidUntil() - * @model required="true" + * @return the value of the 'Feature' containment reference. + * @see #setFeature(FeatureRef) + * @see org.eclipse.passage.lic.licenses.model.meta.LicensesPackage#getLicenseGrant_Feature() + * @model containment="true" required="true" * @generated */ @Override - Date getValidUntil(); + FeatureRef getFeature(); /** - * Sets the value of the '{@link org.eclipse.passage.lic.licenses.model.api.LicenseGrant#getValidUntil Valid Until}' attribute. + * Sets the value of the '{@link org.eclipse.passage.lic.licenses.model.api.LicenseGrant#getFeature Feature}' containment reference. * * - * @param value the new value of the 'Valid Until' attribute. - * @see #getValidUntil() + * @param value the new value of the 'Feature' containment reference. + * @see #getFeature() * @generated */ - void setValidUntil(Date value); + void setFeature(FeatureRef value); /** - * Returns the value of the 'Condition Type' attribute. + * Returns the value of the 'Valid' containment reference. * * - * @return the value of the 'Condition Type' attribute. - * @see #setConditionType(String) - * @see org.eclipse.passage.lic.licenses.model.meta.LicensesPackage#getLicenseGrant_ConditionType() - * @model required="true" + * @return the value of the 'Valid' containment reference. + * @see #setValid(ValidityPeriod) + * @see org.eclipse.passage.lic.licenses.model.meta.LicensesPackage#getLicenseGrant_Valid() + * @model containment="true" required="true" * @generated */ @Override - String getConditionType(); + ValidityPeriod getValid(); /** - * Sets the value of the '{@link org.eclipse.passage.lic.licenses.model.api.LicenseGrant#getConditionType Condition Type}' attribute. + * Sets the value of the '{@link org.eclipse.passage.lic.licenses.model.api.LicenseGrant#getValid Valid}' containment reference. * * - * @param value the new value of the 'Condition Type' attribute. - * @see #getConditionType() + * @param value the new value of the 'Valid' containment reference. + * @see #getValid() * @generated */ - void setConditionType(String value); + void setValid(ValidityPeriod value); /** - * Returns the value of the 'Condition Expression' attribute. + * Returns the value of the 'User Authentication' containment reference. * * - * @return the value of the 'Condition Expression' attribute. - * @see #setConditionExpression(String) - * @see org.eclipse.passage.lic.licenses.model.meta.LicensesPackage#getLicenseGrant_ConditionExpression() - * @model required="true" + * @return the value of the 'User Authentication' containment reference. + * @see #setUserAuthentication(EvaluationInstructions) + * @see org.eclipse.passage.lic.licenses.model.meta.LicensesPackage#getLicenseGrant_UserAuthentication() + * @model containment="true" required="true" * @generated */ @Override - String getConditionExpression(); + EvaluationInstructions getUserAuthentication(); /** - * Sets the value of the '{@link org.eclipse.passage.lic.licenses.model.api.LicenseGrant#getConditionExpression Condition Expression}' attribute. + * Sets the value of the '{@link org.eclipse.passage.lic.licenses.model.api.LicenseGrant#getUserAuthentication User Authentication}' containment reference. * * - * @param value the new value of the 'Condition Expression' attribute. - * @see #getConditionExpression() + * @param value the new value of the 'User Authentication' containment reference. + * @see #getUserAuthentication() * @generated */ - void setConditionExpression(String value); + void setUserAuthentication(EvaluationInstructions value); /** * Returns the value of the 'Capacity' attribute. diff --git a/bundles/org.eclipse.passage.lic.licenses.model/src-gen/org/eclipse/passage/lic/licenses/model/api/LicensePlanFeature.java b/bundles/org.eclipse.passage.lic.licenses.model/src-gen/org/eclipse/passage/lic/licenses/model/api/LicensePlanFeature.java index 56af4b684..09b5b535b 100644 --- a/bundles/org.eclipse.passage.lic.licenses.model/src-gen/org/eclipse/passage/lic/licenses/model/api/LicensePlanFeature.java +++ b/bundles/org.eclipse.passage.lic.licenses.model/src-gen/org/eclipse/passage/lic/licenses/model/api/LicensePlanFeature.java @@ -25,9 +25,7 @@ * The following features are supported: *

*
    - *
  • {@link org.eclipse.passage.lic.licenses.model.api.LicensePlanFeature#getFeatureIdentifier Feature Identifier}
  • - *
  • {@link org.eclipse.passage.lic.licenses.model.api.LicensePlanFeature#getMatchVersion Match Version}
  • - *
  • {@link org.eclipse.passage.lic.licenses.model.api.LicensePlanFeature#getMatchRule Match Rule}
  • + *
  • {@link org.eclipse.passage.lic.licenses.model.api.LicensePlanFeature#getFeature Feature}
  • *
  • {@link org.eclipse.passage.lic.licenses.model.api.LicensePlanFeature#getLicensePlan License Plan}
  • *
* @@ -37,74 +35,27 @@ */ public interface LicensePlanFeature extends EObject, LicensePlanFeatureDescriptor { /** - * Returns the value of the 'Feature Identifier' attribute. + * Returns the value of the 'Feature' containment reference. * * - * @return the value of the 'Feature Identifier' attribute. - * @see #setFeatureIdentifier(String) - * @see org.eclipse.passage.lic.licenses.model.meta.LicensesPackage#getLicensePlanFeature_FeatureIdentifier() - * @model required="true" - * @generated - */ - @Override - String getFeatureIdentifier(); - - /** - * Sets the value of the '{@link org.eclipse.passage.lic.licenses.model.api.LicensePlanFeature#getFeatureIdentifier Feature Identifier}' attribute. - * - * - * @param value the new value of the 'Feature Identifier' attribute. - * @see #getFeatureIdentifier() - * @generated - */ - void setFeatureIdentifier(String value); - - /** - * Returns the value of the 'Match Version' attribute. - * The default value is "0.0.0". - * - * - * @return the value of the 'Match Version' attribute. - * @see #setMatchVersion(String) - * @see org.eclipse.passage.lic.licenses.model.meta.LicensesPackage#getLicensePlanFeature_MatchVersion() - * @model default="0.0.0" required="true" - * @generated - */ - @Override - String getMatchVersion(); - - /** - * Sets the value of the '{@link org.eclipse.passage.lic.licenses.model.api.LicensePlanFeature#getMatchVersion Match Version}' attribute. - * - * - * @param value the new value of the 'Match Version' attribute. - * @see #getMatchVersion() - * @generated - */ - void setMatchVersion(String value); - - /** - * Returns the value of the 'Match Rule' attribute. - * - * - * @return the value of the 'Match Rule' attribute. - * @see #setMatchRule(String) - * @see org.eclipse.passage.lic.licenses.model.meta.LicensesPackage#getLicensePlanFeature_MatchRule() - * @model + * @return the value of the 'Feature' containment reference. + * @see #setFeature(FeatureRef) + * @see org.eclipse.passage.lic.licenses.model.meta.LicensesPackage#getLicensePlanFeature_Feature() + * @model containment="true" required="true" * @generated */ @Override - String getMatchRule(); + FeatureRef getFeature(); /** - * Sets the value of the '{@link org.eclipse.passage.lic.licenses.model.api.LicensePlanFeature#getMatchRule Match Rule}' attribute. + * Sets the value of the '{@link org.eclipse.passage.lic.licenses.model.api.LicensePlanFeature#getFeature Feature}' containment reference. * * - * @param value the new value of the 'Match Rule' attribute. - * @see #getMatchRule() + * @param value the new value of the 'Feature' containment reference. + * @see #getFeature() * @generated */ - void setMatchRule(String value); + void setFeature(FeatureRef value); /** * Returns the value of the 'License Plan' reference. diff --git a/bundles/org.eclipse.passage.lic.licenses.model/src-gen/org/eclipse/passage/lic/licenses/model/api/PersonalLicensePack.java b/bundles/org.eclipse.passage.lic.licenses.model/src-gen/org/eclipse/passage/lic/licenses/model/api/PersonalLicensePack.java index 240f06933..0a652fe3e 100644 --- a/bundles/org.eclipse.passage.lic.licenses.model/src-gen/org/eclipse/passage/lic/licenses/model/api/PersonalLicensePack.java +++ b/bundles/org.eclipse.passage.lic.licenses.model/src-gen/org/eclipse/passage/lic/licenses/model/api/PersonalLicensePack.java @@ -15,7 +15,6 @@ import org.eclipse.emf.common.util.EList; import org.eclipse.emf.ecore.EObject; - import org.eclipse.passage.lic.licenses.PersonalLicensePackDescriptor; /** @@ -32,7 +31,7 @@ * * * @see org.eclipse.passage.lic.licenses.model.meta.LicensesPackage#getPersonalLicensePack() - * @model superTypes="org.eclipse.passage.lic.licenses.model.api.LicensePackDescriptor" + * @model superTypes="org.eclipse.passage.lic.licenses.model.api.PersonalLicensePackDescriptor" * @generated */ public interface PersonalLicensePack extends EObject, PersonalLicensePackDescriptor { @@ -46,6 +45,7 @@ public interface PersonalLicensePack extends EObject, PersonalLicensePackDescrip * @model containment="true" required="true" * @generated */ + @Override PersonalLicenseRequisites getLicense(); /** @@ -70,6 +70,7 @@ public interface PersonalLicensePack extends EObject, PersonalLicensePackDescrip * @model opposite="licensePack" containment="true" * @generated */ + @Override EList getGrants(); } // PersonalLicensePack diff --git a/bundles/org.eclipse.passage.lic.licenses.model/src-gen/org/eclipse/passage/lic/licenses/model/impl/FeatureRefImpl.java b/bundles/org.eclipse.passage.lic.licenses.model/src-gen/org/eclipse/passage/lic/licenses/model/impl/FeatureRefImpl.java new file mode 100644 index 000000000..1be875a23 --- /dev/null +++ b/bundles/org.eclipse.passage.lic.licenses.model/src-gen/org/eclipse/passage/lic/licenses/model/impl/FeatureRefImpl.java @@ -0,0 +1,303 @@ +/******************************************************************************* + * Copyright (c) 2018, 2021 ArSysOp + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * https://www.eclipse.org/legal/epl-2.0/. + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * ArSysOp - initial API and implementation + *******************************************************************************/ +package org.eclipse.passage.lic.licenses.model.impl; + +import java.util.Objects; + +import org.eclipse.emf.common.notify.Notification; + +import org.eclipse.emf.ecore.EClass; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; + +import org.eclipse.passage.lic.licenses.model.api.FeatureRef; + +import org.eclipse.passage.lic.licenses.model.meta.LicensesPackage; + +/** + * + * An implementation of the model object 'Feature Ref'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link org.eclipse.passage.lic.licenses.model.impl.FeatureRefImpl#getIdentifier Identifier}
  • + *
  • {@link org.eclipse.passage.lic.licenses.model.impl.FeatureRefImpl#getVersion Version}
  • + *
  • {@link org.eclipse.passage.lic.licenses.model.impl.FeatureRefImpl#getMatchingRule Matching Rule}
  • + *
+ * + * @generated + */ +public class FeatureRefImpl extends MinimalEObjectImpl.Container implements FeatureRef { + /** + * The default value of the '{@link #getIdentifier() Identifier}' attribute. + * + * + * @see #getIdentifier() + * @generated + * @ordered + */ + protected static final String IDENTIFIER_EDEFAULT = null; + + /** + * The cached value of the '{@link #getIdentifier() Identifier}' attribute. + * + * + * @see #getIdentifier() + * @generated + * @ordered + */ + private String identifier = IDENTIFIER_EDEFAULT; + + /** + * The default value of the '{@link #getVersion() Version}' attribute. + * + * + * @see #getVersion() + * @generated + * @ordered + */ + protected static final String VERSION_EDEFAULT = null; + + /** + * The cached value of the '{@link #getVersion() Version}' attribute. + * + * + * @see #getVersion() + * @generated + * @ordered + */ + private String version = VERSION_EDEFAULT; + + /** + * The default value of the '{@link #getMatchingRule() Matching Rule}' attribute. + * + * + * @see #getMatchingRule() + * @generated + * @ordered + */ + protected static final String MATCHING_RULE_EDEFAULT = null; + + /** + * The cached value of the '{@link #getMatchingRule() Matching Rule}' attribute. + * + * + * @see #getMatchingRule() + * @generated + * @ordered + */ + private String matchingRule = MATCHING_RULE_EDEFAULT; + + /** + * + * + * @generated + */ + protected FeatureRefImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return LicensesPackage.eINSTANCE.getFeatureRef(); + } + + /** + * + * + * @generated + */ + @Override + public String getIdentifier() { + return identifier; + } + + /** + * + * + * @generated + */ + @Override + public void setIdentifier(String newIdentifier) { + String oldIdentifier = identifier; + identifier = newIdentifier; + if (eNotificationRequired()) { + eNotify(new ENotificationImpl(this, Notification.SET, LicensesPackage.FEATURE_REF__IDENTIFIER, + oldIdentifier, identifier)); + } + } + + /** + * + * + * @generated + */ + @Override + public String getVersion() { + return version; + } + + /** + * + * + * @generated + */ + @Override + public void setVersion(String newVersion) { + String oldVersion = version; + version = newVersion; + if (eNotificationRequired()) { + eNotify(new ENotificationImpl(this, Notification.SET, LicensesPackage.FEATURE_REF__VERSION, oldVersion, + version)); + } + } + + /** + * + * + * @generated + */ + @Override + public String getMatchingRule() { + return matchingRule; + } + + /** + * + * + * @generated + */ + @Override + public void setMatchingRule(String newMatchingRule) { + String oldMatchingRule = matchingRule; + matchingRule = newMatchingRule; + if (eNotificationRequired()) { + eNotify(new ENotificationImpl(this, Notification.SET, LicensesPackage.FEATURE_REF__MATCHING_RULE, + oldMatchingRule, matchingRule)); + } + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case LicensesPackage.FEATURE_REF__IDENTIFIER: + return getIdentifier(); + case LicensesPackage.FEATURE_REF__VERSION: + return getVersion(); + case LicensesPackage.FEATURE_REF__MATCHING_RULE: + return getMatchingRule(); + default: + return super.eGet(featureID, resolve, coreType); + } + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case LicensesPackage.FEATURE_REF__IDENTIFIER: + setIdentifier((String) newValue); + return; + case LicensesPackage.FEATURE_REF__VERSION: + setVersion((String) newValue); + return; + case LicensesPackage.FEATURE_REF__MATCHING_RULE: + setMatchingRule((String) newValue); + return; + default: + super.eSet(featureID, newValue); + return; + } + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case LicensesPackage.FEATURE_REF__IDENTIFIER: + setIdentifier(IDENTIFIER_EDEFAULT); + return; + case LicensesPackage.FEATURE_REF__VERSION: + setVersion(VERSION_EDEFAULT); + return; + case LicensesPackage.FEATURE_REF__MATCHING_RULE: + setMatchingRule(MATCHING_RULE_EDEFAULT); + return; + default: + super.eUnset(featureID); + return; + } + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case LicensesPackage.FEATURE_REF__IDENTIFIER: + return !Objects.equals(IDENTIFIER_EDEFAULT, identifier); + case LicensesPackage.FEATURE_REF__VERSION: + return !Objects.equals(VERSION_EDEFAULT, version); + case LicensesPackage.FEATURE_REF__MATCHING_RULE: + return !Objects.equals(MATCHING_RULE_EDEFAULT, matchingRule); + default: + return super.eIsSet(featureID); + } + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) { + return super.toString(); + } + StringBuilder result = new StringBuilder(super.toString()); + result.append(" (identifier: "); //$NON-NLS-1$ + result.append(identifier); + result.append(", version: "); //$NON-NLS-1$ + result.append(version); + result.append(", matchingRule: "); //$NON-NLS-1$ + result.append(matchingRule); + result.append(')'); + return result.toString(); + } + +} //FeatureRefImpl diff --git a/bundles/org.eclipse.passage.lic.licenses.model/src-gen/org/eclipse/passage/lic/licenses/model/impl/LicenseGrantImpl.java b/bundles/org.eclipse.passage.lic.licenses.model/src-gen/org/eclipse/passage/lic/licenses/model/impl/LicenseGrantImpl.java index 5e2f6a8aa..5d493398b 100644 --- a/bundles/org.eclipse.passage.lic.licenses.model/src-gen/org/eclipse/passage/lic/licenses/model/impl/LicenseGrantImpl.java +++ b/bundles/org.eclipse.passage.lic.licenses.model/src-gen/org/eclipse/passage/lic/licenses/model/impl/LicenseGrantImpl.java @@ -12,22 +12,21 @@ *******************************************************************************/ package org.eclipse.passage.lic.licenses.model.impl; -import java.util.Date; import java.util.Objects; import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.common.notify.NotificationChain; - import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.InternalEObject; import org.eclipse.emf.ecore.impl.ENotificationImpl; import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; - import org.eclipse.emf.ecore.util.EcoreUtil; - +import org.eclipse.passage.lic.licenses.model.api.EvaluationInstructions; +import org.eclipse.passage.lic.licenses.model.api.FeatureRef; import org.eclipse.passage.lic.licenses.model.api.LicenseGrant; import org.eclipse.passage.lic.licenses.model.api.PersonalLicensePack; +import org.eclipse.passage.lic.licenses.model.api.ValidityPeriod; import org.eclipse.passage.lic.licenses.model.meta.LicensesPackage; /** @@ -39,13 +38,9 @@ *

*
    *
  • {@link org.eclipse.passage.lic.licenses.model.impl.LicenseGrantImpl#getIdentifier Identifier}
  • - *
  • {@link org.eclipse.passage.lic.licenses.model.impl.LicenseGrantImpl#getFeatureIdentifier Feature Identifier}
  • - *
  • {@link org.eclipse.passage.lic.licenses.model.impl.LicenseGrantImpl#getMatchVersion Match Version}
  • - *
  • {@link org.eclipse.passage.lic.licenses.model.impl.LicenseGrantImpl#getMatchRule Match Rule}
  • - *
  • {@link org.eclipse.passage.lic.licenses.model.impl.LicenseGrantImpl#getValidFrom Valid From}
  • - *
  • {@link org.eclipse.passage.lic.licenses.model.impl.LicenseGrantImpl#getValidUntil Valid Until}
  • - *
  • {@link org.eclipse.passage.lic.licenses.model.impl.LicenseGrantImpl#getConditionType Condition Type}
  • - *
  • {@link org.eclipse.passage.lic.licenses.model.impl.LicenseGrantImpl#getConditionExpression Condition Expression}
  • + *
  • {@link org.eclipse.passage.lic.licenses.model.impl.LicenseGrantImpl#getFeature Feature}
  • + *
  • {@link org.eclipse.passage.lic.licenses.model.impl.LicenseGrantImpl#getValid Valid}
  • + *
  • {@link org.eclipse.passage.lic.licenses.model.impl.LicenseGrantImpl#getUserAuthentication User Authentication}
  • *
  • {@link org.eclipse.passage.lic.licenses.model.impl.LicenseGrantImpl#getCapacity Capacity}
  • *
  • {@link org.eclipse.passage.lic.licenses.model.impl.LicenseGrantImpl#getLicensePack License Pack}
  • *
@@ -74,144 +69,34 @@ public class LicenseGrantImpl extends MinimalEObjectImpl.Container implements Li private String identifier = IDENTIFIER_EDEFAULT; /** - * The default value of the '{@link #getFeatureIdentifier() Feature Identifier}' attribute. - * - * - * @see #getFeatureIdentifier() - * @generated - * @ordered - */ - protected static final String FEATURE_IDENTIFIER_EDEFAULT = null; - - /** - * The cached value of the '{@link #getFeatureIdentifier() Feature Identifier}' attribute. - * - * - * @see #getFeatureIdentifier() - * @generated - * @ordered - */ - private String featureIdentifier = FEATURE_IDENTIFIER_EDEFAULT; - - /** - * The default value of the '{@link #getMatchVersion() Match Version}' attribute. - * - * - * @see #getMatchVersion() - * @generated - * @ordered - */ - protected static final String MATCH_VERSION_EDEFAULT = "0.0.0"; //$NON-NLS-1$ - - /** - * The cached value of the '{@link #getMatchVersion() Match Version}' attribute. - * - * - * @see #getMatchVersion() - * @generated - * @ordered - */ - private String matchVersion = MATCH_VERSION_EDEFAULT; - - /** - * The default value of the '{@link #getMatchRule() Match Rule}' attribute. - * - * - * @see #getMatchRule() - * @generated - * @ordered - */ - protected static final String MATCH_RULE_EDEFAULT = null; - - /** - * The cached value of the '{@link #getMatchRule() Match Rule}' attribute. + * The cached value of the '{@link #getFeature() Feature}' containment reference. * * - * @see #getMatchRule() + * @see #getFeature() * @generated * @ordered */ - private String matchRule = MATCH_RULE_EDEFAULT; + protected FeatureRef feature; /** - * The default value of the '{@link #getValidFrom() Valid From}' attribute. + * The cached value of the '{@link #getValid() Valid}' containment reference. * * - * @see #getValidFrom() + * @see #getValid() * @generated * @ordered */ - protected static final Date VALID_FROM_EDEFAULT = null; + protected ValidityPeriod valid; /** - * The cached value of the '{@link #getValidFrom() Valid From}' attribute. + * The cached value of the '{@link #getUserAuthentication() User Authentication}' containment reference. * * - * @see #getValidFrom() + * @see #getUserAuthentication() * @generated * @ordered */ - private Date validFrom = VALID_FROM_EDEFAULT; - - /** - * The default value of the '{@link #getValidUntil() Valid Until}' attribute. - * - * - * @see #getValidUntil() - * @generated - * @ordered - */ - protected static final Date VALID_UNTIL_EDEFAULT = null; - - /** - * The cached value of the '{@link #getValidUntil() Valid Until}' attribute. - * - * - * @see #getValidUntil() - * @generated - * @ordered - */ - private Date validUntil = VALID_UNTIL_EDEFAULT; - - /** - * The default value of the '{@link #getConditionType() Condition Type}' attribute. - * - * - * @see #getConditionType() - * @generated - * @ordered - */ - protected static final String CONDITION_TYPE_EDEFAULT = null; - - /** - * The cached value of the '{@link #getConditionType() Condition Type}' attribute. - * - * - * @see #getConditionType() - * @generated - * @ordered - */ - private String conditionType = CONDITION_TYPE_EDEFAULT; - - /** - * The default value of the '{@link #getConditionExpression() Condition Expression}' attribute. - * - * - * @see #getConditionExpression() - * @generated - * @ordered - */ - protected static final String CONDITION_EXPRESSION_EDEFAULT = null; - - /** - * The cached value of the '{@link #getConditionExpression() Condition Expression}' attribute. - * - * - * @see #getConditionExpression() - * @generated - * @ordered - */ - private String conditionExpression = CONDITION_EXPRESSION_EDEFAULT; + protected EvaluationInstructions userAuthentication; /** * The default value of the '{@link #getCapacity() Capacity}' attribute. @@ -283,33 +168,8 @@ public void setIdentifier(String newIdentifier) { * @generated */ @Override - public String getFeatureIdentifier() { - return featureIdentifier; - } - - /** - * - * - * @generated - */ - @Override - public void setFeatureIdentifier(String newFeatureIdentifier) { - String oldFeatureIdentifier = featureIdentifier; - featureIdentifier = newFeatureIdentifier; - if (eNotificationRequired()) { - eNotify(new ENotificationImpl(this, Notification.SET, LicensesPackage.LICENSE_GRANT__FEATURE_IDENTIFIER, - oldFeatureIdentifier, featureIdentifier)); - } - } - - /** - * - * - * @generated - */ - @Override - public String getMatchVersion() { - return matchVersion; + public FeatureRef getFeature() { + return feature; } /** @@ -317,14 +177,18 @@ public String getMatchVersion() { * * @generated */ - @Override - public void setMatchVersion(String newMatchVersion) { - String oldMatchVersion = matchVersion; - matchVersion = newMatchVersion; + public NotificationChain basicSetFeature(FeatureRef newFeature, NotificationChain msgs) { + FeatureRef oldFeature = feature; + feature = newFeature; if (eNotificationRequired()) { - eNotify(new ENotificationImpl(this, Notification.SET, LicensesPackage.LICENSE_GRANT__MATCH_VERSION, - oldMatchVersion, matchVersion)); + ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, + LicensesPackage.LICENSE_GRANT__FEATURE, oldFeature, newFeature); + if (msgs == null) + msgs = notification; + else + msgs.add(notification); } + return msgs; } /** @@ -333,22 +197,21 @@ public void setMatchVersion(String newMatchVersion) { * @generated */ @Override - public String getMatchRule() { - return matchRule; - } - - /** - * - * - * @generated - */ - @Override - public void setMatchRule(String newMatchRule) { - String oldMatchRule = matchRule; - matchRule = newMatchRule; - if (eNotificationRequired()) { - eNotify(new ENotificationImpl(this, Notification.SET, LicensesPackage.LICENSE_GRANT__MATCH_RULE, - oldMatchRule, matchRule)); + public void setFeature(FeatureRef newFeature) { + if (newFeature != feature) { + NotificationChain msgs = null; + if (feature != null) + msgs = ((InternalEObject) feature).eInverseRemove(this, + EOPPOSITE_FEATURE_BASE - LicensesPackage.LICENSE_GRANT__FEATURE, null, msgs); + if (newFeature != null) + msgs = ((InternalEObject) newFeature).eInverseAdd(this, + EOPPOSITE_FEATURE_BASE - LicensesPackage.LICENSE_GRANT__FEATURE, null, msgs); + msgs = basicSetFeature(newFeature, msgs); + if (msgs != null) + msgs.dispatch(); + } else if (eNotificationRequired()) { + eNotify(new ENotificationImpl(this, Notification.SET, LicensesPackage.LICENSE_GRANT__FEATURE, newFeature, + newFeature)); } } @@ -358,8 +221,8 @@ public void setMatchRule(String newMatchRule) { * @generated */ @Override - public Date getValidFrom() { - return validFrom; + public ValidityPeriod getValid() { + return valid; } /** @@ -367,14 +230,18 @@ public Date getValidFrom() { * * @generated */ - @Override - public void setValidFrom(Date newValidFrom) { - Date oldValidFrom = validFrom; - validFrom = newValidFrom; + public NotificationChain basicSetValid(ValidityPeriod newValid, NotificationChain msgs) { + ValidityPeriod oldValid = valid; + valid = newValid; if (eNotificationRequired()) { - eNotify(new ENotificationImpl(this, Notification.SET, LicensesPackage.LICENSE_GRANT__VALID_FROM, - oldValidFrom, validFrom)); + ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, + LicensesPackage.LICENSE_GRANT__VALID, oldValid, newValid); + if (msgs == null) + msgs = notification; + else + msgs.add(notification); } + return msgs; } /** @@ -383,22 +250,21 @@ public void setValidFrom(Date newValidFrom) { * @generated */ @Override - public Date getValidUntil() { - return validUntil; - } - - /** - * - * - * @generated - */ - @Override - public void setValidUntil(Date newValidUntil) { - Date oldValidUntil = validUntil; - validUntil = newValidUntil; - if (eNotificationRequired()) { - eNotify(new ENotificationImpl(this, Notification.SET, LicensesPackage.LICENSE_GRANT__VALID_UNTIL, - oldValidUntil, validUntil)); + public void setValid(ValidityPeriod newValid) { + if (newValid != valid) { + NotificationChain msgs = null; + if (valid != null) + msgs = ((InternalEObject) valid).eInverseRemove(this, + EOPPOSITE_FEATURE_BASE - LicensesPackage.LICENSE_GRANT__VALID, null, msgs); + if (newValid != null) + msgs = ((InternalEObject) newValid).eInverseAdd(this, + EOPPOSITE_FEATURE_BASE - LicensesPackage.LICENSE_GRANT__VALID, null, msgs); + msgs = basicSetValid(newValid, msgs); + if (msgs != null) + msgs.dispatch(); + } else if (eNotificationRequired()) { + eNotify(new ENotificationImpl(this, Notification.SET, LicensesPackage.LICENSE_GRANT__VALID, newValid, + newValid)); } } @@ -408,8 +274,8 @@ public void setValidUntil(Date newValidUntil) { * @generated */ @Override - public String getConditionType() { - return conditionType; + public EvaluationInstructions getUserAuthentication() { + return userAuthentication; } /** @@ -417,14 +283,19 @@ public String getConditionType() { * * @generated */ - @Override - public void setConditionType(String newConditionType) { - String oldConditionType = conditionType; - conditionType = newConditionType; + public NotificationChain basicSetUserAuthentication(EvaluationInstructions newUserAuthentication, + NotificationChain msgs) { + EvaluationInstructions oldUserAuthentication = userAuthentication; + userAuthentication = newUserAuthentication; if (eNotificationRequired()) { - eNotify(new ENotificationImpl(this, Notification.SET, LicensesPackage.LICENSE_GRANT__CONDITION_TYPE, - oldConditionType, conditionType)); + ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, + LicensesPackage.LICENSE_GRANT__USER_AUTHENTICATION, oldUserAuthentication, newUserAuthentication); + if (msgs == null) + msgs = notification; + else + msgs.add(notification); } + return msgs; } /** @@ -433,22 +304,21 @@ public void setConditionType(String newConditionType) { * @generated */ @Override - public String getConditionExpression() { - return conditionExpression; - } - - /** - * - * - * @generated - */ - @Override - public void setConditionExpression(String newConditionExpression) { - String oldConditionExpression = conditionExpression; - conditionExpression = newConditionExpression; - if (eNotificationRequired()) { - eNotify(new ENotificationImpl(this, Notification.SET, LicensesPackage.LICENSE_GRANT__CONDITION_EXPRESSION, - oldConditionExpression, conditionExpression)); + public void setUserAuthentication(EvaluationInstructions newUserAuthentication) { + if (newUserAuthentication != userAuthentication) { + NotificationChain msgs = null; + if (userAuthentication != null) + msgs = ((InternalEObject) userAuthentication).eInverseRemove(this, + EOPPOSITE_FEATURE_BASE - LicensesPackage.LICENSE_GRANT__USER_AUTHENTICATION, null, msgs); + if (newUserAuthentication != null) + msgs = ((InternalEObject) newUserAuthentication).eInverseAdd(this, + EOPPOSITE_FEATURE_BASE - LicensesPackage.LICENSE_GRANT__USER_AUTHENTICATION, null, msgs); + msgs = basicSetUserAuthentication(newUserAuthentication, msgs); + if (msgs != null) + msgs.dispatch(); + } else if (eNotificationRequired()) { + eNotify(new ENotificationImpl(this, Notification.SET, LicensesPackage.LICENSE_GRANT__USER_AUTHENTICATION, + newUserAuthentication, newUserAuthentication)); } } @@ -554,6 +424,12 @@ public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, No @Override public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { switch (featureID) { + case LicensesPackage.LICENSE_GRANT__FEATURE: + return basicSetFeature(null, msgs); + case LicensesPackage.LICENSE_GRANT__VALID: + return basicSetValid(null, msgs); + case LicensesPackage.LICENSE_GRANT__USER_AUTHENTICATION: + return basicSetUserAuthentication(null, msgs); case LicensesPackage.LICENSE_GRANT__LICENSE_PACK: return basicSetLicensePack(null, msgs); default: @@ -587,20 +463,12 @@ public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { case LicensesPackage.LICENSE_GRANT__IDENTIFIER: return getIdentifier(); - case LicensesPackage.LICENSE_GRANT__FEATURE_IDENTIFIER: - return getFeatureIdentifier(); - case LicensesPackage.LICENSE_GRANT__MATCH_VERSION: - return getMatchVersion(); - case LicensesPackage.LICENSE_GRANT__MATCH_RULE: - return getMatchRule(); - case LicensesPackage.LICENSE_GRANT__VALID_FROM: - return getValidFrom(); - case LicensesPackage.LICENSE_GRANT__VALID_UNTIL: - return getValidUntil(); - case LicensesPackage.LICENSE_GRANT__CONDITION_TYPE: - return getConditionType(); - case LicensesPackage.LICENSE_GRANT__CONDITION_EXPRESSION: - return getConditionExpression(); + case LicensesPackage.LICENSE_GRANT__FEATURE: + return getFeature(); + case LicensesPackage.LICENSE_GRANT__VALID: + return getValid(); + case LicensesPackage.LICENSE_GRANT__USER_AUTHENTICATION: + return getUserAuthentication(); case LicensesPackage.LICENSE_GRANT__CAPACITY: return getCapacity(); case LicensesPackage.LICENSE_GRANT__LICENSE_PACK: @@ -615,32 +483,21 @@ public Object eGet(int featureID, boolean resolve, boolean coreType) { * * @generated */ + @SuppressWarnings("unchecked") @Override public void eSet(int featureID, Object newValue) { switch (featureID) { case LicensesPackage.LICENSE_GRANT__IDENTIFIER: setIdentifier((String) newValue); return; - case LicensesPackage.LICENSE_GRANT__FEATURE_IDENTIFIER: - setFeatureIdentifier((String) newValue); - return; - case LicensesPackage.LICENSE_GRANT__MATCH_VERSION: - setMatchVersion((String) newValue); - return; - case LicensesPackage.LICENSE_GRANT__MATCH_RULE: - setMatchRule((String) newValue); - return; - case LicensesPackage.LICENSE_GRANT__VALID_FROM: - setValidFrom((Date) newValue); - return; - case LicensesPackage.LICENSE_GRANT__VALID_UNTIL: - setValidUntil((Date) newValue); + case LicensesPackage.LICENSE_GRANT__FEATURE: + setFeature((FeatureRef) newValue); return; - case LicensesPackage.LICENSE_GRANT__CONDITION_TYPE: - setConditionType((String) newValue); + case LicensesPackage.LICENSE_GRANT__VALID: + setValid((ValidityPeriod) newValue); return; - case LicensesPackage.LICENSE_GRANT__CONDITION_EXPRESSION: - setConditionExpression((String) newValue); + case LicensesPackage.LICENSE_GRANT__USER_AUTHENTICATION: + setUserAuthentication((EvaluationInstructions) newValue); return; case LicensesPackage.LICENSE_GRANT__CAPACITY: setCapacity((Integer) newValue); @@ -665,26 +522,14 @@ public void eUnset(int featureID) { case LicensesPackage.LICENSE_GRANT__IDENTIFIER: setIdentifier(IDENTIFIER_EDEFAULT); return; - case LicensesPackage.LICENSE_GRANT__FEATURE_IDENTIFIER: - setFeatureIdentifier(FEATURE_IDENTIFIER_EDEFAULT); - return; - case LicensesPackage.LICENSE_GRANT__MATCH_VERSION: - setMatchVersion(MATCH_VERSION_EDEFAULT); - return; - case LicensesPackage.LICENSE_GRANT__MATCH_RULE: - setMatchRule(MATCH_RULE_EDEFAULT); - return; - case LicensesPackage.LICENSE_GRANT__VALID_FROM: - setValidFrom(VALID_FROM_EDEFAULT); - return; - case LicensesPackage.LICENSE_GRANT__VALID_UNTIL: - setValidUntil(VALID_UNTIL_EDEFAULT); + case LicensesPackage.LICENSE_GRANT__FEATURE: + setFeature((FeatureRef) null); return; - case LicensesPackage.LICENSE_GRANT__CONDITION_TYPE: - setConditionType(CONDITION_TYPE_EDEFAULT); + case LicensesPackage.LICENSE_GRANT__VALID: + setValid((ValidityPeriod) null); return; - case LicensesPackage.LICENSE_GRANT__CONDITION_EXPRESSION: - setConditionExpression(CONDITION_EXPRESSION_EDEFAULT); + case LicensesPackage.LICENSE_GRANT__USER_AUTHENTICATION: + setUserAuthentication((EvaluationInstructions) null); return; case LicensesPackage.LICENSE_GRANT__CAPACITY: setCapacity(CAPACITY_EDEFAULT); @@ -708,20 +553,12 @@ public boolean eIsSet(int featureID) { switch (featureID) { case LicensesPackage.LICENSE_GRANT__IDENTIFIER: return !Objects.equals(IDENTIFIER_EDEFAULT, identifier); - case LicensesPackage.LICENSE_GRANT__FEATURE_IDENTIFIER: - return !Objects.equals(FEATURE_IDENTIFIER_EDEFAULT, featureIdentifier); - case LicensesPackage.LICENSE_GRANT__MATCH_VERSION: - return !Objects.equals(MATCH_VERSION_EDEFAULT, matchVersion); - case LicensesPackage.LICENSE_GRANT__MATCH_RULE: - return !Objects.equals(MATCH_RULE_EDEFAULT, matchRule); - case LicensesPackage.LICENSE_GRANT__VALID_FROM: - return !Objects.equals(VALID_FROM_EDEFAULT, validFrom); - case LicensesPackage.LICENSE_GRANT__VALID_UNTIL: - return !Objects.equals(VALID_UNTIL_EDEFAULT, validUntil); - case LicensesPackage.LICENSE_GRANT__CONDITION_TYPE: - return !Objects.equals(CONDITION_TYPE_EDEFAULT, conditionType); - case LicensesPackage.LICENSE_GRANT__CONDITION_EXPRESSION: - return !Objects.equals(CONDITION_EXPRESSION_EDEFAULT, conditionExpression); + case LicensesPackage.LICENSE_GRANT__FEATURE: + return feature != null; + case LicensesPackage.LICENSE_GRANT__VALID: + return valid != null; + case LicensesPackage.LICENSE_GRANT__USER_AUTHENTICATION: + return userAuthentication != null; case LicensesPackage.LICENSE_GRANT__CAPACITY: return capacity != CAPACITY_EDEFAULT; case LicensesPackage.LICENSE_GRANT__LICENSE_PACK: @@ -744,20 +581,6 @@ public String toString() { StringBuilder result = new StringBuilder(super.toString()); result.append(" (identifier: "); //$NON-NLS-1$ result.append(identifier); - result.append(", featureIdentifier: "); //$NON-NLS-1$ - result.append(featureIdentifier); - result.append(", matchVersion: "); //$NON-NLS-1$ - result.append(matchVersion); - result.append(", matchRule: "); //$NON-NLS-1$ - result.append(matchRule); - result.append(", validFrom: "); //$NON-NLS-1$ - result.append(validFrom); - result.append(", validUntil: "); //$NON-NLS-1$ - result.append(validUntil); - result.append(", conditionType: "); //$NON-NLS-1$ - result.append(conditionType); - result.append(", conditionExpression: "); //$NON-NLS-1$ - result.append(conditionExpression); result.append(", capacity: "); //$NON-NLS-1$ result.append(capacity); result.append(')'); diff --git a/bundles/org.eclipse.passage.lic.licenses.model/src-gen/org/eclipse/passage/lic/licenses/model/impl/LicensePlanFeatureImpl.java b/bundles/org.eclipse.passage.lic.licenses.model/src-gen/org/eclipse/passage/lic/licenses/model/impl/LicensePlanFeatureImpl.java index ccd2f43db..104c6d939 100644 --- a/bundles/org.eclipse.passage.lic.licenses.model/src-gen/org/eclipse/passage/lic/licenses/model/impl/LicensePlanFeatureImpl.java +++ b/bundles/org.eclipse.passage.lic.licenses.model/src-gen/org/eclipse/passage/lic/licenses/model/impl/LicensePlanFeatureImpl.java @@ -12,16 +12,16 @@ *******************************************************************************/ package org.eclipse.passage.lic.licenses.model.impl; -import java.util.Objects; - import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.notify.NotificationChain; import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.InternalEObject; import org.eclipse.emf.ecore.impl.ENotificationImpl; import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; +import org.eclipse.passage.lic.licenses.model.api.FeatureRef; import org.eclipse.passage.lic.licenses.model.api.LicensePlan; import org.eclipse.passage.lic.licenses.model.api.LicensePlanFeature; @@ -35,9 +35,7 @@ * The following features are implemented: *

*
    - *
  • {@link org.eclipse.passage.lic.licenses.model.impl.LicensePlanFeatureImpl#getFeatureIdentifier Feature Identifier}
  • - *
  • {@link org.eclipse.passage.lic.licenses.model.impl.LicensePlanFeatureImpl#getMatchVersion Match Version}
  • - *
  • {@link org.eclipse.passage.lic.licenses.model.impl.LicensePlanFeatureImpl#getMatchRule Match Rule}
  • + *
  • {@link org.eclipse.passage.lic.licenses.model.impl.LicensePlanFeatureImpl#getFeature Feature}
  • *
  • {@link org.eclipse.passage.lic.licenses.model.impl.LicensePlanFeatureImpl#getLicensePlan License Plan}
  • *
* @@ -45,64 +43,14 @@ */ public class LicensePlanFeatureImpl extends MinimalEObjectImpl.Container implements LicensePlanFeature { /** - * The default value of the '{@link #getFeatureIdentifier() Feature Identifier}' attribute. - * - * - * @see #getFeatureIdentifier() - * @generated - * @ordered - */ - protected static final String FEATURE_IDENTIFIER_EDEFAULT = null; - - /** - * The cached value of the '{@link #getFeatureIdentifier() Feature Identifier}' attribute. - * - * - * @see #getFeatureIdentifier() - * @generated - * @ordered - */ - private String featureIdentifier = FEATURE_IDENTIFIER_EDEFAULT; - - /** - * The default value of the '{@link #getMatchVersion() Match Version}' attribute. - * - * - * @see #getMatchVersion() - * @generated - * @ordered - */ - protected static final String MATCH_VERSION_EDEFAULT = "0.0.0"; //$NON-NLS-1$ - - /** - * The cached value of the '{@link #getMatchVersion() Match Version}' attribute. + * The cached value of the '{@link #getFeature() Feature}' containment reference. * * - * @see #getMatchVersion() + * @see #getFeature() * @generated * @ordered */ - private String matchVersion = MATCH_VERSION_EDEFAULT; - - /** - * The default value of the '{@link #getMatchRule() Match Rule}' attribute. - * - * - * @see #getMatchRule() - * @generated - * @ordered - */ - protected static final String MATCH_RULE_EDEFAULT = null; - - /** - * The cached value of the '{@link #getMatchRule() Match Rule}' attribute. - * - * - * @see #getMatchRule() - * @generated - * @ordered - */ - private String matchRule = MATCH_RULE_EDEFAULT; + protected FeatureRef feature; /** * The cached value of the '{@link #getLicensePlan() License Plan}' reference. @@ -139,23 +87,8 @@ protected EClass eStaticClass() { * @generated */ @Override - public String getFeatureIdentifier() { - return featureIdentifier; - } - - /** - * - * - * @generated - */ - @Override - public void setFeatureIdentifier(String newFeatureIdentifier) { - String oldFeatureIdentifier = featureIdentifier; - featureIdentifier = newFeatureIdentifier; - if (eNotificationRequired()) { - eNotify(new ENotificationImpl(this, Notification.SET, - LicensesPackage.LICENSE_PLAN_FEATURE__FEATURE_IDENTIFIER, oldFeatureIdentifier, featureIdentifier)); - } + public FeatureRef getFeature() { + return feature; } /** @@ -163,24 +96,18 @@ public void setFeatureIdentifier(String newFeatureIdentifier) { * * @generated */ - @Override - public String getMatchVersion() { - return matchVersion; - } - - /** - * - * - * @generated - */ - @Override - public void setMatchVersion(String newMatchVersion) { - String oldMatchVersion = matchVersion; - matchVersion = newMatchVersion; + public NotificationChain basicSetFeature(FeatureRef newFeature, NotificationChain msgs) { + FeatureRef oldFeature = feature; + feature = newFeature; if (eNotificationRequired()) { - eNotify(new ENotificationImpl(this, Notification.SET, LicensesPackage.LICENSE_PLAN_FEATURE__MATCH_VERSION, - oldMatchVersion, matchVersion)); + ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, + LicensesPackage.LICENSE_PLAN_FEATURE__FEATURE, oldFeature, newFeature); + if (msgs == null) + msgs = notification; + else + msgs.add(notification); } + return msgs; } /** @@ -189,22 +116,21 @@ public void setMatchVersion(String newMatchVersion) { * @generated */ @Override - public String getMatchRule() { - return matchRule; - } - - /** - * - * - * @generated - */ - @Override - public void setMatchRule(String newMatchRule) { - String oldMatchRule = matchRule; - matchRule = newMatchRule; - if (eNotificationRequired()) { - eNotify(new ENotificationImpl(this, Notification.SET, LicensesPackage.LICENSE_PLAN_FEATURE__MATCH_RULE, - oldMatchRule, matchRule)); + public void setFeature(FeatureRef newFeature) { + if (newFeature != feature) { + NotificationChain msgs = null; + if (feature != null) + msgs = ((InternalEObject) feature).eInverseRemove(this, + EOPPOSITE_FEATURE_BASE - LicensesPackage.LICENSE_PLAN_FEATURE__FEATURE, null, msgs); + if (newFeature != null) + msgs = ((InternalEObject) newFeature).eInverseAdd(this, + EOPPOSITE_FEATURE_BASE - LicensesPackage.LICENSE_PLAN_FEATURE__FEATURE, null, msgs); + msgs = basicSetFeature(newFeature, msgs); + if (msgs != null) + msgs.dispatch(); + } else if (eNotificationRequired()) { + eNotify(new ENotificationImpl(this, Notification.SET, LicensesPackage.LICENSE_PLAN_FEATURE__FEATURE, + newFeature, newFeature)); } } @@ -252,6 +178,21 @@ public void setLicensePlan(LicensePlan newLicensePlan) { } } + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case LicensesPackage.LICENSE_PLAN_FEATURE__FEATURE: + return basicSetFeature(null, msgs); + default: + return super.eInverseRemove(otherEnd, featureID, msgs); + } + } + /** * * @@ -260,12 +201,8 @@ public void setLicensePlan(LicensePlan newLicensePlan) { @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { - case LicensesPackage.LICENSE_PLAN_FEATURE__FEATURE_IDENTIFIER: - return getFeatureIdentifier(); - case LicensesPackage.LICENSE_PLAN_FEATURE__MATCH_VERSION: - return getMatchVersion(); - case LicensesPackage.LICENSE_PLAN_FEATURE__MATCH_RULE: - return getMatchRule(); + case LicensesPackage.LICENSE_PLAN_FEATURE__FEATURE: + return getFeature(); case LicensesPackage.LICENSE_PLAN_FEATURE__LICENSE_PLAN: if (resolve) return getLicensePlan(); @@ -283,14 +220,8 @@ public Object eGet(int featureID, boolean resolve, boolean coreType) { @Override public void eSet(int featureID, Object newValue) { switch (featureID) { - case LicensesPackage.LICENSE_PLAN_FEATURE__FEATURE_IDENTIFIER: - setFeatureIdentifier((String) newValue); - return; - case LicensesPackage.LICENSE_PLAN_FEATURE__MATCH_VERSION: - setMatchVersion((String) newValue); - return; - case LicensesPackage.LICENSE_PLAN_FEATURE__MATCH_RULE: - setMatchRule((String) newValue); + case LicensesPackage.LICENSE_PLAN_FEATURE__FEATURE: + setFeature((FeatureRef) newValue); return; case LicensesPackage.LICENSE_PLAN_FEATURE__LICENSE_PLAN: setLicensePlan((LicensePlan) newValue); @@ -309,14 +240,8 @@ public void eSet(int featureID, Object newValue) { @Override public void eUnset(int featureID) { switch (featureID) { - case LicensesPackage.LICENSE_PLAN_FEATURE__FEATURE_IDENTIFIER: - setFeatureIdentifier(FEATURE_IDENTIFIER_EDEFAULT); - return; - case LicensesPackage.LICENSE_PLAN_FEATURE__MATCH_VERSION: - setMatchVersion(MATCH_VERSION_EDEFAULT); - return; - case LicensesPackage.LICENSE_PLAN_FEATURE__MATCH_RULE: - setMatchRule(MATCH_RULE_EDEFAULT); + case LicensesPackage.LICENSE_PLAN_FEATURE__FEATURE: + setFeature((FeatureRef) null); return; case LicensesPackage.LICENSE_PLAN_FEATURE__LICENSE_PLAN: setLicensePlan((LicensePlan) null); @@ -335,12 +260,8 @@ public void eUnset(int featureID) { @Override public boolean eIsSet(int featureID) { switch (featureID) { - case LicensesPackage.LICENSE_PLAN_FEATURE__FEATURE_IDENTIFIER: - return !Objects.equals(FEATURE_IDENTIFIER_EDEFAULT, featureIdentifier); - case LicensesPackage.LICENSE_PLAN_FEATURE__MATCH_VERSION: - return !Objects.equals(MATCH_VERSION_EDEFAULT, matchVersion); - case LicensesPackage.LICENSE_PLAN_FEATURE__MATCH_RULE: - return !Objects.equals(MATCH_RULE_EDEFAULT, matchRule); + case LicensesPackage.LICENSE_PLAN_FEATURE__FEATURE: + return feature != null; case LicensesPackage.LICENSE_PLAN_FEATURE__LICENSE_PLAN: return licensePlan != null; default: @@ -348,25 +269,4 @@ public boolean eIsSet(int featureID) { } } - /** - * - * - * @generated - */ - @Override - public String toString() { - if (eIsProxy()) { - return super.toString(); - } - StringBuilder result = new StringBuilder(super.toString()); - result.append(" (featureIdentifier: "); //$NON-NLS-1$ - result.append(featureIdentifier); - result.append(", matchVersion: "); //$NON-NLS-1$ - result.append(matchVersion); - result.append(", matchRule: "); //$NON-NLS-1$ - result.append(matchRule); - result.append(')'); - return result.toString(); - } - } //LicensePlanFeatureImpl diff --git a/bundles/org.eclipse.passage.lic.licenses.model/src-gen/org/eclipse/passage/lic/licenses/model/impl/LicensesFactoryImpl.java b/bundles/org.eclipse.passage.lic.licenses.model/src-gen/org/eclipse/passage/lic/licenses/model/impl/LicensesFactoryImpl.java index 7401ec834..ec7c88fe1 100644 --- a/bundles/org.eclipse.passage.lic.licenses.model/src-gen/org/eclipse/passage/lic/licenses/model/impl/LicensesFactoryImpl.java +++ b/bundles/org.eclipse.passage.lic.licenses.model/src-gen/org/eclipse/passage/lic/licenses/model/impl/LicensesFactoryImpl.java @@ -15,27 +15,41 @@ import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.EObject; import org.eclipse.emf.ecore.EPackage; - import org.eclipse.emf.ecore.impl.EFactoryImpl; - import org.eclipse.emf.ecore.plugin.EcorePlugin; - -import org.eclipse.passage.lic.licenses.model.api.*; - +import org.eclipse.passage.lic.licenses.model.api.CompanyRef; +import org.eclipse.passage.lic.licenses.model.api.EvaluationInstructions; +import org.eclipse.passage.lic.licenses.model.api.FeatureGrant; +import org.eclipse.passage.lic.licenses.model.api.FeatureRef; +import org.eclipse.passage.lic.licenses.model.api.FloatingLicenseAccess; +import org.eclipse.passage.lic.licenses.model.api.FloatingLicensePack; +import org.eclipse.passage.lic.licenses.model.api.FloatingLicenseRequisites; +import org.eclipse.passage.lic.licenses.model.api.FloatingServer; +import org.eclipse.passage.lic.licenses.model.api.FloatingServerConnection; +import org.eclipse.passage.lic.licenses.model.api.GrantAcqisition; +import org.eclipse.passage.lic.licenses.model.api.LicenseGrant; +import org.eclipse.passage.lic.licenses.model.api.LicensePlan; +import org.eclipse.passage.lic.licenses.model.api.LicensePlanFeature; +import org.eclipse.passage.lic.licenses.model.api.PersonalLicensePack; +import org.eclipse.passage.lic.licenses.model.api.PersonalLicenseRequisites; +import org.eclipse.passage.lic.licenses.model.api.ProductRef; +import org.eclipse.passage.lic.licenses.model.api.UserGrant; +import org.eclipse.passage.lic.licenses.model.api.UserRef; +import org.eclipse.passage.lic.licenses.model.api.ValidityPeriodClosed; +import org.eclipse.passage.lic.licenses.model.api.VersionMatch; import org.eclipse.passage.lic.licenses.model.meta.LicensesFactory; import org.eclipse.passage.lic.licenses.model.meta.LicensesPackage; /** - * - * An implementation of the model Factory. - * + * An implementation of the model Factory. * @generated */ public class LicensesFactoryImpl extends EFactoryImpl implements LicensesFactory { /** * Creates the default factory implementation. - * - * + * * @generated */ public static LicensesFactory init() { @@ -52,9 +66,9 @@ public static LicensesFactory init() { } /** - * Creates an instance of the factory. - * - * + * Creates an instance of the factory. + * * @generated */ public LicensesFactoryImpl() { @@ -62,8 +76,7 @@ public LicensesFactoryImpl() { } /** - * - * + * * @generated */ @Override @@ -83,10 +96,12 @@ public EObject create(EClass eClass) { return createPersonalLicenseRequisites(); case LicensesPackage.FLOATING_LICENSE_REQUISITES: return createFloatingLicenseRequisites(); - case LicensesPackage.PRODUCT_REF: - return createProductRef(); case LicensesPackage.USER_REF: return createUserRef(); + case LicensesPackage.PRODUCT_REF: + return createProductRef(); + case LicensesPackage.FEATURE_REF: + return createFeatureRef(); case LicensesPackage.COMPANY_REF: return createCompanyRef(); case LicensesPackage.FLOATING_SERVER: @@ -113,8 +128,7 @@ public EObject create(EClass eClass) { } /** - * - * + * * @generated */ @Override @@ -124,8 +138,7 @@ public LicensePlan createLicensePlan() { } /** - * - * + * * @generated */ @Override @@ -135,8 +148,7 @@ public LicensePlanFeature createLicensePlanFeature() { } /** - * - * + * * @generated */ @Override @@ -146,19 +158,21 @@ public PersonalLicensePack createPersonalLicensePack() { } /** - * - * - * @generated + * + * + * @generated NOT */ @Override public LicenseGrant createLicenseGrant() { LicenseGrantImpl licenseGrant = new LicenseGrantImpl(); + licenseGrant.setFeature(createFeatureRef()); + licenseGrant.setUserAuthentication(createEvaluationInstructions()); + licenseGrant.setValid(createValidityPeriodClosed()); return licenseGrant; } /** - * - * + * * @generated */ @Override @@ -168,8 +182,7 @@ public FloatingLicensePack createFloatingLicensePack() { } /** - * - * + * * @generated */ @Override @@ -179,8 +192,7 @@ public PersonalLicenseRequisites createPersonalLicenseRequisites() { } /** - * - * + * * @generated */ @Override @@ -190,8 +202,7 @@ public FloatingLicenseRequisites createFloatingLicenseRequisites() { } /** - * - * + * * @generated */ @Override @@ -201,8 +212,17 @@ public ProductRef createProductRef() { } /** - * - * + * + * @generated + */ + @Override + public FeatureRef createFeatureRef() { + FeatureRefImpl featureRef = new FeatureRefImpl(); + return featureRef; + } + + /** + * * @generated */ @Override @@ -212,8 +232,7 @@ public UserRef createUserRef() { } /** - * - * + * * @generated */ @Override @@ -223,8 +242,7 @@ public CompanyRef createCompanyRef() { } /** - * - * + * * @generated */ @Override @@ -234,8 +252,7 @@ public FloatingServer createFloatingServer() { } /** - * - * + * * @generated */ @Override @@ -245,8 +262,7 @@ public UserGrant createUserGrant() { } /** - * - * + * * @generated */ @Override @@ -256,8 +272,7 @@ public FeatureGrant createFeatureGrant() { } /** - * - * + * * @generated */ @Override @@ -267,8 +282,7 @@ public ValidityPeriodClosed createValidityPeriodClosed() { } /** - * - * + * * @generated */ @Override @@ -278,8 +292,7 @@ public EvaluationInstructions createEvaluationInstructions() { } /** - * - * + * * @generated */ @Override @@ -289,8 +302,7 @@ public VersionMatch createVersionMatch() { } /** - * - * + * * @generated */ @Override @@ -300,8 +312,7 @@ public FloatingLicenseAccess createFloatingLicenseAccess() { } /** - * - * + * * @generated */ @Override @@ -311,8 +322,7 @@ public FloatingServerConnection createFloatingServerConnection() { } /** - * - * + * * @generated */ @Override @@ -322,8 +332,7 @@ public GrantAcqisition createGrantAcqisition() { } /** - * - * + * * @generated */ @Override @@ -332,8 +341,7 @@ public LicensesPackage getLicensesPackage() { } /** - * - * + * * @deprecated * @generated */ @@ -342,4 +350,4 @@ public static LicensesPackage getPackage() { return LicensesPackage.eINSTANCE; } -} //LicensesFactoryImpl +} // LicensesFactoryImpl diff --git a/bundles/org.eclipse.passage.lic.licenses.model/src-gen/org/eclipse/passage/lic/licenses/model/impl/LicensesPackageImpl.java b/bundles/org.eclipse.passage.lic.licenses.model/src-gen/org/eclipse/passage/lic/licenses/model/impl/LicensesPackageImpl.java index f13aa2863..73fb61fc6 100644 --- a/bundles/org.eclipse.passage.lic.licenses.model/src-gen/org/eclipse/passage/lic/licenses/model/impl/LicensesPackageImpl.java +++ b/bundles/org.eclipse.passage.lic.licenses.model/src-gen/org/eclipse/passage/lic/licenses/model/impl/LicensesPackageImpl.java @@ -22,14 +22,15 @@ import org.eclipse.passage.lic.licenses.CompanyRefDescriptor; import org.eclipse.passage.lic.licenses.EvaluationInstructionsDescriptor; import org.eclipse.passage.lic.licenses.FeatureGrantDescriptor; +import org.eclipse.passage.lic.licenses.FeatureRefDescriptor; import org.eclipse.passage.lic.licenses.FloatingLicensePackDescriptor; import org.eclipse.passage.lic.licenses.FloatingLicenseRequisitesDescriptor; import org.eclipse.passage.lic.licenses.FloatingServerDescriptor; import org.eclipse.passage.lic.licenses.LicenseGrantDescriptor; -import org.eclipse.passage.lic.licenses.PersonalLicensePackDescriptor; import org.eclipse.passage.lic.licenses.LicensePlanDescriptor; import org.eclipse.passage.lic.licenses.LicensePlanFeatureDescriptor; import org.eclipse.passage.lic.licenses.LicenseRequisitesDescriptor; +import org.eclipse.passage.lic.licenses.PersonalLicensePackDescriptor; import org.eclipse.passage.lic.licenses.PersonalLicenseRequisitesDescriptor; import org.eclipse.passage.lic.licenses.ProductRefDescriptor; import org.eclipse.passage.lic.licenses.UserGrantDescriptor; @@ -41,6 +42,7 @@ import org.eclipse.passage.lic.licenses.model.api.CompanyRef; import org.eclipse.passage.lic.licenses.model.api.EvaluationInstructions; import org.eclipse.passage.lic.licenses.model.api.FeatureGrant; +import org.eclipse.passage.lic.licenses.model.api.FeatureRef; import org.eclipse.passage.lic.licenses.model.api.FloatingLicenseAccess; import org.eclipse.passage.lic.licenses.model.api.FloatingLicensePack; import org.eclipse.passage.lic.licenses.model.api.FloatingLicenseRequisites; @@ -89,7 +91,7 @@ public class LicensesPackageImpl extends EPackageImpl implements LicensesPackage * * @generated */ - private EClass licensePackDescriptorEClass = null; + private EClass personalLicensePackDescriptorEClass = null; /** * @@ -105,6 +107,13 @@ public class LicensesPackageImpl extends EPackageImpl implements LicensesPackage */ private EClass productRefDescriptorEClass = null; + /** + * + * + * @generated + */ + private EClass featureRefDescriptorEClass = null; + /** * * @@ -259,6 +268,13 @@ public class LicensesPackageImpl extends EPackageImpl implements LicensesPackage */ private EClass productRefEClass = null; + /** + * + * + * @generated + */ + private EClass featureRefEClass = null; + /** * * @@ -433,8 +449,8 @@ public EClass getLicensePlanFeatureDescriptor() { * @generated */ @Override - public EClass getLicensePackDescriptor() { - return licensePackDescriptorEClass; + public EClass getPersonalLicensePackDescriptor() { + return personalLicensePackDescriptorEClass; } /** @@ -457,6 +473,16 @@ public EClass getProductRefDescriptor() { return productRefDescriptorEClass; } + /** + * + * + * @generated + */ + @Override + public EClass getFeatureRefDescriptor() { + return featureRefDescriptorEClass; + } + /** * * @@ -673,28 +699,8 @@ public EClass getLicensePlanFeature() { * @generated */ @Override - public EAttribute getLicensePlanFeature_FeatureIdentifier() { - return (EAttribute) licensePlanFeatureEClass.getEStructuralFeatures().get(0); - } - - /** - * - * - * @generated - */ - @Override - public EAttribute getLicensePlanFeature_MatchVersion() { - return (EAttribute) licensePlanFeatureEClass.getEStructuralFeatures().get(1); - } - - /** - * - * - * @generated - */ - @Override - public EAttribute getLicensePlanFeature_MatchRule() { - return (EAttribute) licensePlanFeatureEClass.getEStructuralFeatures().get(2); + public EReference getLicensePlanFeature_Feature() { + return (EReference) licensePlanFeatureEClass.getEStructuralFeatures().get(0); } /** @@ -704,7 +710,7 @@ public EAttribute getLicensePlanFeature_MatchRule() { */ @Override public EReference getLicensePlanFeature_LicensePlan() { - return (EReference) licensePlanFeatureEClass.getEStructuralFeatures().get(3); + return (EReference) licensePlanFeatureEClass.getEStructuralFeatures().get(1); } /** @@ -763,8 +769,8 @@ public EAttribute getLicenseGrant_Identifier() { * @generated */ @Override - public EAttribute getLicenseGrant_FeatureIdentifier() { - return (EAttribute) licenseGrantEClass.getEStructuralFeatures().get(1); + public EReference getLicenseGrant_Feature() { + return (EReference) licenseGrantEClass.getEStructuralFeatures().get(1); } /** @@ -773,8 +779,8 @@ public EAttribute getLicenseGrant_FeatureIdentifier() { * @generated */ @Override - public EAttribute getLicenseGrant_MatchVersion() { - return (EAttribute) licenseGrantEClass.getEStructuralFeatures().get(2); + public EReference getLicenseGrant_Valid() { + return (EReference) licenseGrantEClass.getEStructuralFeatures().get(2); } /** @@ -783,48 +789,8 @@ public EAttribute getLicenseGrant_MatchVersion() { * @generated */ @Override - public EAttribute getLicenseGrant_MatchRule() { - return (EAttribute) licenseGrantEClass.getEStructuralFeatures().get(3); - } - - /** - * - * - * @generated - */ - @Override - public EAttribute getLicenseGrant_ValidFrom() { - return (EAttribute) licenseGrantEClass.getEStructuralFeatures().get(4); - } - - /** - * - * - * @generated - */ - @Override - public EAttribute getLicenseGrant_ValidUntil() { - return (EAttribute) licenseGrantEClass.getEStructuralFeatures().get(5); - } - - /** - * - * - * @generated - */ - @Override - public EAttribute getLicenseGrant_ConditionType() { - return (EAttribute) licenseGrantEClass.getEStructuralFeatures().get(6); - } - - /** - * - * - * @generated - */ - @Override - public EAttribute getLicenseGrant_ConditionExpression() { - return (EAttribute) licenseGrantEClass.getEStructuralFeatures().get(7); + public EReference getLicenseGrant_UserAuthentication() { + return (EReference) licenseGrantEClass.getEStructuralFeatures().get(3); } /** @@ -834,7 +800,7 @@ public EAttribute getLicenseGrant_ConditionExpression() { */ @Override public EAttribute getLicenseGrant_Capacity() { - return (EAttribute) licenseGrantEClass.getEStructuralFeatures().get(8); + return (EAttribute) licenseGrantEClass.getEStructuralFeatures().get(4); } /** @@ -844,7 +810,7 @@ public EAttribute getLicenseGrant_Capacity() { */ @Override public EReference getLicenseGrant_LicensePack() { - return (EReference) licenseGrantEClass.getEStructuralFeatures().get(9); + return (EReference) licenseGrantEClass.getEStructuralFeatures().get(5); } /** @@ -1027,6 +993,46 @@ public EAttribute getProductRef_Version() { return (EAttribute) productRefEClass.getEStructuralFeatures().get(1); } + /** + * + * + * @generated + */ + @Override + public EClass getFeatureRef() { + return featureRefEClass; + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getFeatureRef_Identifier() { + return (EAttribute) featureRefEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getFeatureRef_Version() { + return (EAttribute) featureRefEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getFeatureRef_MatchingRule() { + return (EAttribute) featureRefEClass.getEStructuralFeatures().get(2); + } + /** * * @@ -1511,13 +1517,15 @@ public void createPackageContents() { licensePlanFeatureDescriptorEClass = createEClass(LICENSE_PLAN_FEATURE_DESCRIPTOR); - licensePackDescriptorEClass = createEClass(LICENSE_PACK_DESCRIPTOR); + personalLicensePackDescriptorEClass = createEClass(PERSONAL_LICENSE_PACK_DESCRIPTOR); licenseGrantDescriptorEClass = createEClass(LICENSE_GRANT_DESCRIPTOR); + userRefDescriptorEClass = createEClass(USER_REF_DESCRIPTOR); + productRefDescriptorEClass = createEClass(PRODUCT_REF_DESCRIPTOR); - userRefDescriptorEClass = createEClass(USER_REF_DESCRIPTOR); + featureRefDescriptorEClass = createEClass(FEATURE_REF_DESCRIPTOR); companyRefDescriptorEClass = createEClass(COMPANY_REF_DESCRIPTOR); @@ -1552,9 +1560,7 @@ public void createPackageContents() { createEReference(licensePlanEClass, LICENSE_PLAN__FLOATING); licensePlanFeatureEClass = createEClass(LICENSE_PLAN_FEATURE); - createEAttribute(licensePlanFeatureEClass, LICENSE_PLAN_FEATURE__FEATURE_IDENTIFIER); - createEAttribute(licensePlanFeatureEClass, LICENSE_PLAN_FEATURE__MATCH_VERSION); - createEAttribute(licensePlanFeatureEClass, LICENSE_PLAN_FEATURE__MATCH_RULE); + createEReference(licensePlanFeatureEClass, LICENSE_PLAN_FEATURE__FEATURE); createEReference(licensePlanFeatureEClass, LICENSE_PLAN_FEATURE__LICENSE_PLAN); personalLicensePackEClass = createEClass(PERSONAL_LICENSE_PACK); @@ -1563,13 +1569,9 @@ public void createPackageContents() { licenseGrantEClass = createEClass(LICENSE_GRANT); createEAttribute(licenseGrantEClass, LICENSE_GRANT__IDENTIFIER); - createEAttribute(licenseGrantEClass, LICENSE_GRANT__FEATURE_IDENTIFIER); - createEAttribute(licenseGrantEClass, LICENSE_GRANT__MATCH_VERSION); - createEAttribute(licenseGrantEClass, LICENSE_GRANT__MATCH_RULE); - createEAttribute(licenseGrantEClass, LICENSE_GRANT__VALID_FROM); - createEAttribute(licenseGrantEClass, LICENSE_GRANT__VALID_UNTIL); - createEAttribute(licenseGrantEClass, LICENSE_GRANT__CONDITION_TYPE); - createEAttribute(licenseGrantEClass, LICENSE_GRANT__CONDITION_EXPRESSION); + createEReference(licenseGrantEClass, LICENSE_GRANT__FEATURE); + createEReference(licenseGrantEClass, LICENSE_GRANT__VALID); + createEReference(licenseGrantEClass, LICENSE_GRANT__USER_AUTHENTICATION); createEAttribute(licenseGrantEClass, LICENSE_GRANT__CAPACITY); createEReference(licenseGrantEClass, LICENSE_GRANT__LICENSE_PACK); @@ -1592,13 +1594,18 @@ public void createPackageContents() { floatingLicenseRequisitesEClass = createEClass(FLOATING_LICENSE_REQUISITES); createEReference(floatingLicenseRequisitesEClass, FLOATING_LICENSE_REQUISITES__COMPANY); + userRefEClass = createEClass(USER_REF); + createEAttribute(userRefEClass, USER_REF__IDENTIFIER); + createEAttribute(userRefEClass, USER_REF__NAME); + productRefEClass = createEClass(PRODUCT_REF); createEAttribute(productRefEClass, PRODUCT_REF__IDENTIFIER); createEAttribute(productRefEClass, PRODUCT_REF__VERSION); - userRefEClass = createEClass(USER_REF); - createEAttribute(userRefEClass, USER_REF__IDENTIFIER); - createEAttribute(userRefEClass, USER_REF__NAME); + featureRefEClass = createEClass(FEATURE_REF); + createEAttribute(featureRefEClass, FEATURE_REF__IDENTIFIER); + createEAttribute(featureRefEClass, FEATURE_REF__VERSION); + createEAttribute(featureRefEClass, FEATURE_REF__MATCHING_RULE); companyRefEClass = createEClass(COMPANY_REF); createEAttribute(companyRefEClass, COMPANY_REF__IDENTIFIER); @@ -1687,7 +1694,7 @@ public void initializePackageContents() { floatingLicenseRequisitesDescriptorEClass.getESuperTypes().add(this.getLicenseRequisitesDescriptor()); licensePlanEClass.getESuperTypes().add(this.getLicensePlanDescriptor()); licensePlanFeatureEClass.getESuperTypes().add(this.getLicensePlanFeatureDescriptor()); - personalLicensePackEClass.getESuperTypes().add(this.getLicensePackDescriptor()); + personalLicensePackEClass.getESuperTypes().add(this.getPersonalLicensePackDescriptor()); licenseGrantEClass.getESuperTypes().add(this.getLicenseGrantDescriptor()); floatingLicensePackEClass.getESuperTypes().add(this.getFloatingLicensePackDescriptor()); licenseRequisitesEClass.getESuperTypes().add(this.getLicenseRequisitesDescriptor()); @@ -1695,8 +1702,9 @@ public void initializePackageContents() { personalLicenseRequisitesEClass.getESuperTypes().add(this.getPersonalLicenseRequisitesDescriptor()); floatingLicenseRequisitesEClass.getESuperTypes().add(this.getLicenseRequisites()); floatingLicenseRequisitesEClass.getESuperTypes().add(this.getFloatingLicenseRequisitesDescriptor()); - productRefEClass.getESuperTypes().add(this.getProductRefDescriptor()); userRefEClass.getESuperTypes().add(this.getUserRefDescriptor()); + productRefEClass.getESuperTypes().add(this.getProductRefDescriptor()); + featureRefEClass.getESuperTypes().add(this.getFeatureRefDescriptor()); companyRefEClass.getESuperTypes().add(this.getCompanyRefDescriptor()); floatingServerEClass.getESuperTypes().add(this.getFloatingServerDescriptor()); userGrantEClass.getESuperTypes().add(this.getUserGrantDescriptor()); @@ -1714,17 +1722,20 @@ public void initializePackageContents() { initEClass(licensePlanFeatureDescriptorEClass, LicensePlanFeatureDescriptor.class, "LicensePlanFeatureDescriptor", IS_ABSTRACT, IS_INTERFACE, !IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$ - initEClass(licensePackDescriptorEClass, PersonalLicensePackDescriptor.class, "LicensePackDescriptor", IS_ABSTRACT, //$NON-NLS-1$ - IS_INTERFACE, !IS_GENERATED_INSTANCE_CLASS); + initEClass(personalLicensePackDescriptorEClass, PersonalLicensePackDescriptor.class, + "PersonalLicensePackDescriptor", IS_ABSTRACT, IS_INTERFACE, !IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$ initEClass(licenseGrantDescriptorEClass, LicenseGrantDescriptor.class, "LicenseGrantDescriptor", IS_ABSTRACT, //$NON-NLS-1$ IS_INTERFACE, !IS_GENERATED_INSTANCE_CLASS); + initEClass(userRefDescriptorEClass, UserRefDescriptor.class, "UserRefDescriptor", IS_ABSTRACT, IS_INTERFACE, //$NON-NLS-1$ + !IS_GENERATED_INSTANCE_CLASS); + initEClass(productRefDescriptorEClass, ProductRefDescriptor.class, "ProductRefDescriptor", IS_ABSTRACT, //$NON-NLS-1$ IS_INTERFACE, !IS_GENERATED_INSTANCE_CLASS); - initEClass(userRefDescriptorEClass, UserRefDescriptor.class, "UserRefDescriptor", IS_ABSTRACT, IS_INTERFACE, //$NON-NLS-1$ - !IS_GENERATED_INSTANCE_CLASS); + initEClass(featureRefDescriptorEClass, FeatureRefDescriptor.class, "FeatureRefDescriptor", IS_ABSTRACT, //$NON-NLS-1$ + IS_INTERFACE, !IS_GENERATED_INSTANCE_CLASS); initEClass(companyRefDescriptorEClass, CompanyRefDescriptor.class, "CompanyRefDescriptor", IS_ABSTRACT, //$NON-NLS-1$ IS_INTERFACE, !IS_GENERATED_INSTANCE_CLASS); @@ -1784,15 +1795,9 @@ public void initializePackageContents() { initEClass(licensePlanFeatureEClass, LicensePlanFeature.class, "LicensePlanFeature", !IS_ABSTRACT, //$NON-NLS-1$ !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEAttribute(getLicensePlanFeature_FeatureIdentifier(), ecorePackage.getEString(), "featureIdentifier", null, //$NON-NLS-1$ - 1, 1, LicensePlanFeature.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, - IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getLicensePlanFeature_MatchVersion(), ecorePackage.getEString(), "matchVersion", "0.0.0", 1, 1, //$NON-NLS-1$//$NON-NLS-2$ - LicensePlanFeature.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, - !IS_DERIVED, IS_ORDERED); - initEAttribute(getLicensePlanFeature_MatchRule(), ecorePackage.getEString(), "matchRule", null, 0, 1, //$NON-NLS-1$ - LicensePlanFeature.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, - !IS_DERIVED, IS_ORDERED); + initEReference(getLicensePlanFeature_Feature(), this.getFeatureRef(), null, "feature", null, 1, 1, //$NON-NLS-1$ + LicensePlanFeature.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, + !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEReference(getLicensePlanFeature_LicensePlan(), this.getLicensePlan(), null, "licensePlan", null, 1, 1, //$NON-NLS-1$ LicensePlanFeature.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); @@ -1811,27 +1816,15 @@ public void initializePackageContents() { initEAttribute(getLicenseGrant_Identifier(), ecorePackage.getEString(), "identifier", null, 0, 1, //$NON-NLS-1$ LicenseGrant.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getLicenseGrant_FeatureIdentifier(), ecorePackage.getEString(), "featureIdentifier", null, 1, 1, //$NON-NLS-1$ - LicenseGrant.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, - !IS_DERIVED, IS_ORDERED); - initEAttribute(getLicenseGrant_MatchVersion(), ecorePackage.getEString(), "matchVersion", "0.0.0", 1, 1, //$NON-NLS-1$//$NON-NLS-2$ - LicenseGrant.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, - !IS_DERIVED, IS_ORDERED); - initEAttribute(getLicenseGrant_MatchRule(), ecorePackage.getEString(), "matchRule", null, 0, 1, //$NON-NLS-1$ - LicenseGrant.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, - !IS_DERIVED, IS_ORDERED); - initEAttribute(getLicenseGrant_ValidFrom(), ecorePackage.getEDate(), "validFrom", null, 1, 1, //$NON-NLS-1$ - LicenseGrant.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, - !IS_DERIVED, IS_ORDERED); - initEAttribute(getLicenseGrant_ValidUntil(), ecorePackage.getEDate(), "validUntil", null, 1, 1, //$NON-NLS-1$ - LicenseGrant.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, - !IS_DERIVED, IS_ORDERED); - initEAttribute(getLicenseGrant_ConditionType(), ecorePackage.getEString(), "conditionType", null, 1, 1, //$NON-NLS-1$ - LicenseGrant.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, - !IS_DERIVED, IS_ORDERED); - initEAttribute(getLicenseGrant_ConditionExpression(), ecorePackage.getEString(), "conditionExpression", null, 1, //$NON-NLS-1$ - 1, LicenseGrant.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, - !IS_DERIVED, IS_ORDERED); + initEReference(getLicenseGrant_Feature(), this.getFeatureRef(), null, "feature", null, 1, 1, LicenseGrant.class, //$NON-NLS-1$ + !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, + IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEReference(getLicenseGrant_Valid(), this.getValidityPeriod(), null, "valid", null, 1, 1, LicenseGrant.class, //$NON-NLS-1$ + !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, + IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEReference(getLicenseGrant_UserAuthentication(), this.getEvaluationInstructions(), null, + "userAuthentication", null, 1, 1, LicenseGrant.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, //$NON-NLS-1$ + IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEAttribute(getLicenseGrant_Capacity(), ecorePackage.getEInt(), "capacity", "1", 0, 1, LicenseGrant.class, //$NON-NLS-1$//$NON-NLS-2$ !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEReference(getLicenseGrant_LicensePack(), this.getPersonalLicensePack(), @@ -1884,6 +1877,12 @@ public void initializePackageContents() { FloatingLicenseRequisites.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEClass(userRefEClass, UserRef.class, "UserRef", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$ + initEAttribute(getUserRef_Identifier(), ecorePackage.getEString(), "identifier", null, 1, 1, UserRef.class, //$NON-NLS-1$ + !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getUserRef_Name(), ecorePackage.getEString(), "name", null, 1, 1, UserRef.class, !IS_TRANSIENT, //$NON-NLS-1$ + !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEClass(productRefEClass, ProductRef.class, "ProductRef", !IS_ABSTRACT, !IS_INTERFACE, //$NON-NLS-1$ IS_GENERATED_INSTANCE_CLASS); initEAttribute(getProductRef_Identifier(), ecorePackage.getEString(), "identifier", null, 1, 1, //$NON-NLS-1$ @@ -1892,11 +1891,16 @@ public void initializePackageContents() { initEAttribute(getProductRef_Version(), ecorePackage.getEString(), "version", null, 1, 1, ProductRef.class, //$NON-NLS-1$ !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEClass(userRefEClass, UserRef.class, "UserRef", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$ - initEAttribute(getUserRef_Identifier(), ecorePackage.getEString(), "identifier", null, 1, 1, UserRef.class, //$NON-NLS-1$ + initEClass(featureRefEClass, FeatureRef.class, "FeatureRef", !IS_ABSTRACT, !IS_INTERFACE, //$NON-NLS-1$ + IS_GENERATED_INSTANCE_CLASS); + initEAttribute(getFeatureRef_Identifier(), ecorePackage.getEString(), "identifier", null, 1, 1, //$NON-NLS-1$ + FeatureRef.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, + !IS_DERIVED, IS_ORDERED); + initEAttribute(getFeatureRef_Version(), ecorePackage.getEString(), "version", null, 1, 1, FeatureRef.class, //$NON-NLS-1$ !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getUserRef_Name(), ecorePackage.getEString(), "name", null, 1, 1, UserRef.class, !IS_TRANSIENT, //$NON-NLS-1$ - !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getFeatureRef_MatchingRule(), ecorePackage.getEString(), "matchingRule", null, 1, 1, //$NON-NLS-1$ + FeatureRef.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, + !IS_DERIVED, IS_ORDERED); initEClass(companyRefEClass, CompanyRef.class, "CompanyRef", !IS_ABSTRACT, !IS_INTERFACE, //$NON-NLS-1$ IS_GENERATED_INSTANCE_CLASS); diff --git a/bundles/org.eclipse.passage.lic.licenses.model/src-gen/org/eclipse/passage/lic/licenses/model/meta/LicensesFactory.java b/bundles/org.eclipse.passage.lic.licenses.model/src-gen/org/eclipse/passage/lic/licenses/model/meta/LicensesFactory.java index acf2da88f..3c7f875df 100644 --- a/bundles/org.eclipse.passage.lic.licenses.model/src-gen/org/eclipse/passage/lic/licenses/model/meta/LicensesFactory.java +++ b/bundles/org.eclipse.passage.lic.licenses.model/src-gen/org/eclipse/passage/lic/licenses/model/meta/LicensesFactory.java @@ -17,6 +17,7 @@ import org.eclipse.passage.lic.licenses.model.api.CompanyRef; import org.eclipse.passage.lic.licenses.model.api.EvaluationInstructions; import org.eclipse.passage.lic.licenses.model.api.FeatureGrant; +import org.eclipse.passage.lic.licenses.model.api.FeatureRef; import org.eclipse.passage.lic.licenses.model.api.FloatingLicenseAccess; import org.eclipse.passage.lic.licenses.model.api.FloatingLicensePack; import org.eclipse.passage.lic.licenses.model.api.FloatingLicenseRequisites; @@ -123,6 +124,15 @@ public interface LicensesFactory extends EFactory { */ ProductRef createProductRef(); + /** + * Returns a new object of class 'Feature Ref'. + * + * + * @return a new object of class 'Feature Ref'. + * @generated + */ + FeatureRef createFeatureRef(); + /** * Returns a new object of class 'User Ref'. * diff --git a/bundles/org.eclipse.passage.lic.licenses.model/src-gen/org/eclipse/passage/lic/licenses/model/meta/LicensesPackage.java b/bundles/org.eclipse.passage.lic.licenses.model/src-gen/org/eclipse/passage/lic/licenses/model/meta/LicensesPackage.java index 2516556df..f38f96efe 100644 --- a/bundles/org.eclipse.passage.lic.licenses.model/src-gen/org/eclipse/passage/lic/licenses/model/meta/LicensesPackage.java +++ b/bundles/org.eclipse.passage.lic.licenses.model/src-gen/org/eclipse/passage/lic/licenses/model/meta/LicensesPackage.java @@ -123,32 +123,32 @@ public interface LicensesPackage extends EPackage { int LICENSE_PLAN_FEATURE_DESCRIPTOR_OPERATION_COUNT = 0; /** - * The meta object id for the '{@link org.eclipse.passage.lic.licenses.PersonalLicensePackDescriptor License Pack Descriptor}' class. + * The meta object id for the '{@link org.eclipse.passage.lic.licenses.PersonalLicensePackDescriptor Personal License Pack Descriptor}' class. * * * @see org.eclipse.passage.lic.licenses.PersonalLicensePackDescriptor - * @see org.eclipse.passage.lic.licenses.model.impl.LicensesPackageImpl#getLicensePackDescriptor() + * @see org.eclipse.passage.lic.licenses.model.impl.LicensesPackageImpl#getPersonalLicensePackDescriptor() * @generated */ - int LICENSE_PACK_DESCRIPTOR = 2; + int PERSONAL_LICENSE_PACK_DESCRIPTOR = 2; /** - * The number of structural features of the 'License Pack Descriptor' class. + * The number of structural features of the 'Personal License Pack Descriptor' class. * * * @generated * @ordered */ - int LICENSE_PACK_DESCRIPTOR_FEATURE_COUNT = 0; + int PERSONAL_LICENSE_PACK_DESCRIPTOR_FEATURE_COUNT = 0; /** - * The number of operations of the 'License Pack Descriptor' class. + * The number of operations of the 'Personal License Pack Descriptor' class. * * * @generated * @ordered */ - int LICENSE_PACK_DESCRIPTOR_OPERATION_COUNT = 0; + int PERSONAL_LICENSE_PACK_DESCRIPTOR_OPERATION_COUNT = 0; /** * The meta object id for the '{@link org.eclipse.passage.lic.licenses.LicenseGrantDescriptor License Grant Descriptor}' class. @@ -186,53 +186,81 @@ public interface LicensesPackage extends EPackage { * @see org.eclipse.passage.lic.licenses.model.impl.LicensesPackageImpl#getProductRefDescriptor() * @generated */ - int PRODUCT_REF_DESCRIPTOR = 4; + int PRODUCT_REF_DESCRIPTOR = 5; /** - * The number of structural features of the 'Product Ref Descriptor' class. + * The meta object id for the '{@link org.eclipse.passage.lic.licenses.FeatureRefDescriptor Feature Ref Descriptor}' class. + * + * + * @see org.eclipse.passage.lic.licenses.FeatureRefDescriptor + * @see org.eclipse.passage.lic.licenses.model.impl.LicensesPackageImpl#getFeatureRefDescriptor() + * @generated + */ + int FEATURE_REF_DESCRIPTOR = 6; + + /** + * The meta object id for the '{@link org.eclipse.passage.lic.licenses.UserRefDescriptor User Ref Descriptor}' class. + * + * + * @see org.eclipse.passage.lic.licenses.UserRefDescriptor + * @see org.eclipse.passage.lic.licenses.model.impl.LicensesPackageImpl#getUserRefDescriptor() + * @generated + */ + int USER_REF_DESCRIPTOR = 4; + + /** + * The number of structural features of the 'User Ref Descriptor' class. * * * @generated * @ordered */ - int PRODUCT_REF_DESCRIPTOR_FEATURE_COUNT = 0; + int USER_REF_DESCRIPTOR_FEATURE_COUNT = 0; /** - * The number of operations of the 'Product Ref Descriptor' class. + * The number of operations of the 'User Ref Descriptor' class. * * * @generated * @ordered */ - int PRODUCT_REF_DESCRIPTOR_OPERATION_COUNT = 0; + int USER_REF_DESCRIPTOR_OPERATION_COUNT = 0; /** - * The meta object id for the '{@link org.eclipse.passage.lic.licenses.UserRefDescriptor User Ref Descriptor}' class. + * The number of structural features of the 'Product Ref Descriptor' class. * * - * @see org.eclipse.passage.lic.licenses.UserRefDescriptor - * @see org.eclipse.passage.lic.licenses.model.impl.LicensesPackageImpl#getUserRefDescriptor() * @generated + * @ordered */ - int USER_REF_DESCRIPTOR = 5; + int PRODUCT_REF_DESCRIPTOR_FEATURE_COUNT = 0; /** - * The number of structural features of the 'User Ref Descriptor' class. + * The number of operations of the 'Product Ref Descriptor' class. * * * @generated * @ordered */ - int USER_REF_DESCRIPTOR_FEATURE_COUNT = 0; + int PRODUCT_REF_DESCRIPTOR_OPERATION_COUNT = 0; /** - * The number of operations of the 'User Ref Descriptor' class. + * The number of structural features of the 'Feature Ref Descriptor' class. * * * @generated * @ordered */ - int USER_REF_DESCRIPTOR_OPERATION_COUNT = 0; + int FEATURE_REF_DESCRIPTOR_FEATURE_COUNT = 0; + + /** + * The number of operations of the 'Feature Ref Descriptor' class. + * + * + * @generated + * @ordered + */ + int FEATURE_REF_DESCRIPTOR_OPERATION_COUNT = 0; /** * The meta object id for the '{@link org.eclipse.passage.lic.licenses.CompanyRefDescriptor Company Ref Descriptor}' class. @@ -242,7 +270,7 @@ public interface LicensesPackage extends EPackage { * @see org.eclipse.passage.lic.licenses.model.impl.LicensesPackageImpl#getCompanyRefDescriptor() * @generated */ - int COMPANY_REF_DESCRIPTOR = 6; + int COMPANY_REF_DESCRIPTOR = 7; /** * The number of structural features of the 'Company Ref Descriptor' class. @@ -270,7 +298,7 @@ public interface LicensesPackage extends EPackage { * @see org.eclipse.passage.lic.licenses.model.impl.LicensesPackageImpl#getLicenseRequisitesDescriptor() * @generated */ - int LICENSE_REQUISITES_DESCRIPTOR = 7; + int LICENSE_REQUISITES_DESCRIPTOR = 8; /** * The number of structural features of the 'License Requisites Descriptor' class. @@ -298,7 +326,7 @@ public interface LicensesPackage extends EPackage { * @see org.eclipse.passage.lic.licenses.model.impl.LicensesPackageImpl#getPersonalLicenseRequisitesDescriptor() * @generated */ - int PERSONAL_LICENSE_REQUISITES_DESCRIPTOR = 8; + int PERSONAL_LICENSE_REQUISITES_DESCRIPTOR = 9; /** * The number of structural features of the 'Personal License Requisites Descriptor' class. @@ -326,7 +354,7 @@ public interface LicensesPackage extends EPackage { * @see org.eclipse.passage.lic.licenses.model.impl.LicensesPackageImpl#getFloatingLicenseRequisitesDescriptor() * @generated */ - int FLOATING_LICENSE_REQUISITES_DESCRIPTOR = 9; + int FLOATING_LICENSE_REQUISITES_DESCRIPTOR = 10; /** * The number of structural features of the 'Floating License Requisites Descriptor' class. @@ -354,7 +382,7 @@ public interface LicensesPackage extends EPackage { * @see org.eclipse.passage.lic.licenses.model.impl.LicensesPackageImpl#getValidityPeriodDescriptor() * @generated */ - int VALIDITY_PERIOD_DESCRIPTOR = 10; + int VALIDITY_PERIOD_DESCRIPTOR = 11; /** * The number of structural features of the 'Validity Period Descriptor' class. @@ -382,7 +410,7 @@ public interface LicensesPackage extends EPackage { * @see org.eclipse.passage.lic.licenses.model.impl.LicensesPackageImpl#getValidityPeriodClosedDescriptor() * @generated */ - int VALIDITY_PERIOD_CLOSED_DESCRIPTOR = 11; + int VALIDITY_PERIOD_CLOSED_DESCRIPTOR = 12; /** * The number of structural features of the 'Validity Period Closed Descriptor' class. @@ -410,7 +438,7 @@ public interface LicensesPackage extends EPackage { * @see org.eclipse.passage.lic.licenses.model.impl.LicensesPackageImpl#getFloatingLicensePackDescriptor() * @generated */ - int FLOATING_LICENSE_PACK_DESCRIPTOR = 12; + int FLOATING_LICENSE_PACK_DESCRIPTOR = 13; /** * The number of structural features of the 'Floating License Pack Descriptor' class. @@ -438,7 +466,7 @@ public interface LicensesPackage extends EPackage { * @see org.eclipse.passage.lic.licenses.model.impl.LicensesPackageImpl#getFloatingServerDescriptor() * @generated */ - int FLOATING_SERVER_DESCRIPTOR = 13; + int FLOATING_SERVER_DESCRIPTOR = 14; /** * The number of structural features of the 'Floating Server Descriptor' class. @@ -466,7 +494,7 @@ public interface LicensesPackage extends EPackage { * @see org.eclipse.passage.lic.licenses.model.impl.LicensesPackageImpl#getUserGrantDescriptor() * @generated */ - int USER_GRANT_DESCRIPTOR = 14; + int USER_GRANT_DESCRIPTOR = 15; /** * The number of structural features of the 'User Grant Descriptor' class. @@ -494,7 +522,7 @@ public interface LicensesPackage extends EPackage { * @see org.eclipse.passage.lic.licenses.model.impl.LicensesPackageImpl#getFeatureGrantDescriptor() * @generated */ - int FEATURE_GRANT_DESCRIPTOR = 15; + int FEATURE_GRANT_DESCRIPTOR = 16; /** * The number of structural features of the 'Feature Grant Descriptor' class. @@ -522,7 +550,7 @@ public interface LicensesPackage extends EPackage { * @see org.eclipse.passage.lic.licenses.model.impl.LicensesPackageImpl#getEvaluationInstructionsDescriptor() * @generated */ - int EVALUATION_INSTRUCTIONS_DESCRIPTOR = 16; + int EVALUATION_INSTRUCTIONS_DESCRIPTOR = 17; /** * The number of structural features of the 'Evaluation Instructions Descriptor' class. @@ -550,7 +578,7 @@ public interface LicensesPackage extends EPackage { * @see org.eclipse.passage.lic.licenses.model.impl.LicensesPackageImpl#getVersionMatchDescriptor() * @generated */ - int VERSION_MATCH_DESCRIPTOR = 17; + int VERSION_MATCH_DESCRIPTOR = 18; /** * The number of structural features of the 'Version Match Descriptor' class. @@ -578,7 +606,7 @@ public interface LicensesPackage extends EPackage { * @see org.eclipse.passage.lic.licenses.model.impl.LicensesPackageImpl#getLicensePlan() * @generated */ - int LICENSE_PLAN = 18; + int LICENSE_PLAN = 19; /** * The feature id for the 'Identifier' attribute. @@ -660,34 +688,16 @@ public interface LicensesPackage extends EPackage { * @see org.eclipse.passage.lic.licenses.model.impl.LicensesPackageImpl#getLicensePlanFeature() * @generated */ - int LICENSE_PLAN_FEATURE = 19; - - /** - * The feature id for the 'Feature Identifier' attribute. - * - * - * @generated - * @ordered - */ - int LICENSE_PLAN_FEATURE__FEATURE_IDENTIFIER = LICENSE_PLAN_FEATURE_DESCRIPTOR_FEATURE_COUNT + 0; - - /** - * The feature id for the 'Match Version' attribute. - * - * - * @generated - * @ordered - */ - int LICENSE_PLAN_FEATURE__MATCH_VERSION = LICENSE_PLAN_FEATURE_DESCRIPTOR_FEATURE_COUNT + 1; + int LICENSE_PLAN_FEATURE = 20; /** - * The feature id for the 'Match Rule' attribute. + * The feature id for the 'Feature' containment reference. * * * @generated * @ordered */ - int LICENSE_PLAN_FEATURE__MATCH_RULE = LICENSE_PLAN_FEATURE_DESCRIPTOR_FEATURE_COUNT + 2; + int LICENSE_PLAN_FEATURE__FEATURE = LICENSE_PLAN_FEATURE_DESCRIPTOR_FEATURE_COUNT + 0; /** * The feature id for the 'License Plan' reference. @@ -696,7 +706,7 @@ public interface LicensesPackage extends EPackage { * @generated * @ordered */ - int LICENSE_PLAN_FEATURE__LICENSE_PLAN = LICENSE_PLAN_FEATURE_DESCRIPTOR_FEATURE_COUNT + 3; + int LICENSE_PLAN_FEATURE__LICENSE_PLAN = LICENSE_PLAN_FEATURE_DESCRIPTOR_FEATURE_COUNT + 1; /** * The number of structural features of the 'License Plan Feature' class. @@ -705,7 +715,7 @@ public interface LicensesPackage extends EPackage { * @generated * @ordered */ - int LICENSE_PLAN_FEATURE_FEATURE_COUNT = LICENSE_PLAN_FEATURE_DESCRIPTOR_FEATURE_COUNT + 4; + int LICENSE_PLAN_FEATURE_FEATURE_COUNT = LICENSE_PLAN_FEATURE_DESCRIPTOR_FEATURE_COUNT + 2; /** * The number of operations of the 'License Plan Feature' class. @@ -724,7 +734,7 @@ public interface LicensesPackage extends EPackage { * @see org.eclipse.passage.lic.licenses.model.impl.LicensesPackageImpl#getPersonalLicensePack() * @generated */ - int PERSONAL_LICENSE_PACK = 20; + int PERSONAL_LICENSE_PACK = 21; /** * The feature id for the 'License' containment reference. @@ -733,7 +743,7 @@ public interface LicensesPackage extends EPackage { * @generated * @ordered */ - int PERSONAL_LICENSE_PACK__LICENSE = LICENSE_PACK_DESCRIPTOR_FEATURE_COUNT + 0; + int PERSONAL_LICENSE_PACK__LICENSE = PERSONAL_LICENSE_PACK_DESCRIPTOR_FEATURE_COUNT + 0; /** * The feature id for the 'Grants' containment reference list. @@ -742,7 +752,7 @@ public interface LicensesPackage extends EPackage { * @generated * @ordered */ - int PERSONAL_LICENSE_PACK__GRANTS = LICENSE_PACK_DESCRIPTOR_FEATURE_COUNT + 1; + int PERSONAL_LICENSE_PACK__GRANTS = PERSONAL_LICENSE_PACK_DESCRIPTOR_FEATURE_COUNT + 1; /** * The number of structural features of the 'Personal License Pack' class. @@ -751,7 +761,7 @@ public interface LicensesPackage extends EPackage { * @generated * @ordered */ - int PERSONAL_LICENSE_PACK_FEATURE_COUNT = LICENSE_PACK_DESCRIPTOR_FEATURE_COUNT + 2; + int PERSONAL_LICENSE_PACK_FEATURE_COUNT = PERSONAL_LICENSE_PACK_DESCRIPTOR_FEATURE_COUNT + 2; /** * The number of operations of the 'Personal License Pack' class. @@ -760,7 +770,7 @@ public interface LicensesPackage extends EPackage { * @generated * @ordered */ - int PERSONAL_LICENSE_PACK_OPERATION_COUNT = LICENSE_PACK_DESCRIPTOR_OPERATION_COUNT + 0; + int PERSONAL_LICENSE_PACK_OPERATION_COUNT = PERSONAL_LICENSE_PACK_DESCRIPTOR_OPERATION_COUNT + 0; /** * The meta object id for the '{@link org.eclipse.passage.lic.licenses.model.impl.LicenseGrantImpl License Grant}' class. @@ -770,7 +780,7 @@ public interface LicensesPackage extends EPackage { * @see org.eclipse.passage.lic.licenses.model.impl.LicensesPackageImpl#getLicenseGrant() * @generated */ - int LICENSE_GRANT = 21; + int LICENSE_GRANT = 22; /** * The feature id for the 'Identifier' attribute. @@ -782,67 +792,31 @@ public interface LicensesPackage extends EPackage { int LICENSE_GRANT__IDENTIFIER = LICENSE_GRANT_DESCRIPTOR_FEATURE_COUNT + 0; /** - * The feature id for the 'Feature Identifier' attribute. - * - * - * @generated - * @ordered - */ - int LICENSE_GRANT__FEATURE_IDENTIFIER = LICENSE_GRANT_DESCRIPTOR_FEATURE_COUNT + 1; - - /** - * The feature id for the 'Match Version' attribute. + * The feature id for the 'Feature' containment reference. * * * @generated * @ordered */ - int LICENSE_GRANT__MATCH_VERSION = LICENSE_GRANT_DESCRIPTOR_FEATURE_COUNT + 2; + int LICENSE_GRANT__FEATURE = LICENSE_GRANT_DESCRIPTOR_FEATURE_COUNT + 1; /** - * The feature id for the 'Match Rule' attribute. - * - * - * @generated - * @ordered - */ - int LICENSE_GRANT__MATCH_RULE = LICENSE_GRANT_DESCRIPTOR_FEATURE_COUNT + 3; - - /** - * The feature id for the 'Valid From' attribute. - * - * - * @generated - * @ordered - */ - int LICENSE_GRANT__VALID_FROM = LICENSE_GRANT_DESCRIPTOR_FEATURE_COUNT + 4; - - /** - * The feature id for the 'Valid Until' attribute. - * - * - * @generated - * @ordered - */ - int LICENSE_GRANT__VALID_UNTIL = LICENSE_GRANT_DESCRIPTOR_FEATURE_COUNT + 5; - - /** - * The feature id for the 'Condition Type' attribute. + * The feature id for the 'Valid' containment reference. * * * @generated * @ordered */ - int LICENSE_GRANT__CONDITION_TYPE = LICENSE_GRANT_DESCRIPTOR_FEATURE_COUNT + 6; + int LICENSE_GRANT__VALID = LICENSE_GRANT_DESCRIPTOR_FEATURE_COUNT + 2; /** - * The feature id for the 'Condition Expression' attribute. + * The feature id for the 'User Authentication' containment reference. * * * @generated * @ordered */ - int LICENSE_GRANT__CONDITION_EXPRESSION = LICENSE_GRANT_DESCRIPTOR_FEATURE_COUNT + 7; + int LICENSE_GRANT__USER_AUTHENTICATION = LICENSE_GRANT_DESCRIPTOR_FEATURE_COUNT + 3; /** * The feature id for the 'Capacity' attribute. @@ -851,7 +825,7 @@ public interface LicensesPackage extends EPackage { * @generated * @ordered */ - int LICENSE_GRANT__CAPACITY = LICENSE_GRANT_DESCRIPTOR_FEATURE_COUNT + 8; + int LICENSE_GRANT__CAPACITY = LICENSE_GRANT_DESCRIPTOR_FEATURE_COUNT + 4; /** * The feature id for the 'License Pack' container reference. @@ -860,7 +834,7 @@ public interface LicensesPackage extends EPackage { * @generated * @ordered */ - int LICENSE_GRANT__LICENSE_PACK = LICENSE_GRANT_DESCRIPTOR_FEATURE_COUNT + 9; + int LICENSE_GRANT__LICENSE_PACK = LICENSE_GRANT_DESCRIPTOR_FEATURE_COUNT + 5; /** * The number of structural features of the 'License Grant' class. @@ -869,7 +843,7 @@ public interface LicensesPackage extends EPackage { * @generated * @ordered */ - int LICENSE_GRANT_FEATURE_COUNT = LICENSE_GRANT_DESCRIPTOR_FEATURE_COUNT + 10; + int LICENSE_GRANT_FEATURE_COUNT = LICENSE_GRANT_DESCRIPTOR_FEATURE_COUNT + 6; /** * The number of operations of the 'License Grant' class. @@ -888,7 +862,7 @@ public interface LicensesPackage extends EPackage { * @see org.eclipse.passage.lic.licenses.model.impl.LicensesPackageImpl#getFloatingLicensePack() * @generated */ - int FLOATING_LICENSE_PACK = 22; + int FLOATING_LICENSE_PACK = 23; /** * The feature id for the 'License' containment reference. @@ -952,7 +926,7 @@ public interface LicensesPackage extends EPackage { * @see org.eclipse.passage.lic.licenses.model.impl.LicensesPackageImpl#getLicenseRequisites() * @generated */ - int LICENSE_REQUISITES = 23; + int LICENSE_REQUISITES = 24; /** * The feature id for the 'Identifier' attribute. @@ -1025,7 +999,7 @@ public interface LicensesPackage extends EPackage { * @see org.eclipse.passage.lic.licenses.model.impl.LicensesPackageImpl#getPersonalLicenseRequisites() * @generated */ - int PERSONAL_LICENSE_REQUISITES = 24; + int PERSONAL_LICENSE_REQUISITES = 25; /** * The feature id for the 'Identifier' attribute. @@ -1107,7 +1081,7 @@ public interface LicensesPackage extends EPackage { * @see org.eclipse.passage.lic.licenses.model.impl.LicensesPackageImpl#getFloatingLicenseRequisites() * @generated */ - int FLOATING_LICENSE_REQUISITES = 25; + int FLOATING_LICENSE_REQUISITES = 26; /** * The feature id for the 'Identifier' attribute. @@ -1189,7 +1163,63 @@ public interface LicensesPackage extends EPackage { * @see org.eclipse.passage.lic.licenses.model.impl.LicensesPackageImpl#getProductRef() * @generated */ - int PRODUCT_REF = 26; + int PRODUCT_REF = 28; + + /** + * The meta object id for the '{@link org.eclipse.passage.lic.licenses.model.impl.FeatureRefImpl Feature Ref}' class. + * + * + * @see org.eclipse.passage.lic.licenses.model.impl.FeatureRefImpl + * @see org.eclipse.passage.lic.licenses.model.impl.LicensesPackageImpl#getFeatureRef() + * @generated + */ + int FEATURE_REF = 29; + + /** + * The meta object id for the '{@link org.eclipse.passage.lic.licenses.model.impl.UserRefImpl User Ref}' class. + * + * + * @see org.eclipse.passage.lic.licenses.model.impl.UserRefImpl + * @see org.eclipse.passage.lic.licenses.model.impl.LicensesPackageImpl#getUserRef() + * @generated + */ + int USER_REF = 27; + + /** + * The feature id for the 'Identifier' attribute. + * + * + * @generated + * @ordered + */ + int USER_REF__IDENTIFIER = USER_REF_DESCRIPTOR_FEATURE_COUNT + 0; + + /** + * The feature id for the 'Name' attribute. + * + * + * @generated + * @ordered + */ + int USER_REF__NAME = USER_REF_DESCRIPTOR_FEATURE_COUNT + 1; + + /** + * The number of structural features of the 'User Ref' class. + * + * + * @generated + * @ordered + */ + int USER_REF_FEATURE_COUNT = USER_REF_DESCRIPTOR_FEATURE_COUNT + 2; + + /** + * The number of operations of the 'User Ref' class. + * + * + * @generated + * @ordered + */ + int USER_REF_OPERATION_COUNT = USER_REF_DESCRIPTOR_OPERATION_COUNT + 0; /** * The feature id for the 'Identifier' attribute. @@ -1228,50 +1258,49 @@ public interface LicensesPackage extends EPackage { int PRODUCT_REF_OPERATION_COUNT = PRODUCT_REF_DESCRIPTOR_OPERATION_COUNT + 0; /** - * The meta object id for the '{@link org.eclipse.passage.lic.licenses.model.impl.UserRefImpl User Ref}' class. + * The feature id for the 'Identifier' attribute. * * - * @see org.eclipse.passage.lic.licenses.model.impl.UserRefImpl - * @see org.eclipse.passage.lic.licenses.model.impl.LicensesPackageImpl#getUserRef() * @generated + * @ordered */ - int USER_REF = 27; + int FEATURE_REF__IDENTIFIER = FEATURE_REF_DESCRIPTOR_FEATURE_COUNT + 0; /** - * The feature id for the 'Identifier' attribute. + * The feature id for the 'Version' attribute. * * * @generated * @ordered */ - int USER_REF__IDENTIFIER = USER_REF_DESCRIPTOR_FEATURE_COUNT + 0; + int FEATURE_REF__VERSION = FEATURE_REF_DESCRIPTOR_FEATURE_COUNT + 1; /** - * The feature id for the 'Name' attribute. + * The feature id for the 'Matching Rule' attribute. * * * @generated * @ordered */ - int USER_REF__NAME = USER_REF_DESCRIPTOR_FEATURE_COUNT + 1; + int FEATURE_REF__MATCHING_RULE = FEATURE_REF_DESCRIPTOR_FEATURE_COUNT + 2; /** - * The number of structural features of the 'User Ref' class. + * The number of structural features of the 'Feature Ref' class. * * * @generated * @ordered */ - int USER_REF_FEATURE_COUNT = USER_REF_DESCRIPTOR_FEATURE_COUNT + 2; + int FEATURE_REF_FEATURE_COUNT = FEATURE_REF_DESCRIPTOR_FEATURE_COUNT + 3; /** - * The number of operations of the 'User Ref' class. + * The number of operations of the 'Feature Ref' class. * * * @generated * @ordered */ - int USER_REF_OPERATION_COUNT = USER_REF_DESCRIPTOR_OPERATION_COUNT + 0; + int FEATURE_REF_OPERATION_COUNT = FEATURE_REF_DESCRIPTOR_OPERATION_COUNT + 0; /** * The meta object id for the '{@link org.eclipse.passage.lic.licenses.model.impl.CompanyRefImpl Company Ref}' class. @@ -1281,7 +1310,7 @@ public interface LicensesPackage extends EPackage { * @see org.eclipse.passage.lic.licenses.model.impl.LicensesPackageImpl#getCompanyRef() * @generated */ - int COMPANY_REF = 28; + int COMPANY_REF = 30; /** * The feature id for the 'Identifier' attribute. @@ -1336,7 +1365,7 @@ public interface LicensesPackage extends EPackage { * @see org.eclipse.passage.lic.licenses.model.impl.LicensesPackageImpl#getFloatingServer() * @generated */ - int FLOATING_SERVER = 29; + int FLOATING_SERVER = 31; /** * The feature id for the 'Identifier' attribute. @@ -1382,7 +1411,7 @@ public interface LicensesPackage extends EPackage { * @see org.eclipse.passage.lic.licenses.model.impl.LicensesPackageImpl#getUserGrant() * @generated */ - int USER_GRANT = 30; + int USER_GRANT = 32; /** * The feature id for the 'User' attribute. @@ -1428,7 +1457,7 @@ public interface LicensesPackage extends EPackage { * @see org.eclipse.passage.lic.licenses.model.impl.LicensesPackageImpl#getFeatureGrant() * @generated */ - int FEATURE_GRANT = 31; + int FEATURE_GRANT = 33; /** * The feature id for the 'Identifier' attribute. @@ -1519,7 +1548,7 @@ public interface LicensesPackage extends EPackage { * @see org.eclipse.passage.lic.licenses.model.impl.LicensesPackageImpl#getValidityPeriod() * @generated */ - int VALIDITY_PERIOD = 32; + int VALIDITY_PERIOD = 34; /** * The number of structural features of the 'Validity Period' class. @@ -1547,7 +1576,7 @@ public interface LicensesPackage extends EPackage { * @see org.eclipse.passage.lic.licenses.model.impl.LicensesPackageImpl#getValidityPeriodClosed() * @generated */ - int VALIDITY_PERIOD_CLOSED = 33; + int VALIDITY_PERIOD_CLOSED = 35; /** * The feature id for the 'From' attribute. @@ -1593,7 +1622,7 @@ public interface LicensesPackage extends EPackage { * @see org.eclipse.passage.lic.licenses.model.impl.LicensesPackageImpl#getEvaluationInstructions() * @generated */ - int EVALUATION_INSTRUCTIONS = 34; + int EVALUATION_INSTRUCTIONS = 36; /** * The feature id for the 'Type' attribute. @@ -1639,7 +1668,7 @@ public interface LicensesPackage extends EPackage { * @see org.eclipse.passage.lic.licenses.model.impl.LicensesPackageImpl#getVersionMatch() * @generated */ - int VERSION_MATCH = 35; + int VERSION_MATCH = 37; /** * The feature id for the 'Version' attribute. @@ -1685,7 +1714,7 @@ public interface LicensesPackage extends EPackage { * @see org.eclipse.passage.lic.licenses.model.impl.LicensesPackageImpl#getFloatingLicenseAccess() * @generated */ - int FLOATING_LICENSE_ACCESS = 36; + int FLOATING_LICENSE_ACCESS = 38; /** * The feature id for the 'User' attribute. @@ -1740,7 +1769,7 @@ public interface LicensesPackage extends EPackage { * @see org.eclipse.passage.lic.licenses.model.impl.LicensesPackageImpl#getFloatingServerConnection() * @generated */ - int FLOATING_SERVER_CONNECTION = 37; + int FLOATING_SERVER_CONNECTION = 39; /** * The feature id for the 'Ip' attribute. @@ -1795,7 +1824,7 @@ public interface LicensesPackage extends EPackage { * @see org.eclipse.passage.lic.licenses.model.impl.LicensesPackageImpl#getGrantAcqisition() * @generated */ - int GRANT_ACQISITION = 38; + int GRANT_ACQISITION = 40; /** * The feature id for the 'Identifier' attribute. @@ -1883,15 +1912,15 @@ public interface LicensesPackage extends EPackage { EClass getLicensePlanFeatureDescriptor(); /** - * Returns the meta object for class '{@link org.eclipse.passage.lic.licenses.PersonalLicensePackDescriptor License Pack Descriptor}'. + * Returns the meta object for class '{@link org.eclipse.passage.lic.licenses.PersonalLicensePackDescriptor Personal License Pack Descriptor}'. * * - * @return the meta object for class 'License Pack Descriptor'. + * @return the meta object for class 'Personal License Pack Descriptor'. * @see org.eclipse.passage.lic.licenses.PersonalLicensePackDescriptor - * @model instanceClass="org.eclipse.passage.lic.licenses.LicensePackDescriptor" + * @model instanceClass="org.eclipse.passage.lic.licenses.PersonalLicensePackDescriptor" * @generated */ - EClass getLicensePackDescriptor(); + EClass getPersonalLicensePackDescriptor(); /** * Returns the meta object for class '{@link org.eclipse.passage.lic.licenses.LicenseGrantDescriptor License Grant Descriptor}'. @@ -1915,6 +1944,17 @@ public interface LicensesPackage extends EPackage { */ EClass getProductRefDescriptor(); + /** + * Returns the meta object for class '{@link org.eclipse.passage.lic.licenses.FeatureRefDescriptor Feature Ref Descriptor}'. + * + * + * @return the meta object for class 'Feature Ref Descriptor'. + * @see org.eclipse.passage.lic.licenses.FeatureRefDescriptor + * @model instanceClass="org.eclipse.passage.lic.licenses.FeatureRefDescriptor" + * @generated + */ + EClass getFeatureRefDescriptor(); + /** * Returns the meta object for class '{@link org.eclipse.passage.lic.licenses.UserRefDescriptor User Ref Descriptor}'. * @@ -2145,37 +2185,15 @@ public interface LicensesPackage extends EPackage { EClass getLicensePlanFeature(); /** - * Returns the meta object for the attribute '{@link org.eclipse.passage.lic.licenses.model.api.LicensePlanFeature#getFeatureIdentifier Feature Identifier}'. - * - * - * @return the meta object for the attribute 'Feature Identifier'. - * @see org.eclipse.passage.lic.licenses.model.api.LicensePlanFeature#getFeatureIdentifier() - * @see #getLicensePlanFeature() - * @generated - */ - EAttribute getLicensePlanFeature_FeatureIdentifier(); - - /** - * Returns the meta object for the attribute '{@link org.eclipse.passage.lic.licenses.model.api.LicensePlanFeature#getMatchVersion Match Version}'. + * Returns the meta object for the containment reference '{@link org.eclipse.passage.lic.licenses.model.api.LicensePlanFeature#getFeature Feature}'. * * - * @return the meta object for the attribute 'Match Version'. - * @see org.eclipse.passage.lic.licenses.model.api.LicensePlanFeature#getMatchVersion() + * @return the meta object for the containment reference 'Feature'. + * @see org.eclipse.passage.lic.licenses.model.api.LicensePlanFeature#getFeature() * @see #getLicensePlanFeature() * @generated */ - EAttribute getLicensePlanFeature_MatchVersion(); - - /** - * Returns the meta object for the attribute '{@link org.eclipse.passage.lic.licenses.model.api.LicensePlanFeature#getMatchRule Match Rule}'. - * - * - * @return the meta object for the attribute 'Match Rule'. - * @see org.eclipse.passage.lic.licenses.model.api.LicensePlanFeature#getMatchRule() - * @see #getLicensePlanFeature() - * @generated - */ - EAttribute getLicensePlanFeature_MatchRule(); + EReference getLicensePlanFeature_Feature(); /** * Returns the meta object for the reference '{@link org.eclipse.passage.lic.licenses.model.api.LicensePlanFeature#getLicensePlan License Plan}'. @@ -2242,81 +2260,37 @@ public interface LicensesPackage extends EPackage { EAttribute getLicenseGrant_Identifier(); /** - * Returns the meta object for the attribute '{@link org.eclipse.passage.lic.licenses.model.api.LicenseGrant#getFeatureIdentifier Feature Identifier}'. - * - * - * @return the meta object for the attribute 'Feature Identifier'. - * @see org.eclipse.passage.lic.licenses.model.api.LicenseGrant#getFeatureIdentifier() - * @see #getLicenseGrant() - * @generated - */ - EAttribute getLicenseGrant_FeatureIdentifier(); - - /** - * Returns the meta object for the attribute '{@link org.eclipse.passage.lic.licenses.model.api.LicenseGrant#getMatchVersion Match Version}'. - * - * - * @return the meta object for the attribute 'Match Version'. - * @see org.eclipse.passage.lic.licenses.model.api.LicenseGrant#getMatchVersion() - * @see #getLicenseGrant() - * @generated - */ - EAttribute getLicenseGrant_MatchVersion(); - - /** - * Returns the meta object for the attribute '{@link org.eclipse.passage.lic.licenses.model.api.LicenseGrant#getMatchRule Match Rule}'. - * - * - * @return the meta object for the attribute 'Match Rule'. - * @see org.eclipse.passage.lic.licenses.model.api.LicenseGrant#getMatchRule() - * @see #getLicenseGrant() - * @generated - */ - EAttribute getLicenseGrant_MatchRule(); - - /** - * Returns the meta object for the attribute '{@link org.eclipse.passage.lic.licenses.model.api.LicenseGrant#getValidFrom Valid From}'. - * - * - * @return the meta object for the attribute 'Valid From'. - * @see org.eclipse.passage.lic.licenses.model.api.LicenseGrant#getValidFrom() - * @see #getLicenseGrant() - * @generated - */ - EAttribute getLicenseGrant_ValidFrom(); - - /** - * Returns the meta object for the attribute '{@link org.eclipse.passage.lic.licenses.model.api.LicenseGrant#getValidUntil Valid Until}'. + * Returns the meta object for the containment reference '{@link org.eclipse.passage.lic.licenses.model.api.LicenseGrant#getFeature Feature}'. * * - * @return the meta object for the attribute 'Valid Until'. - * @see org.eclipse.passage.lic.licenses.model.api.LicenseGrant#getValidUntil() + * @return the meta object for the containment reference 'Feature'. + * @see org.eclipse.passage.lic.licenses.model.api.LicenseGrant#getFeature() * @see #getLicenseGrant() * @generated */ - EAttribute getLicenseGrant_ValidUntil(); + EReference getLicenseGrant_Feature(); /** - * Returns the meta object for the attribute '{@link org.eclipse.passage.lic.licenses.model.api.LicenseGrant#getConditionType Condition Type}'. + * Returns the meta object for the containment reference '{@link org.eclipse.passage.lic.licenses.model.api.LicenseGrant#getValid Valid}'. * * - * @return the meta object for the attribute 'Condition Type'. - * @see org.eclipse.passage.lic.licenses.model.api.LicenseGrant#getConditionType() + * @return the meta object for the containment reference 'Valid'. + * @see org.eclipse.passage.lic.licenses.model.api.LicenseGrant#getValid() * @see #getLicenseGrant() * @generated */ - EAttribute getLicenseGrant_ConditionType(); + EReference getLicenseGrant_Valid(); /** - * Returns the meta object for the attribute '{@link org.eclipse.passage.lic.licenses.model.api.LicenseGrant#getConditionExpression Condition Expression}'. + * Returns the meta object for the containment reference '{@link org.eclipse.passage.lic.licenses.model.api.LicenseGrant#getUserAuthentication User Authentication}'. * * - * @return the meta object for the attribute 'Condition Expression'. - * @see org.eclipse.passage.lic.licenses.model.api.LicenseGrant#getConditionExpression() + * @return the meta object for the containment reference 'User Authentication'. + * @see org.eclipse.passage.lic.licenses.model.api.LicenseGrant#getUserAuthentication() * @see #getLicenseGrant() * @generated */ - EAttribute getLicenseGrant_ConditionExpression(); + EReference getLicenseGrant_UserAuthentication(); /** * Returns the meta object for the attribute '{@link org.eclipse.passage.lic.licenses.model.api.LicenseGrant#getCapacity Capacity}'. @@ -2533,6 +2507,49 @@ public interface LicensesPackage extends EPackage { */ EAttribute getProductRef_Version(); + /** + * Returns the meta object for class '{@link org.eclipse.passage.lic.licenses.model.api.FeatureRef Feature Ref}'. + * + * + * @return the meta object for class 'Feature Ref'. + * @see org.eclipse.passage.lic.licenses.model.api.FeatureRef + * @generated + */ + EClass getFeatureRef(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.passage.lic.licenses.model.api.FeatureRef#getIdentifier Identifier}'. + * + * + * @return the meta object for the attribute 'Identifier'. + * @see org.eclipse.passage.lic.licenses.model.api.FeatureRef#getIdentifier() + * @see #getFeatureRef() + * @generated + */ + EAttribute getFeatureRef_Identifier(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.passage.lic.licenses.model.api.FeatureRef#getVersion Version}'. + * + * + * @return the meta object for the attribute 'Version'. + * @see org.eclipse.passage.lic.licenses.model.api.FeatureRef#getVersion() + * @see #getFeatureRef() + * @generated + */ + EAttribute getFeatureRef_Version(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.passage.lic.licenses.model.api.FeatureRef#getMatchingRule Matching Rule}'. + * + * + * @return the meta object for the attribute 'Matching Rule'. + * @see org.eclipse.passage.lic.licenses.model.api.FeatureRef#getMatchingRule() + * @see #getFeatureRef() + * @generated + */ + EAttribute getFeatureRef_MatchingRule(); + /** * Returns the meta object for class '{@link org.eclipse.passage.lic.licenses.model.api.UserRef User Ref}'. * diff --git a/bundles/org.eclipse.passage.lic.licenses.model/src-gen/org/eclipse/passage/lic/licenses/model/util/LicensesAdapterFactory.java b/bundles/org.eclipse.passage.lic.licenses.model/src-gen/org/eclipse/passage/lic/licenses/model/util/LicensesAdapterFactory.java index cebebb25f..a79420b69 100644 --- a/bundles/org.eclipse.passage.lic.licenses.model/src-gen/org/eclipse/passage/lic/licenses/model/util/LicensesAdapterFactory.java +++ b/bundles/org.eclipse.passage.lic.licenses.model/src-gen/org/eclipse/passage/lic/licenses/model/util/LicensesAdapterFactory.java @@ -22,14 +22,15 @@ import org.eclipse.passage.lic.licenses.CompanyRefDescriptor; import org.eclipse.passage.lic.licenses.EvaluationInstructionsDescriptor; import org.eclipse.passage.lic.licenses.FeatureGrantDescriptor; +import org.eclipse.passage.lic.licenses.FeatureRefDescriptor; import org.eclipse.passage.lic.licenses.FloatingLicensePackDescriptor; import org.eclipse.passage.lic.licenses.FloatingLicenseRequisitesDescriptor; import org.eclipse.passage.lic.licenses.FloatingServerDescriptor; import org.eclipse.passage.lic.licenses.LicenseGrantDescriptor; -import org.eclipse.passage.lic.licenses.PersonalLicensePackDescriptor; import org.eclipse.passage.lic.licenses.LicensePlanDescriptor; import org.eclipse.passage.lic.licenses.LicensePlanFeatureDescriptor; import org.eclipse.passage.lic.licenses.LicenseRequisitesDescriptor; +import org.eclipse.passage.lic.licenses.PersonalLicensePackDescriptor; import org.eclipse.passage.lic.licenses.PersonalLicenseRequisitesDescriptor; import org.eclipse.passage.lic.licenses.ProductRefDescriptor; import org.eclipse.passage.lic.licenses.UserGrantDescriptor; @@ -108,8 +109,8 @@ public Adapter caseLicensePlanFeatureDescriptor(LicensePlanFeatureDescriptor obj } @Override - public Adapter caseLicensePackDescriptor(PersonalLicensePackDescriptor object) { - return createLicensePackDescriptorAdapter(); + public Adapter casePersonalLicensePackDescriptor(PersonalLicensePackDescriptor object) { + return createPersonalLicensePackDescriptorAdapter(); } @Override @@ -117,14 +118,19 @@ public Adapter caseLicenseGrantDescriptor(LicenseGrantDescriptor object) { return createLicenseGrantDescriptorAdapter(); } + @Override + public Adapter caseUserRefDescriptor(UserRefDescriptor object) { + return createUserRefDescriptorAdapter(); + } + @Override public Adapter caseProductRefDescriptor(ProductRefDescriptor object) { return createProductRefDescriptorAdapter(); } @Override - public Adapter caseUserRefDescriptor(UserRefDescriptor object) { - return createUserRefDescriptorAdapter(); + public Adapter caseFeatureRefDescriptor(FeatureRefDescriptor object) { + return createFeatureRefDescriptorAdapter(); } @Override @@ -227,14 +233,19 @@ public Adapter caseFloatingLicenseRequisites(FloatingLicenseRequisites object) { return createFloatingLicenseRequisitesAdapter(); } + @Override + public Adapter caseUserRef(UserRef object) { + return createUserRefAdapter(); + } + @Override public Adapter caseProductRef(ProductRef object) { return createProductRefAdapter(); } @Override - public Adapter caseUserRef(UserRef object) { - return createUserRefAdapter(); + public Adapter caseFeatureRef(FeatureRef object) { + return createFeatureRefAdapter(); } @Override @@ -340,7 +351,7 @@ public Adapter createLicensePlanFeatureDescriptorAdapter() { } /** - * Creates a new adapter for an object of class '{@link org.eclipse.passage.lic.licenses.PersonalLicensePackDescriptor License Pack Descriptor}'. + * Creates a new adapter for an object of class '{@link org.eclipse.passage.lic.licenses.PersonalLicensePackDescriptor Personal License Pack Descriptor}'. * * This default implementation returns null so that we can easily ignore cases; * it's useful to ignore a case when inheritance will catch all the cases anyway. @@ -349,7 +360,7 @@ public Adapter createLicensePlanFeatureDescriptorAdapter() { * @see org.eclipse.passage.lic.licenses.PersonalLicensePackDescriptor * @generated */ - public Adapter createLicensePackDescriptorAdapter() { + public Adapter createPersonalLicensePackDescriptorAdapter() { return null; } @@ -381,6 +392,20 @@ public Adapter createProductRefDescriptorAdapter() { return null; } + /** + * Creates a new adapter for an object of class '{@link org.eclipse.passage.lic.licenses.FeatureRefDescriptor Feature Ref Descriptor}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.passage.lic.licenses.FeatureRefDescriptor + * @generated + */ + public Adapter createFeatureRefDescriptorAdapter() { + return null; + } + /** * Creates a new adapter for an object of class '{@link org.eclipse.passage.lic.licenses.UserRefDescriptor User Ref Descriptor}'. * @@ -689,6 +714,20 @@ public Adapter createProductRefAdapter() { return null; } + /** + * Creates a new adapter for an object of class '{@link org.eclipse.passage.lic.licenses.model.api.FeatureRef Feature Ref}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.passage.lic.licenses.model.api.FeatureRef + * @generated + */ + public Adapter createFeatureRefAdapter() { + return null; + } + /** * Creates a new adapter for an object of class '{@link org.eclipse.passage.lic.licenses.model.api.UserRef User Ref}'. * diff --git a/bundles/org.eclipse.passage.lic.licenses.model/src-gen/org/eclipse/passage/lic/licenses/model/util/LicensesSwitch.java b/bundles/org.eclipse.passage.lic.licenses.model/src-gen/org/eclipse/passage/lic/licenses/model/util/LicensesSwitch.java index fb2ac01c7..46717d60e 100644 --- a/bundles/org.eclipse.passage.lic.licenses.model/src-gen/org/eclipse/passage/lic/licenses/model/util/LicensesSwitch.java +++ b/bundles/org.eclipse.passage.lic.licenses.model/src-gen/org/eclipse/passage/lic/licenses/model/util/LicensesSwitch.java @@ -20,14 +20,15 @@ import org.eclipse.passage.lic.licenses.CompanyRefDescriptor; import org.eclipse.passage.lic.licenses.EvaluationInstructionsDescriptor; import org.eclipse.passage.lic.licenses.FeatureGrantDescriptor; +import org.eclipse.passage.lic.licenses.FeatureRefDescriptor; import org.eclipse.passage.lic.licenses.FloatingLicensePackDescriptor; import org.eclipse.passage.lic.licenses.FloatingLicenseRequisitesDescriptor; import org.eclipse.passage.lic.licenses.FloatingServerDescriptor; import org.eclipse.passage.lic.licenses.LicenseGrantDescriptor; -import org.eclipse.passage.lic.licenses.PersonalLicensePackDescriptor; import org.eclipse.passage.lic.licenses.LicensePlanDescriptor; import org.eclipse.passage.lic.licenses.LicensePlanFeatureDescriptor; import org.eclipse.passage.lic.licenses.LicenseRequisitesDescriptor; +import org.eclipse.passage.lic.licenses.PersonalLicensePackDescriptor; import org.eclipse.passage.lic.licenses.PersonalLicenseRequisitesDescriptor; import org.eclipse.passage.lic.licenses.ProductRefDescriptor; import org.eclipse.passage.lic.licenses.UserGrantDescriptor; @@ -111,9 +112,9 @@ protected T doSwitch(int classifierID, EObject theEObject) { result = defaultCase(theEObject); return result; } - case LicensesPackage.LICENSE_PACK_DESCRIPTOR: { - PersonalLicensePackDescriptor licensePackDescriptor = (PersonalLicensePackDescriptor) theEObject; - T result = caseLicensePackDescriptor(licensePackDescriptor); + case LicensesPackage.PERSONAL_LICENSE_PACK_DESCRIPTOR: { + PersonalLicensePackDescriptor personalLicensePackDescriptor = (PersonalLicensePackDescriptor) theEObject; + T result = casePersonalLicensePackDescriptor(personalLicensePackDescriptor); if (result == null) result = defaultCase(theEObject); return result; @@ -125,6 +126,13 @@ protected T doSwitch(int classifierID, EObject theEObject) { result = defaultCase(theEObject); return result; } + case LicensesPackage.USER_REF_DESCRIPTOR: { + UserRefDescriptor userRefDescriptor = (UserRefDescriptor) theEObject; + T result = caseUserRefDescriptor(userRefDescriptor); + if (result == null) + result = defaultCase(theEObject); + return result; + } case LicensesPackage.PRODUCT_REF_DESCRIPTOR: { ProductRefDescriptor productRefDescriptor = (ProductRefDescriptor) theEObject; T result = caseProductRefDescriptor(productRefDescriptor); @@ -132,9 +140,9 @@ protected T doSwitch(int classifierID, EObject theEObject) { result = defaultCase(theEObject); return result; } - case LicensesPackage.USER_REF_DESCRIPTOR: { - UserRefDescriptor userRefDescriptor = (UserRefDescriptor) theEObject; - T result = caseUserRefDescriptor(userRefDescriptor); + case LicensesPackage.FEATURE_REF_DESCRIPTOR: { + FeatureRefDescriptor featureRefDescriptor = (FeatureRefDescriptor) theEObject; + T result = caseFeatureRefDescriptor(featureRefDescriptor); if (result == null) result = defaultCase(theEObject); return result; @@ -249,7 +257,7 @@ protected T doSwitch(int classifierID, EObject theEObject) { PersonalLicensePack personalLicensePack = (PersonalLicensePack) theEObject; T result = casePersonalLicensePack(personalLicensePack); if (result == null) - result = caseLicensePackDescriptor(personalLicensePack); + result = casePersonalLicensePackDescriptor(personalLicensePack); if (result == null) result = defaultCase(theEObject); return result; @@ -307,6 +315,15 @@ protected T doSwitch(int classifierID, EObject theEObject) { result = defaultCase(theEObject); return result; } + case LicensesPackage.USER_REF: { + UserRef userRef = (UserRef) theEObject; + T result = caseUserRef(userRef); + if (result == null) + result = caseUserRefDescriptor(userRef); + if (result == null) + result = defaultCase(theEObject); + return result; + } case LicensesPackage.PRODUCT_REF: { ProductRef productRef = (ProductRef) theEObject; T result = caseProductRef(productRef); @@ -316,11 +333,11 @@ protected T doSwitch(int classifierID, EObject theEObject) { result = defaultCase(theEObject); return result; } - case LicensesPackage.USER_REF: { - UserRef userRef = (UserRef) theEObject; - T result = caseUserRef(userRef); + case LicensesPackage.FEATURE_REF: { + FeatureRef featureRef = (FeatureRef) theEObject; + T result = caseFeatureRef(featureRef); if (result == null) - result = caseUserRefDescriptor(userRef); + result = caseFeatureRefDescriptor(featureRef); if (result == null) result = defaultCase(theEObject); return result; @@ -458,17 +475,17 @@ public T caseLicensePlanFeatureDescriptor(LicensePlanFeatureDescriptor object) { } /** - * Returns the result of interpreting the object as an instance of 'License Pack Descriptor'. + * Returns the result of interpreting the object as an instance of 'Personal License Pack Descriptor'. * * This implementation returns null; * returning a non-null result will terminate the switch. * * @param object the target of the switch. - * @return the result of interpreting the object as an instance of 'License Pack Descriptor'. + * @return the result of interpreting the object as an instance of 'Personal License Pack Descriptor'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */ - public T caseLicensePackDescriptor(PersonalLicensePackDescriptor object) { + public T casePersonalLicensePackDescriptor(PersonalLicensePackDescriptor object) { return null; } @@ -502,6 +519,21 @@ public T caseProductRefDescriptor(ProductRefDescriptor object) { return null; } + /** + * Returns the result of interpreting the object as an instance of 'Feature Ref Descriptor'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Feature Ref Descriptor'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseFeatureRefDescriptor(FeatureRefDescriptor object) { + return null; + } + /** * Returns the result of interpreting the object as an instance of 'User Ref Descriptor'. * @@ -832,6 +864,21 @@ public T caseProductRef(ProductRef object) { return null; } + /** + * Returns the result of interpreting the object as an instance of 'Feature Ref'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Feature Ref'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseFeatureRef(FeatureRef object) { + return null; + } + /** * Returns the result of interpreting the object as an instance of 'User Ref'. * diff --git a/bundles/org.eclipse.passage.lic.licenses.model/src/org/eclipse/passage/lic/internal/licenses/model/migration/EnsureLicenseGrantEvaluationInstructions.java b/bundles/org.eclipse.passage.lic.licenses.model/src/org/eclipse/passage/lic/internal/licenses/model/migration/EnsureLicenseGrantEvaluationInstructions.java new file mode 100644 index 000000000..68896362e --- /dev/null +++ b/bundles/org.eclipse.passage.lic.licenses.model/src/org/eclipse/passage/lic/internal/licenses/model/migration/EnsureLicenseGrantEvaluationInstructions.java @@ -0,0 +1,35 @@ +/******************************************************************************* + * Copyright (c) 2021 ArSysOp + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * https://www.eclipse.org/legal/epl-2.0/. + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * ArSysOp - initial API and implementation + *******************************************************************************/ +package org.eclipse.passage.lic.internal.licenses.model.migration; + +import java.util.Optional; +import java.util.function.Function; + +import org.eclipse.passage.lic.licenses.model.api.EvaluationInstructions; +import org.eclipse.passage.lic.licenses.model.api.LicenseGrant; +import org.eclipse.passage.lic.licenses.model.meta.LicensesFactory; + +public final class EnsureLicenseGrantEvaluationInstructions implements Function { + + @Override + public EvaluationInstructions apply(LicenseGrant grant) { + return Optional.ofNullable(grant.getUserAuthentication()).orElseGet(() -> reset(grant)); + } + + private EvaluationInstructions reset(LicenseGrant grant) { + EvaluationInstructions instructions = LicensesFactory.eINSTANCE.createEvaluationInstructions(); + grant.setUserAuthentication(instructions); + return instructions; + } + +} diff --git a/bundles/org.eclipse.passage.lic.licenses.model/src/org/eclipse/passage/lic/internal/licenses/model/migration/EnsureLicenseGrantFeature.java b/bundles/org.eclipse.passage.lic.licenses.model/src/org/eclipse/passage/lic/internal/licenses/model/migration/EnsureLicenseGrantFeature.java new file mode 100644 index 000000000..4e3b70abd --- /dev/null +++ b/bundles/org.eclipse.passage.lic.licenses.model/src/org/eclipse/passage/lic/internal/licenses/model/migration/EnsureLicenseGrantFeature.java @@ -0,0 +1,35 @@ +/******************************************************************************* + * Copyright (c) 2021 ArSysOp + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * https://www.eclipse.org/legal/epl-2.0/. + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * ArSysOp - initial API and implementation + *******************************************************************************/ +package org.eclipse.passage.lic.internal.licenses.model.migration; + +import java.util.Optional; +import java.util.function.Function; + +import org.eclipse.passage.lic.licenses.model.api.FeatureRef; +import org.eclipse.passage.lic.licenses.model.api.LicenseGrant; +import org.eclipse.passage.lic.licenses.model.meta.LicensesFactory; + +public final class EnsureLicenseGrantFeature implements Function { + + @Override + public FeatureRef apply(LicenseGrant grant) { + return Optional.ofNullable(grant.getFeature()).orElseGet(() -> reset(grant)); + } + + private FeatureRef reset(LicenseGrant grant) { + FeatureRef feature = LicensesFactory.eINSTANCE.createFeatureRef(); + grant.setFeature(feature); + return feature; + } + +} diff --git a/bundles/org.eclipse.passage.lic.licenses.model/src/org/eclipse/passage/lic/internal/licenses/model/migration/EnsureLicenseGrantValidityPeriod.java b/bundles/org.eclipse.passage.lic.licenses.model/src/org/eclipse/passage/lic/internal/licenses/model/migration/EnsureLicenseGrantValidityPeriod.java new file mode 100644 index 000000000..e349c6fc7 --- /dev/null +++ b/bundles/org.eclipse.passage.lic.licenses.model/src/org/eclipse/passage/lic/internal/licenses/model/migration/EnsureLicenseGrantValidityPeriod.java @@ -0,0 +1,36 @@ +/******************************************************************************* + * Copyright (c) 2021 ArSysOp + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * https://www.eclipse.org/legal/epl-2.0/. + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * ArSysOp - initial API and implementation + *******************************************************************************/ +package org.eclipse.passage.lic.internal.licenses.model.migration; + +import java.util.Optional; +import java.util.function.Function; + +import org.eclipse.passage.lic.licenses.model.api.LicenseGrant; +import org.eclipse.passage.lic.licenses.model.api.ValidityPeriod; +import org.eclipse.passage.lic.licenses.model.api.ValidityPeriodClosed; +import org.eclipse.passage.lic.licenses.model.meta.LicensesFactory; + +public final class EnsureLicenseGrantValidityPeriod implements Function { + + @Override + public ValidityPeriod apply(LicenseGrant grant) { + return Optional.ofNullable(grant.getValid()).orElseGet(() -> reset(grant)); + } + + private ValidityPeriod reset(LicenseGrant grant) { + ValidityPeriodClosed validity = LicensesFactory.eINSTANCE.createValidityPeriodClosed(); + grant.setValid(validity); + return validity; + } + +} diff --git a/bundles/org.eclipse.passage.lic.licenses.model/src/org/eclipse/passage/lic/internal/licenses/model/migration/LicensesContainers.java b/bundles/org.eclipse.passage.lic.licenses.model/src/org/eclipse/passage/lic/internal/licenses/model/migration/LicensesContainers.java new file mode 100644 index 000000000..b424c06a8 --- /dev/null +++ b/bundles/org.eclipse.passage.lic.licenses.model/src/org/eclipse/passage/lic/internal/licenses/model/migration/LicensesContainers.java @@ -0,0 +1,55 @@ +/******************************************************************************* + * Copyright (c) 2021 ArSysOp + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * https://www.eclipse.org/legal/epl-2.0/. + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * ArSysOp - initial API and implementation + *******************************************************************************/ +package org.eclipse.passage.lic.internal.licenses.model.migration; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + +import org.eclipse.emf.ecore.EObject; +import org.eclipse.passage.lic.emf.migration.EnsureStructure; +import org.eclipse.passage.lic.licenses.model.api.LicenseGrant; +import org.eclipse.passage.lic.licenses.model.api.PersonalLicensePack; +import org.eclipse.passage.lic.licenses.model.util.LicensesSwitch; + +public class LicensesContainers extends LicensesSwitch> implements EnsureStructure { + + @Override + public List apply(EObject object) { + return doSwitch(object); + } + + @Override + public List caseLicenseGrant(LicenseGrant object) { + List result = new ArrayList<>(); + result.add(new EnsureLicenseGrantEvaluationInstructions().apply(object)); + result.add(new EnsureLicenseGrantFeature().apply(object)); + result.add(new EnsureLicenseGrantValidityPeriod().apply(object)); + return result; + } + + @Override + public List casePersonalLicensePack(PersonalLicensePack object) { + List result = new ArrayList<>(); + result.add(new EnsurePersonalPackLicense().apply(object)); + result.add(new EnsurePersonalPackProduct().apply(object)); + result.add(new EnsurePersonalPackUser().apply(object)); + return result; + } + + @Override + public List defaultCase(EObject object) { + return Collections.emptyList(); + } + +} diff --git a/bundles/org.eclipse.passage.lic.licenses.model/src/org/eclipse/passage/lic/internal/licenses/model/migration/LicensesResourceHandler.java b/bundles/org.eclipse.passage.lic.licenses.model/src/org/eclipse/passage/lic/internal/licenses/model/migration/LicensesResourceHandler.java index 16c4e6daf..0270ea2b2 100644 --- a/bundles/org.eclipse.passage.lic.licenses.model/src/org/eclipse/passage/lic/internal/licenses/model/migration/LicensesResourceHandler.java +++ b/bundles/org.eclipse.passage.lic.licenses.model/src/org/eclipse/passage/lic/internal/licenses/model/migration/LicensesResourceHandler.java @@ -14,23 +14,28 @@ import java.io.InputStream; import java.util.Map; -import java.util.Map.Entry; -import org.eclipse.emf.ecore.EObject; import org.eclipse.emf.ecore.xmi.XMLResource; -import org.eclipse.emf.ecore.xml.type.AnyType; import org.eclipse.passage.lic.emf.migration.DelegateClassifiers; import org.eclipse.passage.lic.emf.migration.EClassRoutes; +import org.eclipse.passage.lic.emf.migration.EnsureStructure; import org.eclipse.passage.lic.emf.migration.SimpleClassRoutes; import org.eclipse.passage.lic.emf.migration.SimpleFeatureRoutes; import org.eclipse.passage.lic.emf.xmi.MigratingResourceHandler; -import org.eclipse.passage.lic.internal.emf.migration.RecognizeFeatures; import org.eclipse.passage.lic.internal.licenses.model.AssignGrantIdentifiers; import org.eclipse.passage.lic.licenses.model.api.PersonalLicensePack; import org.eclipse.passage.lic.licenses.model.meta.LicensesPackage; public class LicensesResourceHandler extends MigratingResourceHandler { + @Override + public void postLoad(XMLResource resource, InputStream inputStream, Map options) { + super.postLoad(resource, inputStream, options); + resource.getContents().stream()// + .filter(PersonalLicensePack.class::isInstance)// + .map(PersonalLicensePack.class::cast).forEach(new AssignGrantIdentifiers()); + } + @Override protected void ensureMigrations() { migrate033(); @@ -41,53 +46,31 @@ protected void ensureMigrations() { } @Override - public void postLoad(XMLResource resource, InputStream inputStream, Map options) { - super.postLoad(resource, inputStream, options); - resource.getContents().stream()// - .filter(PersonalLicensePack.class::isInstance)// - .map(PersonalLicensePack.class::cast).forEach(new AssignGrantIdentifiers()); + protected SimpleFeatureRoutes attributes() { + SimpleFeatureRoutes routes = new SimpleFeatureRoutes(); + LicensesPackage licenses = LicensesPackage.eINSTANCE; + routes.define("conditionExpression", licenses.getEvaluationInstructions_Expression()); //$NON-NLS-1$ + routes.define("conditionType", licenses.getEvaluationInstructions_Type()); //$NON-NLS-1$ + routes.define("featureIdentifier", licenses.getFeatureRef_Identifier()); //$NON-NLS-1$ + routes.define("identifier", licenses.getLicenseGrant_Identifier()); //$NON-NLS-1$ + routes.define("identifier", licenses.getLicenseRequisites_Identifier()); //$NON-NLS-1$ + routes.define("issueDate", licenses.getLicenseRequisites_IssueDate()); //$NON-NLS-1$ + routes.define("licenseGrants", licenses.getPersonalLicensePack_Grants()); //$NON-NLS-1$ + routes.define("matchRule", licenses.getFeatureRef_MatchingRule()); //$NON-NLS-1$ + routes.define("matchVersion", licenses.getFeatureRef_Version()); //$NON-NLS-1$ + routes.define("planIdentifier", licenses.getLicenseRequisites_Plan()); //$NON-NLS-1$ + routes.define("productIdentifier", licenses.getProductRef_Identifier()); //$NON-NLS-1$ + routes.define("productVersion", licenses.getProductRef_Version()); //$NON-NLS-1$ + routes.define("userIdentifier", licenses.getUserRef_Identifier()); //$NON-NLS-1$ + routes.define("userFullName", licenses.getUserRef_Name()); //$NON-NLS-1$ + routes.define("validFrom", licenses.getValidityPeriodClosed_From()); //$NON-NLS-1$ + routes.define("validUntil", licenses.getValidityPeriodClosed_Until()); //$NON-NLS-1$ + return routes; } @Override - protected void convertEntry(Entry entry) { - EObject key = entry.getKey(); - if (key instanceof PersonalLicensePack) { - PersonalLicensePack pack = (PersonalLicensePack) key; - SimpleFeatureRoutes attributes = new SimpleFeatureRoutes(); - attributes.define("identifier", //$NON-NLS-1$ - LicensesPackage.eINSTANCE.getLicenseRequisites_Identifier()); - attributes.define("issueDate", //$NON-NLS-1$ - LicensesPackage.eINSTANCE.getLicenseRequisites_IssueDate()); - attributes.define("licenseGrants", //$NON-NLS-1$ - LicensesPackage.eINSTANCE.getPersonalLicensePack_Grants()); - attributes.define("planIdentifier", //$NON-NLS-1$ - LicensesPackage.eINSTANCE.getLicenseRequisites_Plan()); - attributes.define("productIdentifier", //$NON-NLS-1$ - LicensesPackage.eINSTANCE.getProductRef_Identifier()); - attributes.define("productVersion", LicensesPackage.eINSTANCE.getProductRef_Version()); //$NON-NLS-1$ - attributes.define("userIdentifier", LicensesPackage.eINSTANCE.getUserRef_Identifier()); //$NON-NLS-1$ - attributes.define("userFullName", LicensesPackage.eINSTANCE.getUserRef_Name()); //$NON-NLS-1$ - attributes.define("conditionExpression", //$NON-NLS-1$ - LicensesPackage.eINSTANCE.getLicenseGrant_ConditionExpression()); - attributes.define("conditionType", LicensesPackage.eINSTANCE.getLicenseGrant_ConditionType()); //$NON-NLS-1$ - attributes.define("featureIdentifier", //$NON-NLS-1$ - LicensesPackage.eINSTANCE.getLicenseGrant_FeatureIdentifier()); - attributes.define("identifier", //$NON-NLS-1$ - LicensesPackage.eINSTANCE.getLicenseGrant_Identifier()); - attributes.define("matchRule", LicensesPackage.eINSTANCE.getLicenseGrant_MatchRule()); //$NON-NLS-1$ - attributes.define("matchVersion", LicensesPackage.eINSTANCE.getLicenseGrant_MatchVersion()); //$NON-NLS-1$ - attributes.define("validFrom", LicensesPackage.eINSTANCE.getLicenseGrant_ValidFrom()); //$NON-NLS-1$ - attributes.define("validUntil", LicensesPackage.eINSTANCE.getLicenseGrant_ValidUntil()); //$NON-NLS-1$ - RecognizeFeatures unknown = new RecognizeFeatures(entry.getValue(), attributes); - unknown// - .mixed(pack)// - .attributes(new EnsurePersonalPackLicense().apply(pack))// - .attributes(new EnsurePersonalPackUser().apply(pack))// - .attributes(new EnsurePersonalPackProduct().apply(pack))// - ; - } else { - System.out.println(entry); - } + protected EnsureStructure structures() { + return new LicensesContainers(); } private void migrate033() { @@ -117,10 +100,10 @@ private void migrate110() { private EClassRoutes classRoutes200() { LicensesPackage delegate = LicensesPackage.eINSTANCE; - EClassRoutes smart = new SimpleClassRoutes(); - smart.define("LicensePack", delegate.getPersonalLicensePack()); //$NON-NLS-1$ - smart.define("LicenseGrant", delegate.getLicenseGrant()); //$NON-NLS-1$ - return smart; + EClassRoutes routes = new SimpleClassRoutes(); + routes.define("LicensePack", delegate.getPersonalLicensePack()); //$NON-NLS-1$ + routes.define("LicenseGrant", delegate.getLicenseGrant()); //$NON-NLS-1$ + return routes; } } diff --git a/bundles/org.eclipse.passage.lic.licenses.model/src/org/eclipse/passage/lic/internal/licenses/model/toberemoved/BaseXmiConditionTransport.java b/bundles/org.eclipse.passage.lic.licenses.model/src/org/eclipse/passage/lic/internal/licenses/model/toberemoved/BaseXmiConditionTransport.java index d6ba37c36..e275571d8 100644 --- a/bundles/org.eclipse.passage.lic.licenses.model/src/org/eclipse/passage/lic/internal/licenses/model/toberemoved/BaseXmiConditionTransport.java +++ b/bundles/org.eclipse.passage.lic.licenses.model/src/org/eclipse/passage/lic/internal/licenses/model/toberemoved/BaseXmiConditionTransport.java @@ -38,6 +38,7 @@ import org.eclipse.passage.lic.internal.base.conditions.MatchingRuleDefault; import org.eclipse.passage.lic.internal.base.conditions.MatchingRuleForIdentifier; import org.eclipse.passage.lic.internal.licenses.model.migration.LicensesResourceHandler; +import org.eclipse.passage.lic.licenses.ValidityPeriodClosedDescriptor; import org.eclipse.passage.lic.licenses.model.api.LicenseGrant; import org.eclipse.passage.lic.licenses.model.api.PersonalLicensePack; import org.eclipse.passage.lic.licenses.model.meta.LicensesPackage; @@ -87,15 +88,15 @@ private Map loadOptions() { private Condition condition(LicenseGrant descriptor) { return new BaseCondition(descriptor.getIdentifier(), // - descriptor.getFeatureIdentifier(), // - new BaseVersionMatch(descriptor.getMatchVersion(), // - rule(descriptor.getMatchRule())), // + descriptor.getFeature().getIdentifier(), // + new BaseVersionMatch(descriptor.getFeature().getVersion(), // + rule(descriptor.getFeature().getMatchingRule())), // new BaseValidityPeriodClosed(// - fromDate(descriptor.getValidFrom()), // - fromDate(descriptor.getValidUntil())), // + fromDate(((ValidityPeriodClosedDescriptor) descriptor.getValid()).getFrom()), // + fromDate(((ValidityPeriodClosedDescriptor) descriptor.getValid()).getUntil())), // new BaseEvaluationInstructions(// - new EvaluationType.Of(descriptor.getConditionType()), // - descriptor.getConditionExpression())); + new EvaluationType.Of(descriptor.getUserAuthentication().getType()), // + descriptor.getUserAuthentication().getExpression())); } /** diff --git a/bundles/org.eclipse.passage.lic.licenses/src/org/eclipse/passage/lic/licenses/FeatureRefDescriptor.java b/bundles/org.eclipse.passage.lic.licenses/src/org/eclipse/passage/lic/licenses/FeatureRefDescriptor.java new file mode 100644 index 000000000..83bfa9058 --- /dev/null +++ b/bundles/org.eclipse.passage.lic.licenses/src/org/eclipse/passage/lic/licenses/FeatureRefDescriptor.java @@ -0,0 +1,26 @@ +/******************************************************************************* + * Copyright (c) 2021 ArSysOp + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * https://www.eclipse.org/legal/epl-2.0/. + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * ArSysOp - initial API and implementation + *******************************************************************************/ +package org.eclipse.passage.lic.licenses; + +/** + * @since 2.0 + */ +public interface FeatureRefDescriptor { + + String getIdentifier(); + + String getVersion(); + + String getMatchingRule(); + +} diff --git a/bundles/org.eclipse.passage.lic.licenses/src/org/eclipse/passage/lic/licenses/LicenseGrantDescriptor.java b/bundles/org.eclipse.passage.lic.licenses/src/org/eclipse/passage/lic/licenses/LicenseGrantDescriptor.java index 14fdba6ef..4a10198c7 100644 --- a/bundles/org.eclipse.passage.lic.licenses/src/org/eclipse/passage/lic/licenses/LicenseGrantDescriptor.java +++ b/bundles/org.eclipse.passage.lic.licenses/src/org/eclipse/passage/lic/licenses/LicenseGrantDescriptor.java @@ -12,8 +12,6 @@ *******************************************************************************/ package org.eclipse.passage.lic.licenses; -import java.util.Date; - /** *

* A "License Grant" is a unit inside a "License Pack" @@ -36,66 +34,19 @@ public interface LicenseGrantDescriptor { String getIdentifier(); /** - * Returns unique identifier of a feature under licensing. - * - * @return feature identifier - * @since 0.5.0 - */ - String getFeatureIdentifier(); - - /** - * Returns descriptor of the feature version allowed by this licensing - * condition. - * - * @return version descriptor - * @since 0.5.0 - */ - String getMatchVersion(); - - /** - * Returns rule of version matching, like "perfect match" or "equal or greater". - * - * @return match rule - * @since 0.5.0 - */ - String getMatchRule(); - - /** - * Returns the validity period start date of this licensing condition. This is - * the value of its "validFrom" attribute. - * - * @return the valid from - * @since 0.5.0 - */ - Date getValidFrom(); - - /** - * Returns the validity period end date of this licensing condition. This is the - * value of its "validUntil" attribute. - * - * @return the valid until - * @since 0.5.0 + * @since 2.0 */ - Date getValidUntil(); + FeatureRefDescriptor getFeature(); /** - * The type of condition like "time" or "hardware". Defines the way the - * condition will be evaluated in a running environment. - * - * @return condition type - * @since 0.5.0 + * @since 2.0 */ - String getConditionType(); + ValidityPeriodDescriptor getValid(); /** - * Returns additional data encoded in a single string value. The expression is - * utilized by condition evaluation subsystem in conjunction with - * {@code conditionType} - * - * @return enlistment of additional information of this licensing condition - * @since 0.5.0 + * @since 2.0 */ - String getConditionExpression(); + EvaluationInstructionsDescriptor getUserAuthentication(); /** * Returns the capacity of this license grant. Used for floating license. This diff --git a/bundles/org.eclipse.passage.lic.licenses/src/org/eclipse/passage/lic/licenses/LicensePlanFeatureDescriptor.java b/bundles/org.eclipse.passage.lic.licenses/src/org/eclipse/passage/lic/licenses/LicensePlanFeatureDescriptor.java index d93c9448a..30dcff3c4 100644 --- a/bundles/org.eclipse.passage.lic.licenses/src/org/eclipse/passage/lic/licenses/LicensePlanFeatureDescriptor.java +++ b/bundles/org.eclipse.passage.lic.licenses/src/org/eclipse/passage/lic/licenses/LicensePlanFeatureDescriptor.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2019, 2020 ArSysOp + * Copyright (c) 2019, 2021 ArSysOp * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at @@ -25,31 +25,9 @@ public interface LicensePlanFeatureDescriptor { /** - * Returns the "Feature" identifier of this license plan feature. - * This is the value of its "featureIdentifier" attribute. - * - * @return the feature identifier - * @see LicenseGrantDescriptor#getFeatureIdentifier() - */ - String getFeatureIdentifier(); - - /** - * Returns the "Feature" match version of this license plan - * feature. This is the value of its "matchVersion" attribute. - * - * @return the match version - * @see LicenseGrantDescriptor#getMatchVersion() - */ - String getMatchVersion(); - - /** - * Returns the "Feature" match rule of this license plan feature. - * This is the value of its "matchRule" attribute. - * - * @return the match rule - * @see LicenseGrantDescriptor#getMatchRule() + * @since 2.0 */ - String getMatchRule(); + FeatureRefDescriptor getFeature(); /** * Returns the containing license plan of this license plan feature. diff --git a/bundles/org.eclipse.passage.lic.products.model/src/org/eclipse/passage/lic/internal/products/model/migration/ProductsResourceHandler.java b/bundles/org.eclipse.passage.lic.products.model/src/org/eclipse/passage/lic/internal/products/model/migration/ProductsResourceHandler.java index 77110acf4..7eef2d0c5 100644 --- a/bundles/org.eclipse.passage.lic.products.model/src/org/eclipse/passage/lic/internal/products/model/migration/ProductsResourceHandler.java +++ b/bundles/org.eclipse.passage.lic.products.model/src/org/eclipse/passage/lic/internal/products/model/migration/ProductsResourceHandler.java @@ -12,14 +12,15 @@ *******************************************************************************/ package org.eclipse.passage.lic.internal.products.model.migration; -import java.util.Map.Entry; +import java.util.Collections; -import org.eclipse.emf.ecore.EObject; import org.eclipse.emf.ecore.EPackage; -import org.eclipse.emf.ecore.xml.type.AnyType; import org.eclipse.passage.lic.emf.migration.DelegateClassifiers; import org.eclipse.passage.lic.emf.migration.EClassRoutes; +import org.eclipse.passage.lic.emf.migration.EFeatureRoutes; +import org.eclipse.passage.lic.emf.migration.EnsureStructure; import org.eclipse.passage.lic.emf.migration.SimpleClassRoutes; +import org.eclipse.passage.lic.emf.migration.SimpleFeatureRoutes; import org.eclipse.passage.lic.emf.xmi.MigratingResourceHandler; import org.eclipse.passage.lic.products.model.meta.ProductsPackage; @@ -32,8 +33,14 @@ protected void ensureMigrations() { } @Override - protected void convertEntry(Entry entry) { + protected EFeatureRoutes attributes() { + return new SimpleFeatureRoutes(); + } + + @Override + protected EnsureStructure structures() { // not yet needed + return e -> Collections.emptyList(); } private void migrate030() { diff --git a/bundles/org.eclipse.passage.lic.users.model/src/org/eclipse/passage/lic/internal/users/model/migration/UsersResourceHandler.java b/bundles/org.eclipse.passage.lic.users.model/src/org/eclipse/passage/lic/internal/users/model/migration/UsersResourceHandler.java index 5e2684506..3c523b8ec 100644 --- a/bundles/org.eclipse.passage.lic.users.model/src/org/eclipse/passage/lic/internal/users/model/migration/UsersResourceHandler.java +++ b/bundles/org.eclipse.passage.lic.users.model/src/org/eclipse/passage/lic/internal/users/model/migration/UsersResourceHandler.java @@ -12,14 +12,15 @@ *******************************************************************************/ package org.eclipse.passage.lic.internal.users.model.migration; -import java.util.Map.Entry; +import java.util.Collections; -import org.eclipse.emf.ecore.EObject; import org.eclipse.emf.ecore.EPackage; -import org.eclipse.emf.ecore.xml.type.AnyType; import org.eclipse.passage.lic.emf.migration.DelegateClassifiers; import org.eclipse.passage.lic.emf.migration.EClassRoutes; +import org.eclipse.passage.lic.emf.migration.EFeatureRoutes; +import org.eclipse.passage.lic.emf.migration.EnsureStructure; import org.eclipse.passage.lic.emf.migration.SimpleClassRoutes; +import org.eclipse.passage.lic.emf.migration.SimpleFeatureRoutes; import org.eclipse.passage.lic.emf.xmi.MigratingResourceHandler; import org.eclipse.passage.lic.users.model.meta.UsersPackage; @@ -33,8 +34,14 @@ protected void ensureMigrations() { } @Override - protected void convertEntry(Entry entry) { + protected EFeatureRoutes attributes() { + return new SimpleFeatureRoutes(); + } + + @Override + protected EnsureStructure structures() { // not yet needed + return e -> Collections.emptyList(); } private void migrate033() { diff --git a/bundles/org.eclipse.passage.loc.dashboard.ui/src/org/eclipse/passage/loc/dashboard/ui/wizards/IssueLicensePackPage.java b/bundles/org.eclipse.passage.loc.dashboard.ui/src/org/eclipse/passage/loc/dashboard/ui/wizards/IssueLicensePackPage.java index 63644e2df..7a5b1047c 100644 --- a/bundles/org.eclipse.passage.loc.dashboard.ui/src/org/eclipse/passage/loc/dashboard/ui/wizards/IssueLicensePackPage.java +++ b/bundles/org.eclipse.passage.loc.dashboard.ui/src/org/eclipse/passage/loc/dashboard/ui/wizards/IssueLicensePackPage.java @@ -32,6 +32,7 @@ import org.eclipse.passage.lic.licenses.PersonalLicensePackDescriptor; import org.eclipse.passage.lic.licenses.model.api.LicenseGrant; import org.eclipse.passage.lic.licenses.model.api.PersonalLicensePack; +import org.eclipse.passage.lic.licenses.model.api.ValidityPeriodClosed; import org.eclipse.passage.loc.internal.api.OperatorLicenseService; import org.eclipse.passage.loc.internal.api.PersonalLicenseRequest; import org.eclipse.passage.loc.internal.dashboard.ui.i18n.IssueLicensePageMessages; @@ -66,9 +67,10 @@ public void init() { license.getLicense().getProduct().setVersion(request.productVersion()); license.getLicense().getUser().setIdentifier(request.user()); EList licenseGrants = license.getGrants(); - for (LicenseGrant licenseGrant : licenseGrants) { - licenseGrant.setValidFrom(request.validFrom()); - licenseGrant.setValidUntil(request.validUntil()); + for (LicenseGrant grant : licenseGrants) { + ValidityPeriodClosed valid = (ValidityPeriodClosed) grant.getValid(); + valid.setFrom(request.validFrom()); + valid.setUntil(request.validUntil()); } return; } diff --git a/bundles/org.eclipse.passage.loc.licenses.core/src/org/eclipse/passage/loc/internal/licenses/core/EmailTemplate.java b/bundles/org.eclipse.passage.loc.licenses.core/src/org/eclipse/passage/loc/internal/licenses/core/EmailTemplate.java index 658a99f87..bcd95dba7 100644 --- a/bundles/org.eclipse.passage.loc.licenses.core/src/org/eclipse/passage/loc/internal/licenses/core/EmailTemplate.java +++ b/bundles/org.eclipse.passage.loc.licenses.core/src/org/eclipse/passage/loc/internal/licenses/core/EmailTemplate.java @@ -58,8 +58,8 @@ public List details(PersonalLicensePackDescriptor pack) { builder.add(NLS.bind(LicensesCoreMessages.LicenseRequest_product_version_lbl, pack.getLicense().getProduct().getVersion())); for (LicenseGrantDescriptor grant : pack.getGrants()) { - builder.add(NLS.bind(LicensesCoreMessages.LicenseRequest_feature_lbl, grant.getFeatureIdentifier())); - String conditionExpression = grant.getConditionExpression(); + builder.add(NLS.bind(LicensesCoreMessages.LicenseRequest_feature_lbl, grant.getFeature().getIdentifier())); + String conditionExpression = grant.getUserAuthentication().getExpression(); if (conditionExpression != null && !conditionExpression.isEmpty()) { builder.add(NLS.bind(LicensesCoreMessages.LicenseRequest_condition_expr_lbl, conditionExpression)); } @@ -92,7 +92,8 @@ public String mailTo(PersonalLicensePackDescriptor pack) { return builder.toString(); } - public File createEmlFile(String from, PersonalLicensePackDescriptor licensePack, IssuedLicense result) throws IOException { + public File createEmlFile(String from, PersonalLicensePackDescriptor licensePack, IssuedLicense result) + throws IOException { File attachment = result.encrypted().toFile(); File emlFile = new File(attachment.toString() + dotEml); try (FileOutputStream stream = new FileOutputStream(emlFile)) { diff --git a/bundles/org.eclipse.passage.loc.licenses.core/src/org/eclipse/passage/loc/internal/licenses/core/FloatingLicensePackFromRequest.java b/bundles/org.eclipse.passage.loc.licenses.core/src/org/eclipse/passage/loc/internal/licenses/core/FloatingLicensePackFromRequest.java index d2373424f..7366d0d39 100644 --- a/bundles/org.eclipse.passage.loc.licenses.core/src/org/eclipse/passage/loc/internal/licenses/core/FloatingLicensePackFromRequest.java +++ b/bundles/org.eclipse.passage.loc.licenses.core/src/org/eclipse/passage/loc/internal/licenses/core/FloatingLicensePackFromRequest.java @@ -188,7 +188,7 @@ private Collection featureGrants(FloatingLicensePack pack) { private FeatureGrant featureGrant(LicensePlanFeatureDescriptor feature, FloatingLicensePack pack, int no) { FeatureGrant grant = LicensesFactory.eINSTANCE.createFeatureGrant(); - String fid = feature.getFeatureIdentifier(); + String fid = feature.getFeature().getIdentifier(); grant.setFeature(fid); grant.setCapacity(request.defaultCapacity()); grant.setIdentifier(String.format("%s#%d", request.identifier(), no)); //$NON-NLS-1$ @@ -219,8 +219,9 @@ private Optional forFeature(List all, String feature private VersionMatch version(LicensePlanFeatureDescriptor feature) { VersionMatch version = LicensesFactory.eINSTANCE.createVersionMatch(); - version.setVersion(feature.getMatchVersion()); - version.setRule(new MatchingRuleForIdentifier(Optional.ofNullable(feature.getMatchRule())).get().identifier()); + version.setVersion(feature.getFeature().getVersion()); + version.setRule(new MatchingRuleForIdentifier(Optional.ofNullable(// + feature.getFeature().getMatchingRule())).get().identifier()); return version; } diff --git a/bundles/org.eclipse.passage.loc.licenses.core/src/org/eclipse/passage/loc/internal/licenses/core/LicenseGrantFromRequest.java b/bundles/org.eclipse.passage.loc.licenses.core/src/org/eclipse/passage/loc/internal/licenses/core/LicenseGrantFromRequest.java index aae13e2ce..b2687beab 100644 --- a/bundles/org.eclipse.passage.loc.licenses.core/src/org/eclipse/passage/loc/internal/licenses/core/LicenseGrantFromRequest.java +++ b/bundles/org.eclipse.passage.loc.licenses.core/src/org/eclipse/passage/loc/internal/licenses/core/LicenseGrantFromRequest.java @@ -16,9 +16,11 @@ import org.eclipse.passage.lic.licenses.LicensePlanFeatureDescriptor; import org.eclipse.passage.lic.licenses.model.api.LicenseGrant; +import org.eclipse.passage.lic.licenses.model.api.ValidityPeriodClosed; import org.eclipse.passage.lic.licenses.model.meta.LicensesFactory; import org.eclipse.passage.loc.internal.api.PersonalLicenseRequest; +@SuppressWarnings("restriction") final class LicenseGrantFromRequest implements Supplier { private final LicensePlanFeatureDescriptor feature; @@ -33,14 +35,14 @@ public LicenseGrantFromRequest(LicensePlanFeatureDescriptor feature, PersonalLic public LicenseGrant get() { LicensesFactory licenseFactory = LicensesFactory.eINSTANCE; LicenseGrant grant = licenseFactory.createLicenseGrant(); - grant.setFeatureIdentifier(feature.getFeatureIdentifier()); - grant.setMatchVersion(feature.getMatchVersion()); - grant.setMatchRule(feature.getMatchRule()); + grant.getFeature().setIdentifier(feature.getFeature().getIdentifier()); + grant.getFeature().setVersion(feature.getFeature().getVersion()); + grant.getFeature().setMatchingRule(feature.getFeature().getMatchingRule()); grant.setCapacity(1); - grant.setConditionExpression(request.conditionExpression()); - grant.setConditionType(request.conditionType()); - grant.setValidFrom(request.validFrom()); - grant.setValidUntil(request.validUntil()); + grant.getUserAuthentication().setExpression(request.conditionExpression()); + grant.getUserAuthentication().setType(request.conditionType()); + ((ValidityPeriodClosed) grant.getValid()).setFrom(request.validFrom()); + ((ValidityPeriodClosed) grant.getValid()).setUntil(request.validUntil()); return grant; } diff --git a/bundles/org.eclipse.passage.loc.licenses.core/src/org/eclipse/passage/loc/internal/licenses/core/issue/PersonalLicenseIssuingProtection.java b/bundles/org.eclipse.passage.loc.licenses.core/src/org/eclipse/passage/loc/internal/licenses/core/issue/PersonalLicenseIssuingProtection.java index ff04f2cc5..af19ef119 100644 --- a/bundles/org.eclipse.passage.loc.licenses.core/src/org/eclipse/passage/loc/internal/licenses/core/issue/PersonalLicenseIssuingProtection.java +++ b/bundles/org.eclipse.passage.loc.licenses.core/src/org/eclipse/passage/loc/internal/licenses/core/issue/PersonalLicenseIssuingProtection.java @@ -55,12 +55,16 @@ private void diminishGrant(LicenseGrant grant) { } private Optional validGet(LicenseGrant grant) { - return Optional.of(new BaseValidityPeriodClosed(date(grant.getValidFrom()), date(grant.getValidUntil()))); + return Optional.of(new BaseValidityPeriodClosed(// + date(((org.eclipse.passage.lic.licenses.model.api.ValidityPeriodClosed) grant.getValid()).getFrom()), // + date(((org.eclipse.passage.lic.licenses.model.api.ValidityPeriodClosed) grant.getValid()).getUntil()))); } private void validSet(LicenseGrant grant, ValidityPeriodClosed period) { - grant.setValidFrom(Date.from(period.from().toInstant())); - grant.setValidUntil(Date.from(period.to().toInstant())); + ((org.eclipse.passage.lic.licenses.model.api.ValidityPeriodClosed) grant.getValid()) + .setFrom(Date.from(period.from().toInstant())); + ((org.eclipse.passage.lic.licenses.model.api.ValidityPeriodClosed) grant.getValid()) + .setUntil(Date.from(period.to().toInstant())); } private ZonedDateTime date(Date date) { diff --git a/bundles/org.eclipse.passage.loc.licenses.emfforms/src/org/eclipse/passage/loc/licenses/emfforms/renderers/ConditionExpressionRendererService.java b/bundles/org.eclipse.passage.loc.licenses.emfforms/src/org/eclipse/passage/loc/licenses/emfforms/renderers/ConditionExpressionRendererService.java index ef76acb8d..389e1d062 100644 --- a/bundles/org.eclipse.passage.loc.licenses.emfforms/src/org/eclipse/passage/loc/licenses/emfforms/renderers/ConditionExpressionRendererService.java +++ b/bundles/org.eclipse.passage.loc.licenses.emfforms/src/org/eclipse/passage/loc/licenses/emfforms/renderers/ConditionExpressionRendererService.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2018, 2020 ArSysOp + * Copyright (c) 2018, 2021 ArSysOp * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at @@ -22,12 +22,13 @@ import org.osgi.service.component.annotations.Component; import org.osgi.service.component.annotations.Reference; +@SuppressWarnings("restriction") @Component public class ConditionExpressionRendererService extends StructuredFeatureRendererService implements EMFFormsDIRendererService { public ConditionExpressionRendererService() { - super(ConditionExpressionRenderer.class, LicensesPackage.eINSTANCE.getLicenseGrant_ConditionExpression()); + super(ConditionExpressionRenderer.class, LicensesPackage.eINSTANCE.getEvaluationInstructions_Expression()); } @Reference diff --git a/bundles/org.eclipse.passage.loc.licenses.emfforms/src/org/eclipse/passage/loc/licenses/emfforms/renderers/ConditionTypeRendererService.java b/bundles/org.eclipse.passage.loc.licenses.emfforms/src/org/eclipse/passage/loc/licenses/emfforms/renderers/ConditionTypeRendererService.java index 59b687c43..76b7b6734 100644 --- a/bundles/org.eclipse.passage.loc.licenses.emfforms/src/org/eclipse/passage/loc/licenses/emfforms/renderers/ConditionTypeRendererService.java +++ b/bundles/org.eclipse.passage.loc.licenses.emfforms/src/org/eclipse/passage/loc/licenses/emfforms/renderers/ConditionTypeRendererService.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2018, 2020 ArSysOp + * Copyright (c) 2018, 2021 ArSysOp * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at @@ -22,12 +22,15 @@ import org.osgi.service.component.annotations.Component; import org.osgi.service.component.annotations.Reference; +@SuppressWarnings("restriction") @Component public class ConditionTypeRendererService extends StructuredFeatureRendererService implements EMFFormsDIRendererService { public ConditionTypeRendererService() { - super(ConditionTypeRenderer.class, LicensesPackage.eINSTANCE.getLicenseGrant_ConditionType()); + super(ConditionTypeRenderer.class, // + LicensesPackage.eINSTANCE.getLicenseGrant_UserAuthentication(), // + LicensesPackage.eINSTANCE.getEvaluationInstructions_Type()); } @Reference diff --git a/bundles/org.eclipse.passage.loc.licenses.emfforms/src/org/eclipse/passage/loc/licenses/emfforms/renderers/FeatureIdentifierRendererService.java b/bundles/org.eclipse.passage.loc.licenses.emfforms/src/org/eclipse/passage/loc/licenses/emfforms/renderers/FeatureIdentifierRendererService.java index c687d5de7..0cbeb0e8d 100644 --- a/bundles/org.eclipse.passage.loc.licenses.emfforms/src/org/eclipse/passage/loc/licenses/emfforms/renderers/FeatureIdentifierRendererService.java +++ b/bundles/org.eclipse.passage.loc.licenses.emfforms/src/org/eclipse/passage/loc/licenses/emfforms/renderers/FeatureIdentifierRendererService.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2018, 2020 ArSysOp + * Copyright (c) 2018, 2021 ArSysOp * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at @@ -22,13 +22,13 @@ import org.osgi.service.component.annotations.Component; import org.osgi.service.component.annotations.Reference; +@SuppressWarnings("restriction") @Component public class FeatureIdentifierRendererService extends StructuredFeatureRendererService implements EMFFormsDIRendererService { public FeatureIdentifierRendererService() { - super(FeatureIdentifierRenderer.class, LicensesPackage.eINSTANCE.getLicensePlanFeature_FeatureIdentifier(), - LicensesPackage.eINSTANCE.getLicenseGrant_FeatureIdentifier()); + super(FeatureIdentifierRenderer.class, LicensesPackage.eINSTANCE.getFeatureRef_Identifier()); } @Reference diff --git a/bundles/org.eclipse.passage.loc.licenses.emfforms/src/org/eclipse/passage/loc/licenses/emfforms/renderers/MatchRuleRendererService.java b/bundles/org.eclipse.passage.loc.licenses.emfforms/src/org/eclipse/passage/loc/licenses/emfforms/renderers/MatchRuleRendererService.java index e74d6c789..cf21ccf51 100644 --- a/bundles/org.eclipse.passage.loc.licenses.emfforms/src/org/eclipse/passage/loc/licenses/emfforms/renderers/MatchRuleRendererService.java +++ b/bundles/org.eclipse.passage.loc.licenses.emfforms/src/org/eclipse/passage/loc/licenses/emfforms/renderers/MatchRuleRendererService.java @@ -27,8 +27,7 @@ public class MatchRuleRendererService extends StructuredFeatureRendererService implements EMFFormsDIRendererService { public MatchRuleRendererService() { - super(MatchRuleRenderer.class, LicensesPackage.eINSTANCE.getLicensePlanFeature_MatchRule(), - LicensesPackage.eINSTANCE.getLicenseGrant_MatchRule()); + super(MatchRuleRenderer.class, LicensesPackage.eINSTANCE.getFeatureRef_MatchingRule()); } @Reference diff --git a/bundles/org.eclipse.passage.loc.workbench.emfforms/src/org/eclipse/passage/loc/workbench/emfforms/renderers/MatchRuleRenderer.java b/bundles/org.eclipse.passage.loc.workbench.emfforms/src/org/eclipse/passage/loc/workbench/emfforms/renderers/MatchRuleRenderer.java index 36e7d6707..5fbb39026 100644 --- a/bundles/org.eclipse.passage.loc.workbench.emfforms/src/org/eclipse/passage/loc/workbench/emfforms/renderers/MatchRuleRenderer.java +++ b/bundles/org.eclipse.passage.loc.workbench.emfforms/src/org/eclipse/passage/loc/workbench/emfforms/renderers/MatchRuleRenderer.java @@ -123,9 +123,9 @@ private SemanticVersion guideVersion() { private Optional guide() { EObject owner = getViewModelContext().getDomainModel(); if (owner instanceof LicensePlanFeatureDescriptor) { - return Optional.ofNullable(((LicensePlanFeatureDescriptor) owner).getMatchVersion()); + return Optional.ofNullable(((LicensePlanFeatureDescriptor) owner).getFeature().getVersion()); } else if (owner instanceof LicenseGrantDescriptor) { - return Optional.ofNullable(((LicenseGrantDescriptor) owner).getMatchVersion()); + return Optional.ofNullable(((LicenseGrantDescriptor) owner).getFeature().getVersion()); } else if (owner instanceof VersionMatch) { return Optional.ofNullable(((VersionMatch) owner).getVersion()); } diff --git a/tests/org.eclipse.passage.lbc.base.tests/src/org/eclipse/passage/lbc/base/tests/FloatingCycleActionsDryRunTest.java b/tests/org.eclipse.passage.lbc.base.tests/src/org/eclipse/passage/lbc/base/tests/FloatingCycleActionsDryRunTest.java index 237d95c66..cb3c6fcaf 100644 --- a/tests/org.eclipse.passage.lbc.base.tests/src/org/eclipse/passage/lbc/base/tests/FloatingCycleActionsDryRunTest.java +++ b/tests/org.eclipse.passage.lbc.base.tests/src/org/eclipse/passage/lbc/base/tests/FloatingCycleActionsDryRunTest.java @@ -55,7 +55,7 @@ public void mineNothing() throws LicensingException, IOException { private List ofFeature(EList grants, RawRequest request) { String feature = new FeatureIdentifier((Function) request::parameter).get().get(); - Predicate featured = grant -> feature.equals(grant.getFeatureIdentifier()); + Predicate featured = grant -> feature.equals(grant.getFeature().getIdentifier()); return grants.stream().filter(featured).collect(Collectors.toList()); } diff --git a/tests/org.eclipse.passage.lbc.base.tests/src/org/eclipse/passage/lbc/base/tests/TestData.java b/tests/org.eclipse.passage.lbc.base.tests/src/org/eclipse/passage/lbc/base/tests/TestData.java index 11107a177..30cf0d250 100644 --- a/tests/org.eclipse.passage.lbc.base.tests/src/org/eclipse/passage/lbc/base/tests/TestData.java +++ b/tests/org.eclipse.passage.lbc.base.tests/src/org/eclipse/passage/lbc/base/tests/TestData.java @@ -13,6 +13,7 @@ package org.eclipse.passage.lbc.base.tests; import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; import java.time.Month; import java.time.ZoneId; @@ -22,6 +23,7 @@ import org.eclipse.passage.lic.internal.api.LicensedProduct; import org.eclipse.passage.lic.internal.base.BaseLicensedProduct; import org.eclipse.passage.lic.licenses.model.api.LicenseGrant; +import org.eclipse.passage.lic.licenses.model.api.ValidityPeriodClosed; @SuppressWarnings("restriction") public final class TestData { @@ -32,15 +34,16 @@ public final class TestData { private final User elder = new User("elder@magic.com", "os=win"); //$NON-NLS-1$ //$NON-NLS-2$ void assertGrantIsValid(LicenseGrant grant) { - assertEquals("hardware", grant.getConditionType()); //$NON-NLS-1$ - assertEquals("os.family=*", grant.getConditionExpression()); //$NON-NLS-1$ - assertEquals("anti-human-magic.product", grant.getFeatureIdentifier()); //$NON-NLS-1$ + assertEquals("hardware", grant.getUserAuthentication().getType()); //$NON-NLS-1$ + assertEquals("os.family=*", grant.getUserAuthentication().getExpression()); //$NON-NLS-1$ + assertEquals("anti-human-magic.product", grant.getFeature().getIdentifier()); //$NON-NLS-1$ assertEquals("2fa76bd6-f1b0-4d6b-9e86-280483aedc32#1", grant.getIdentifier()); //$NON-NLS-1$ - assertEquals("0.0.0", grant.getMatchVersion()); //$NON-NLS-1$ - assertEquals("compatible", grant.getMatchRule()); //$NON-NLS-1$ + assertEquals("0.0.0", grant.getFeature().getVersion()); //$NON-NLS-1$ + assertEquals("compatible", grant.getFeature().getMatchingRule()); //$NON-NLS-1$ assertEquals(1, grant.getCapacity()); - assertEquals(expectedFrom(), grant.getValidFrom()); - assertEquals(expectedUntil(), grant.getValidUntil()); + assertTrue(grant.getValid() instanceof ValidityPeriodClosed); + assertEquals(expectedFrom(), ((ValidityPeriodClosed)grant.getValid()).getFrom()); + assertEquals(expectedUntil(), ((ValidityPeriodClosed)grant.getValid()).getUntil()); } private Date expectedFrom() { diff --git a/tests/org.eclipse.passage.lic.licenses.model.tests/src/org/eclipse/passage/lic/internal/licenses/model/migration/tests/LicenseMigratorTest.java b/tests/org.eclipse.passage.lic.licenses.model.tests/src/org/eclipse/passage/lic/internal/licenses/model/migration/tests/LicenseMigratorTest.java index 45173c571..867d4898f 100644 --- a/tests/org.eclipse.passage.lic.licenses.model.tests/src/org/eclipse/passage/lic/internal/licenses/model/migration/tests/LicenseMigratorTest.java +++ b/tests/org.eclipse.passage.lic.licenses.model.tests/src/org/eclipse/passage/lic/internal/licenses/model/migration/tests/LicenseMigratorTest.java @@ -32,6 +32,7 @@ import org.eclipse.emf.common.util.URI; import org.eclipse.emf.ecore.EObject; import org.eclipse.emf.ecore.resource.Resource; +import org.eclipse.passage.lic.licenses.ValidityPeriodClosedDescriptor; import org.eclipse.passage.lic.licenses.model.api.LicenseGrant; import org.eclipse.passage.lic.licenses.model.api.PersonalLicensePack; import org.eclipse.passage.lic.licenses.model.util.LicensesResourceImpl; @@ -85,15 +86,15 @@ private void loaded(String path) throws IOException, ParseException { LicenseGrant grant = grants.get(0); assertEquals("org.eclipse.passage.lic.evaluation#0", grant.getIdentifier()); //$NON-NLS-1$ assertEquals(1, grant.getCapacity()); - assertEquals("os.family=*", grant.getConditionExpression()); //$NON-NLS-1$ - assertEquals("hardware", grant.getConditionType()); //$NON-NLS-1$ - assertEquals("org.eclipse.passage.lic.product", grant.getFeatureIdentifier()); //$NON-NLS-1$ - assertEquals("perfect", grant.getMatchRule()); //$NON-NLS-1$ - assertEquals("0.4.0", grant.getMatchVersion()); //$NON-NLS-1$ + assertEquals("os.family=*", grant.getUserAuthentication().getExpression()); //$NON-NLS-1$ + assertEquals("hardware", grant.getUserAuthentication().getType()); //$NON-NLS-1$ + assertEquals("org.eclipse.passage.lic.product", grant.getFeature().getIdentifier()); //$NON-NLS-1$ + assertEquals("perfect", grant.getFeature().getMatchingRule()); //$NON-NLS-1$ + assertEquals("0.4.0", grant.getFeature().getVersion()); //$NON-NLS-1$ assertEquals(getLicensingDateFormat().parse("2019-03-14T00:00:00.000+0300"), //$NON-NLS-1$ - grant.getValidFrom()); + ((ValidityPeriodClosedDescriptor) grant.getValid()).getFrom()); assertEquals(getLicensingDateFormat().parse("2019-06-14T00:00:00.000+0300"), //$NON-NLS-1$ - grant.getValidUntil()); + ((ValidityPeriodClosedDescriptor) grant.getValid()).getUntil()); } private PersonalLicensePack pack(String path) throws IOException { @@ -141,15 +142,15 @@ private LicenseGrant grant(String pack, EList grants, int no) { } private void assertGrant(LicenseGrant grant, String feature, String version) throws ParseException { - assertEquals(feature, grant.getFeatureIdentifier()); - assertEquals(version, grant.getMatchVersion()); - assertEquals(null, grant.getMatchRule()); - assertEquals("hardware", grant.getConditionType()); //$NON-NLS-1$ - assertEquals("os.family=*", grant.getConditionExpression()); //$NON-NLS-1$ + assertEquals(feature, grant.getFeature().getIdentifier()); + assertEquals(version, grant.getFeature().getVersion()); + assertEquals(null, grant.getFeature().getMatchingRule()); + assertEquals("hardware", grant.getUserAuthentication().getType()); //$NON-NLS-1$ + assertEquals("os.family=*", grant.getUserAuthentication().getExpression()); //$NON-NLS-1$ assertEquals(getLicensingDateFormat().parse("2020-12-02T00:00:00.000+0300"), //$NON-NLS-1$ - grant.getValidFrom()); + ((ValidityPeriodClosedDescriptor) grant.getValid()).getFrom()); assertEquals(getLicensingDateFormat().parse("2021-12-02T00:00:00.000+0300"), //$NON-NLS-1$ - grant.getValidUntil()); + ((ValidityPeriodClosedDescriptor) grant.getValid()).getUntil()); } private final Date issueDate() { diff --git a/tests/org.eclipse.passage.lic.licenses.model.tests/src/org/eclipse/passage/lic/internal/licenses/model/migration/tests/XmiLicensingConditionExtractorTest.java b/tests/org.eclipse.passage.lic.licenses.model.tests/src/org/eclipse/passage/lic/internal/licenses/model/migration/tests/XmiLicensingConditionExtractorTest.java index 0b6289709..16c310566 100644 --- a/tests/org.eclipse.passage.lic.licenses.model.tests/src/org/eclipse/passage/lic/internal/licenses/model/migration/tests/XmiLicensingConditionExtractorTest.java +++ b/tests/org.eclipse.passage.lic.licenses.model.tests/src/org/eclipse/passage/lic/internal/licenses/model/migration/tests/XmiLicensingConditionExtractorTest.java @@ -24,12 +24,13 @@ import org.eclipse.emf.common.util.EList; import org.eclipse.emf.ecore.resource.Resource; -import org.eclipse.emf.ecore.xmi.impl.XMIResourceImpl; import org.eclipse.passage.lic.internal.api.conditions.Condition; import org.eclipse.passage.lic.internal.licenses.model.toberemoved.XmiConditionTransport; import org.eclipse.passage.lic.licenses.model.api.LicenseGrant; import org.eclipse.passage.lic.licenses.model.api.PersonalLicensePack; +import org.eclipse.passage.lic.licenses.model.api.ValidityPeriodClosed; import org.eclipse.passage.lic.licenses.model.meta.LicensesFactory; +import org.eclipse.passage.lic.licenses.model.util.LicensesResourceImpl; import org.junit.Rule; import org.junit.Test; import org.junit.rules.TemporaryFolder; @@ -38,10 +39,12 @@ public class XmiLicensingConditionExtractorTest { private static final String COND1_FEATURE_ID = "loc.workbench"; //$NON-NLS-1$ + private static final String COND1_FEATURE_VERSION = "1.0.0"; //$NON-NLS-1$ private static final String COND1_CONDITION_TYPE = "hardware"; //$NON-NLS-1$ private static final String COND1_CONDITION_EXPRESSION = "mac=*"; //$NON-NLS-1$ private static final String COND2_FEATURE_ID = "loc.products.matrix"; //$NON-NLS-1$ + private static final String COND2_FEATURE_VERSION = "2.0.0"; //$NON-NLS-1$ private static final String COND2_CONDITION_TYPE = "hardware"; //$NON-NLS-1$ private static final String COND2_CONDITION_EXPRESSION = "hdd=*"; //$NON-NLS-1$ @@ -70,24 +73,26 @@ public void testExtractorPositive() throws Exception { PersonalLicensePack license = factory.createPersonalLicensePack(); EList licenseGrants = license.getGrants(); LicenseGrant cond1 = factory.createLicenseGrant(); - cond1.setFeatureIdentifier(COND1_FEATURE_ID); - cond1.setConditionType(COND1_CONDITION_TYPE); - cond1.setConditionExpression(COND1_CONDITION_EXPRESSION); - cond1.setValidFrom(new Date()); - cond1.setValidUntil(new Date(System.currentTimeMillis() + 1)); + cond1.getFeature().setIdentifier(COND1_FEATURE_ID); + cond1.getFeature().setVersion(COND1_FEATURE_VERSION); + cond1.getUserAuthentication().setType(COND1_CONDITION_TYPE); + cond1.getUserAuthentication().setExpression(COND1_CONDITION_EXPRESSION); + ((ValidityPeriodClosed) cond1.getValid()).setFrom(new Date()); + ((ValidityPeriodClosed) cond1.getValid()).setUntil(new Date(System.currentTimeMillis() + 1)); licenseGrants.add(cond1); LicenseGrant cond2 = factory.createLicenseGrant(); - cond2.setFeatureIdentifier(COND2_FEATURE_ID); - cond2.setConditionType(COND2_CONDITION_TYPE); - cond2.setConditionExpression(COND2_CONDITION_EXPRESSION); - cond2.setValidFrom(new Date()); - cond2.setValidUntil(new Date(System.currentTimeMillis() + 1)); + cond2.getFeature().setIdentifier(COND2_FEATURE_ID); + cond2.getFeature().setVersion(COND2_FEATURE_VERSION); + cond2.getUserAuthentication().setType(COND2_CONDITION_TYPE); + cond2.getUserAuthentication().setExpression(COND2_CONDITION_EXPRESSION); + ((ValidityPeriodClosed) cond2.getValid()).setFrom(new Date()); + ((ValidityPeriodClosed) cond2.getValid()).setUntil(new Date(System.currentTimeMillis() + 1)); licenseGrants.add(cond2); File file = baseFolder.newFile("some.lic"); //$NON-NLS-1$ try (FileOutputStream fos = new FileOutputStream(file)) { // FIXME:AF: should be done via factory - Resource saved = new XMIResourceImpl(); + Resource saved = new LicensesResourceImpl(); saved.getContents().add(license); saved.save(fos, new HashMap<>()); } @@ -99,10 +104,12 @@ public void testExtractorPositive() throws Exception { assertEquals(2, actual.size()); Condition actual1 = actual.get(0); assertEquals(COND1_FEATURE_ID, actual1.feature()); + assertEquals(COND1_FEATURE_VERSION, actual1.versionMatch().version()); assertEquals(COND1_CONDITION_TYPE, actual1.evaluationInstructions().type().identifier()); assertEquals(COND1_CONDITION_EXPRESSION, actual1.evaluationInstructions().expression()); Condition actual2 = actual.get(1); assertEquals(COND2_FEATURE_ID, actual2.feature()); + assertEquals(COND2_FEATURE_VERSION, actual2.versionMatch().version()); assertEquals(COND2_CONDITION_TYPE, actual2.evaluationInstructions().type().identifier()); assertEquals(COND2_CONDITION_EXPRESSION, actual2.evaluationInstructions().expression()); }