diff --git a/bundles/org.eclipse.passage.lic.users.ecore/model/users.ecore b/bundles/org.eclipse.passage.lic.users.ecore/model/users.ecore index eda2a5143..6d69fbaf7 100644 --- a/bundles/org.eclipse.passage.lic.users.ecore/model/users.ecore +++ b/bundles/org.eclipse.passage.lic.users.ecore/model/users.ecore @@ -1,30 +1,8 @@ - - -
- - - - -
- - - - - -
- - - - +
@@ -34,8 +12,7 @@ - +
@@ -53,7 +30,7 @@ - + @@ -73,7 +50,7 @@ - +
@@ -82,7 +59,7 @@ - + diff --git a/bundles/org.eclipse.passage.lic.users.edit/plugin.properties b/bundles/org.eclipse.passage.lic.users.edit/plugin.properties index 56c7acad0..57d91a61b 100644 --- a/bundles/org.eclipse.passage.lic.users.edit/plugin.properties +++ b/bundles/org.eclipse.passage.lic.users.edit/plugin.properties @@ -29,9 +29,7 @@ _UI_CreateChild_tooltip = Create New {0} Under {1} Feature _UI_CreateChild_description = Create a new child of type {0} for the {1} feature of the selected {2}. _UI_CreateSibling_description = Create a new sibling of type {0} for the selected {2}, under the {1} feature of their parent. _UI_PropertyDescriptor_description = The {0} of the {1} - _UI_UserOriginDescriptor_type = User Origin Descriptor -_UI_UserDescriptor_type = User Descriptor -_UI_UserOrigin_type = User Origin + _UI_UserOrigin_type = User Origin _UI_User_type = User _UI_Unknown_type = Object _UI_Unknown_datatype= Value @@ -49,7 +47,6 @@ _UI_Unknown_feature = Unspecified _UI_UserOrigin_text_pattern = {1} ({0}) _UI_User_preferredConditionType_feature = Preferred Condition Type _UI_User_preferredConditionExpression_feature = Preferred Condition Expression -_UI_UserLicenseDescriptor_type = User License Descriptor _UI_UserLicense_type = User License _UI_User_userLicenses_feature = User Licenses _UI_UserLicense_planIdentifier_feature = Plan Identifier @@ -63,9 +60,6 @@ _UI_UserLicense_packIdentifier_feature = Pack Identifier _UI_UserLicense_issueDate_feature = Issue Date _UI_UserLicense_user_feature = User _UI_UserLicense_label={0} {1} ({2}) -_UI_ContactDescriptor_type = Contact Descriptor -_UI_LicenseOwnerDescriptor_type = License Owner Descriptor -_UI_UserGroupDescriptor_type = User Group Descriptor _UI_UserGroup_type = User Group _UI_Contact_type = Contact _UI_LicenseOwner_type = License Owner diff --git a/bundles/org.eclipse.passage.lic.users.edit/plugin.xml b/bundles/org.eclipse.passage.lic.users.edit/plugin.xml index 5627b6590..70ccbe6be 100644 --- a/bundles/org.eclipse.passage.lic.users.edit/plugin.xml +++ b/bundles/org.eclipse.passage.lic.users.edit/plugin.xml @@ -19,7 +19,7 @@ platform:/resource/org.eclipse.passage.lic.users.ecore/model/users.ecore @@ -17,11 +17,6 @@ classPackageSuffix="model.impl" utilityPackageSuffix="model.util" providerPackageSuffix="edit.providers" presentationPackageSuffix="editor" testsPackageSuffix="model.tests" literalsInterface="false" ecorePackage="../../org.eclipse.passage.lic.users.ecore/model/users.ecore#/"> - - - - - diff --git a/bundles/org.eclipse.passage.lic.users.model/plugin.xml b/bundles/org.eclipse.passage.lic.users.model/plugin.xml index b32c65715..0e26dfc45 100644 --- a/bundles/org.eclipse.passage.lic.users.model/plugin.xml +++ b/bundles/org.eclipse.passage.lic.users.model/plugin.xml @@ -18,7 +18,7 @@ diff --git a/bundles/org.eclipse.passage.lic.users.model/src-gen/org/eclipse/passage/lic/users/model/api/Contact.java b/bundles/org.eclipse.passage.lic.users.model/src-gen/org/eclipse/passage/lic/users/model/api/Contact.java index 1257e57da..34c590d90 100644 --- a/bundles/org.eclipse.passage.lic.users.model/src-gen/org/eclipse/passage/lic/users/model/api/Contact.java +++ b/bundles/org.eclipse.passage.lic.users.model/src-gen/org/eclipse/passage/lic/users/model/api/Contact.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2018, 2021 ArSysOp + * Copyright (c) 2018, 2024 ArSysOp * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at @@ -14,8 +14,6 @@ import org.eclipse.emf.ecore.EObject; -import org.eclipse.passage.lic.users.ContactDescriptor; - /** * * A representation of the model object 'Contact'. @@ -37,10 +35,10 @@ * * * @see org.eclipse.passage.lic.users.model.meta.UsersPackage#getContact() - * @model superTypes="org.eclipse.passage.lic.users.model.api.ContactDescriptor" + * @model * @generated */ -public interface Contact extends EObject, ContactDescriptor { +public interface Contact extends EObject { /** * Returns the value of the 'Name' attribute. * @@ -51,7 +49,6 @@ public interface Contact extends EObject, ContactDescriptor { * @model required="true" * @generated */ - @Override String getName(); /** @@ -74,7 +71,6 @@ public interface Contact extends EObject, ContactDescriptor { * @model * @generated */ - @Override String getTitle(); /** @@ -97,7 +93,6 @@ public interface Contact extends EObject, ContactDescriptor { * @model * @generated */ - @Override String getPosition(); /** @@ -120,7 +115,6 @@ public interface Contact extends EObject, ContactDescriptor { * @model required="true" * @generated */ - @Override String getEmail(); /** @@ -143,7 +137,6 @@ public interface Contact extends EObject, ContactDescriptor { * @model * @generated */ - @Override String getAddress(); /** diff --git a/bundles/org.eclipse.passage.lic.users.model/src-gen/org/eclipse/passage/lic/users/model/api/LicenseOwner.java b/bundles/org.eclipse.passage.lic.users.model/src-gen/org/eclipse/passage/lic/users/model/api/LicenseOwner.java index 7f740e533..7ac8057f0 100644 --- a/bundles/org.eclipse.passage.lic.users.model/src-gen/org/eclipse/passage/lic/users/model/api/LicenseOwner.java +++ b/bundles/org.eclipse.passage.lic.users.model/src-gen/org/eclipse/passage/lic/users/model/api/LicenseOwner.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2018, 2021 ArSysOp + * Copyright (c) 2018, 2024 ArSysOp * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at @@ -13,7 +13,6 @@ package org.eclipse.passage.lic.users.model.api; import org.eclipse.emf.ecore.EObject; -import org.eclipse.passage.lic.users.LicenseOwnerDescriptor; /** * @@ -35,10 +34,10 @@ * * * @see org.eclipse.passage.lic.users.model.meta.UsersPackage#getLicenseOwner() - * @model interface="true" abstract="true" superTypes="org.eclipse.passage.lic.users.model.api.LicenseOwnerDescriptor" + * @model interface="true" abstract="true" * @generated */ -public interface LicenseOwner extends EObject, LicenseOwnerDescriptor { +public interface LicenseOwner extends EObject { /** * Returns the value of the 'Identifier' attribute. * @@ -49,7 +48,6 @@ public interface LicenseOwner extends EObject, LicenseOwnerDescriptor { * @model * @generated */ - @Override String getIdentifier(); /** @@ -75,7 +73,6 @@ public interface LicenseOwner extends EObject, LicenseOwnerDescriptor { * @model * @generated */ - @Override String getName(); /** @@ -99,7 +96,6 @@ public interface LicenseOwner extends EObject, LicenseOwnerDescriptor { * @model * @generated */ - @Override String getDescription(); /** @@ -125,7 +121,6 @@ public interface LicenseOwner extends EObject, LicenseOwnerDescriptor { * @model containment="true" required="true" * @generated */ - @Override Contact getContact(); /** diff --git a/bundles/org.eclipse.passage.lic.users.model/src-gen/org/eclipse/passage/lic/users/model/api/User.java b/bundles/org.eclipse.passage.lic.users.model/src-gen/org/eclipse/passage/lic/users/model/api/User.java index 5f16b86b0..4c2c646e0 100644 --- a/bundles/org.eclipse.passage.lic.users.model/src-gen/org/eclipse/passage/lic/users/model/api/User.java +++ b/bundles/org.eclipse.passage.lic.users.model/src-gen/org/eclipse/passage/lic/users/model/api/User.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2018, 2021 ArSysOp + * Copyright (c) 2018, 2024 ArSysOp * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at @@ -12,8 +12,6 @@ *******************************************************************************/ package org.eclipse.passage.lic.users.model.api; -import org.eclipse.passage.lic.users.UserDescriptor; - /** * * A representation of the model object 'User'. @@ -29,10 +27,10 @@ * * * @see org.eclipse.passage.lic.users.model.meta.UsersPackage#getUser() - * @model superTypes="org.eclipse.passage.lic.users.model.api.UserDescriptor org.eclipse.passage.lic.users.model.api.LicenseOwner" + * @model * @generated */ -public interface User extends UserDescriptor, LicenseOwner { +public interface User extends LicenseOwner { /** * Returns the value of the 'Preferred Evaluation Type' attribute. * @@ -46,7 +44,6 @@ public interface User extends UserDescriptor, LicenseOwner { * @model * @generated */ - @Override String getPreferredEvaluationType(); /** @@ -73,7 +70,6 @@ public interface User extends UserDescriptor, LicenseOwner { * @model * @generated */ - @Override String getPreferredEvaluationExpression(); /** @@ -102,7 +98,6 @@ public interface User extends UserDescriptor, LicenseOwner { * @model opposite="users" required="true" transient="false" * @generated */ - @Override UserOrigin getOrigin(); /** diff --git a/bundles/org.eclipse.passage.lic.users.model/src-gen/org/eclipse/passage/lic/users/model/api/UserGroup.java b/bundles/org.eclipse.passage.lic.users.model/src-gen/org/eclipse/passage/lic/users/model/api/UserGroup.java index 82d6e4638..5d03efeb9 100644 --- a/bundles/org.eclipse.passage.lic.users.model/src-gen/org/eclipse/passage/lic/users/model/api/UserGroup.java +++ b/bundles/org.eclipse.passage.lic.users.model/src-gen/org/eclipse/passage/lic/users/model/api/UserGroup.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2018, 2021 ArSysOp + * Copyright (c) 2018, 2024 ArSysOp * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at @@ -13,7 +13,6 @@ package org.eclipse.passage.lic.users.model.api; import org.eclipse.emf.common.util.EList; -import org.eclipse.passage.lic.users.UserGroupDescriptor; /** * @@ -33,10 +32,10 @@ * * * @see org.eclipse.passage.lic.users.model.meta.UsersPackage#getUserGroup() - * @model superTypes="org.eclipse.passage.lic.users.model.api.UserGroupDescriptor org.eclipse.passage.lic.users.model.api.LicenseOwner" + * @model * @generated */ -public interface UserGroup extends UserGroupDescriptor, LicenseOwner { +public interface UserGroup extends LicenseOwner { /** * Returns the value of the 'Users' reference list. * The list contents are of type {@link org.eclipse.passage.lic.users.model.api.User}. @@ -47,7 +46,6 @@ public interface UserGroup extends UserGroupDescriptor, LicenseOwner { * @model * @generated */ - @Override EList getUsers(); /** @@ -62,7 +60,6 @@ public interface UserGroup extends UserGroupDescriptor, LicenseOwner { * @model opposite="groups" required="true" transient="false" * @generated */ - @Override UserOrigin getOrigin(); /** diff --git a/bundles/org.eclipse.passage.lic.users.model/src-gen/org/eclipse/passage/lic/users/model/api/UserOrigin.java b/bundles/org.eclipse.passage.lic.users.model/src-gen/org/eclipse/passage/lic/users/model/api/UserOrigin.java index 36aaaa392..5a2d8e189 100644 --- a/bundles/org.eclipse.passage.lic.users.model/src-gen/org/eclipse/passage/lic/users/model/api/UserOrigin.java +++ b/bundles/org.eclipse.passage.lic.users.model/src-gen/org/eclipse/passage/lic/users/model/api/UserOrigin.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2018, 2021 ArSysOp + * Copyright (c) 2018, 2024 ArSysOp * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at @@ -13,11 +13,8 @@ package org.eclipse.passage.lic.users.model.api; import org.eclipse.emf.common.util.EList; - import org.eclipse.emf.ecore.EObject; -import org.eclipse.passage.lic.users.UserOriginDescriptor; - /** * * A representation of the model object 'User Origin'. @@ -35,10 +32,10 @@ * * * @see org.eclipse.passage.lic.users.model.meta.UsersPackage#getUserOrigin() - * @model superTypes="org.eclipse.passage.lic.users.model.api.UserOriginDescriptor" + * @model * @generated */ -public interface UserOrigin extends EObject, UserOriginDescriptor { +public interface UserOrigin extends EObject { /** * Returns the value of the 'Identifier' attribute. * @@ -49,7 +46,6 @@ public interface UserOrigin extends EObject, UserOriginDescriptor { * @model required="true" * @generated */ - @Override String getIdentifier(); /** @@ -72,7 +68,6 @@ public interface UserOrigin extends EObject, UserOriginDescriptor { * @model * @generated */ - @Override String getName(); /** @@ -95,7 +90,6 @@ public interface UserOrigin extends EObject, UserOriginDescriptor { * @model required="true" * @generated */ - @Override String getDescription(); /** @@ -120,7 +114,6 @@ public interface UserOrigin extends EObject, UserOriginDescriptor { * @model opposite="origin" containment="true" * @generated */ - @Override EList getUsers(); /** @@ -138,7 +131,6 @@ public interface UserOrigin extends EObject, UserOriginDescriptor { * @model opposite="origin" containment="true" * @generated */ - @Override EList getGroups(); } // UserOrigin diff --git a/bundles/org.eclipse.passage.lic.users.model/src-gen/org/eclipse/passage/lic/users/model/impl/ContactImpl.java b/bundles/org.eclipse.passage.lic.users.model/src-gen/org/eclipse/passage/lic/users/model/impl/ContactImpl.java index c574a5a30..de126f9b9 100644 --- a/bundles/org.eclipse.passage.lic.users.model/src-gen/org/eclipse/passage/lic/users/model/impl/ContactImpl.java +++ b/bundles/org.eclipse.passage.lic.users.model/src-gen/org/eclipse/passage/lic/users/model/impl/ContactImpl.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2018, 2021 ArSysOp + * Copyright (c) 2018, 2024 ArSysOp * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at @@ -15,14 +15,10 @@ 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.users.model.api.Contact; - import org.eclipse.passage.lic.users.model.meta.UsersPackage; /** @@ -413,4 +409,4 @@ public String toString() { return result.toString(); } -} //ContactImpl +} // ContactImpl diff --git a/bundles/org.eclipse.passage.lic.users.model/src-gen/org/eclipse/passage/lic/users/model/impl/UserGroupImpl.java b/bundles/org.eclipse.passage.lic.users.model/src-gen/org/eclipse/passage/lic/users/model/impl/UserGroupImpl.java index 0a361239f..1f082d6e3 100644 --- a/bundles/org.eclipse.passage.lic.users.model/src-gen/org/eclipse/passage/lic/users/model/impl/UserGroupImpl.java +++ b/bundles/org.eclipse.passage.lic.users.model/src-gen/org/eclipse/passage/lic/users/model/impl/UserGroupImpl.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2018, 2021 ArSysOp + * Copyright (c) 2018, 2024 ArSysOp * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at @@ -17,24 +17,17 @@ import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.common.notify.NotificationChain; - import org.eclipse.emf.common.util.EList; 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.EObjectResolvingEList; import org.eclipse.emf.ecore.util.EcoreUtil; -import org.eclipse.passage.lic.users.LicenseOwnerDescriptor; - import org.eclipse.passage.lic.users.model.api.Contact; -import org.eclipse.passage.lic.users.model.api.LicenseOwner; import org.eclipse.passage.lic.users.model.api.User; import org.eclipse.passage.lic.users.model.api.UserGroup; import org.eclipse.passage.lic.users.model.api.UserOrigin; - import org.eclipse.passage.lic.users.model.meta.UsersPackage; /** @@ -521,66 +514,6 @@ public boolean eIsSet(int featureID) { } } - /** - * - * - * @generated - */ - @Override - public int eBaseStructuralFeatureID(int derivedFeatureID, Class baseClass) { - if (baseClass == LicenseOwnerDescriptor.class) { - switch (derivedFeatureID) { - default: - return -1; - } - } - if (baseClass == LicenseOwner.class) { - switch (derivedFeatureID) { - case UsersPackage.USER_GROUP__IDENTIFIER: - return UsersPackage.LICENSE_OWNER__IDENTIFIER; - case UsersPackage.USER_GROUP__NAME: - return UsersPackage.LICENSE_OWNER__NAME; - case UsersPackage.USER_GROUP__DESCRIPTION: - return UsersPackage.LICENSE_OWNER__DESCRIPTION; - case UsersPackage.USER_GROUP__CONTACT: - return UsersPackage.LICENSE_OWNER__CONTACT; - default: - return -1; - } - } - return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass); - } - - /** - * - * - * @generated - */ - @Override - public int eDerivedStructuralFeatureID(int baseFeatureID, Class baseClass) { - if (baseClass == LicenseOwnerDescriptor.class) { - switch (baseFeatureID) { - default: - return -1; - } - } - if (baseClass == LicenseOwner.class) { - switch (baseFeatureID) { - case UsersPackage.LICENSE_OWNER__IDENTIFIER: - return UsersPackage.USER_GROUP__IDENTIFIER; - case UsersPackage.LICENSE_OWNER__NAME: - return UsersPackage.USER_GROUP__NAME; - case UsersPackage.LICENSE_OWNER__DESCRIPTION: - return UsersPackage.USER_GROUP__DESCRIPTION; - case UsersPackage.LICENSE_OWNER__CONTACT: - return UsersPackage.USER_GROUP__CONTACT; - default: - return -1; - } - } - return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass); - } - /** * * @@ -602,4 +535,4 @@ public String toString() { return result.toString(); } -} //UserGroupImpl +} // UserGroupImpl diff --git a/bundles/org.eclipse.passage.lic.users.model/src-gen/org/eclipse/passage/lic/users/model/impl/UserImpl.java b/bundles/org.eclipse.passage.lic.users.model/src-gen/org/eclipse/passage/lic/users/model/impl/UserImpl.java index 304dd1693..f05c42ac8 100644 --- a/bundles/org.eclipse.passage.lic.users.model/src-gen/org/eclipse/passage/lic/users/model/impl/UserImpl.java +++ b/bundles/org.eclipse.passage.lic.users.model/src-gen/org/eclipse/passage/lic/users/model/impl/UserImpl.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2018, 2021 ArSysOp + * Copyright (c) 2018, 2024 ArSysOp * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at @@ -16,21 +16,14 @@ 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.users.LicenseOwnerDescriptor; import org.eclipse.passage.lic.users.model.api.Contact; -import org.eclipse.passage.lic.users.model.api.LicenseOwner; import org.eclipse.passage.lic.users.model.api.User; import org.eclipse.passage.lic.users.model.api.UserOrigin; - import org.eclipse.passage.lic.users.model.meta.UsersPackage; /** @@ -601,66 +594,6 @@ public boolean eIsSet(int featureID) { } } - /** - * - * - * @generated - */ - @Override - public int eBaseStructuralFeatureID(int derivedFeatureID, Class baseClass) { - if (baseClass == LicenseOwnerDescriptor.class) { - switch (derivedFeatureID) { - default: - return -1; - } - } - if (baseClass == LicenseOwner.class) { - switch (derivedFeatureID) { - case UsersPackage.USER__IDENTIFIER: - return UsersPackage.LICENSE_OWNER__IDENTIFIER; - case UsersPackage.USER__NAME: - return UsersPackage.LICENSE_OWNER__NAME; - case UsersPackage.USER__DESCRIPTION: - return UsersPackage.LICENSE_OWNER__DESCRIPTION; - case UsersPackage.USER__CONTACT: - return UsersPackage.LICENSE_OWNER__CONTACT; - default: - return -1; - } - } - return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass); - } - - /** - * - * - * @generated - */ - @Override - public int eDerivedStructuralFeatureID(int baseFeatureID, Class baseClass) { - if (baseClass == LicenseOwnerDescriptor.class) { - switch (baseFeatureID) { - default: - return -1; - } - } - if (baseClass == LicenseOwner.class) { - switch (baseFeatureID) { - case UsersPackage.LICENSE_OWNER__IDENTIFIER: - return UsersPackage.USER__IDENTIFIER; - case UsersPackage.LICENSE_OWNER__NAME: - return UsersPackage.USER__NAME; - case UsersPackage.LICENSE_OWNER__DESCRIPTION: - return UsersPackage.USER__DESCRIPTION; - case UsersPackage.LICENSE_OWNER__CONTACT: - return UsersPackage.USER__CONTACT; - default: - return -1; - } - } - return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass); - } - /** * * @@ -686,4 +619,4 @@ public String toString() { return result.toString(); } -} //UserImpl +} // UserImpl diff --git a/bundles/org.eclipse.passage.lic.users.model/src-gen/org/eclipse/passage/lic/users/model/impl/UserOriginImpl.java b/bundles/org.eclipse.passage.lic.users.model/src-gen/org/eclipse/passage/lic/users/model/impl/UserOriginImpl.java index 39c2c7ec8..4a61857e4 100644 --- a/bundles/org.eclipse.passage.lic.users.model/src-gen/org/eclipse/passage/lic/users/model/impl/UserOriginImpl.java +++ b/bundles/org.eclipse.passage.lic.users.model/src-gen/org/eclipse/passage/lic/users/model/impl/UserOriginImpl.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2018, 2021 ArSysOp + * Copyright (c) 2018, 2024 ArSysOp * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at @@ -17,21 +17,16 @@ import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.common.notify.NotificationChain; - import org.eclipse.emf.common.util.EList; - 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.EObjectContainmentWithInverseEList; import org.eclipse.emf.ecore.util.InternalEList; - import org.eclipse.passage.lic.users.model.api.User; import org.eclipse.passage.lic.users.model.api.UserGroup; import org.eclipse.passage.lic.users.model.api.UserOrigin; - import org.eclipse.passage.lic.users.model.meta.UsersPackage; /** @@ -418,4 +413,4 @@ public String toString() { return result.toString(); } -} //UserOriginImpl +} // UserOriginImpl diff --git a/bundles/org.eclipse.passage.lic.users.model/src-gen/org/eclipse/passage/lic/users/model/impl/UsersFactoryImpl.java b/bundles/org.eclipse.passage.lic.users.model/src-gen/org/eclipse/passage/lic/users/model/impl/UsersFactoryImpl.java index f37f57146..d45929faf 100644 --- a/bundles/org.eclipse.passage.lic.users.model/src-gen/org/eclipse/passage/lic/users/model/impl/UsersFactoryImpl.java +++ b/bundles/org.eclipse.passage.lic.users.model/src-gen/org/eclipse/passage/lic/users/model/impl/UsersFactoryImpl.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2018, 2021 ArSysOp + * Copyright (c) 2018, 2024 ArSysOp * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at @@ -15,13 +15,12 @@ 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.users.model.api.*; - +import org.eclipse.passage.lic.users.model.api.Contact; +import org.eclipse.passage.lic.users.model.api.User; +import org.eclipse.passage.lic.users.model.api.UserGroup; +import org.eclipse.passage.lic.users.model.api.UserOrigin; import org.eclipse.passage.lic.users.model.meta.UsersFactory; import org.eclipse.passage.lic.users.model.meta.UsersPackage; @@ -148,4 +147,4 @@ public static UsersPackage getPackage() { return UsersPackage.eINSTANCE; } -} //UsersFactoryImpl +} // UsersFactoryImpl diff --git a/bundles/org.eclipse.passage.lic.users.model/src-gen/org/eclipse/passage/lic/users/model/impl/UsersPackageImpl.java b/bundles/org.eclipse.passage.lic.users.model/src-gen/org/eclipse/passage/lic/users/model/impl/UsersPackageImpl.java index bb8b98ced..5d9c3c772 100644 --- a/bundles/org.eclipse.passage.lic.users.model/src-gen/org/eclipse/passage/lic/users/model/impl/UsersPackageImpl.java +++ b/bundles/org.eclipse.passage.lic.users.model/src-gen/org/eclipse/passage/lic/users/model/impl/UsersPackageImpl.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2018, 2021 ArSysOp + * Copyright (c) 2018, 2024 ArSysOp * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at @@ -16,21 +16,12 @@ import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.EPackage; import org.eclipse.emf.ecore.EReference; - import org.eclipse.emf.ecore.impl.EPackageImpl; - -import org.eclipse.passage.lic.users.ContactDescriptor; -import org.eclipse.passage.lic.users.LicenseOwnerDescriptor; -import org.eclipse.passage.lic.users.UserDescriptor; -import org.eclipse.passage.lic.users.UserGroupDescriptor; -import org.eclipse.passage.lic.users.UserOriginDescriptor; - import org.eclipse.passage.lic.users.model.api.Contact; import org.eclipse.passage.lic.users.model.api.LicenseOwner; import org.eclipse.passage.lic.users.model.api.User; import org.eclipse.passage.lic.users.model.api.UserGroup; import org.eclipse.passage.lic.users.model.api.UserOrigin; - import org.eclipse.passage.lic.users.model.meta.UsersFactory; import org.eclipse.passage.lic.users.model.meta.UsersPackage; @@ -41,44 +32,6 @@ * @generated */ public class UsersPackageImpl extends EPackageImpl implements UsersPackage { - /** - * - * - * @generated - */ - private EClass userOriginDescriptorEClass = null; - - /** - * - * - * @since 2.0 - * @generated - */ - private EClass contactDescriptorEClass = null; - - /** - * - * - * @since 2.0 - * @generated - */ - private EClass licenseOwnerDescriptorEClass = null; - - /** - * - * - * @generated - */ - private EClass userDescriptorEClass = null; - - /** - * - * - * @since 2.0 - * @generated - */ - private EClass userGroupDescriptorEClass = null; - /** * * @@ -181,59 +134,6 @@ public static UsersPackage init() { return theUsersPackage; } - /** - * - * - * @generated - */ - @Override - public EClass getUserOriginDescriptor() { - return userOriginDescriptorEClass; - } - - /** - * - * - * @since 2.0 - * @generated - */ - @Override - public EClass getContactDescriptor() { - return contactDescriptorEClass; - } - - /** - * - * - * @since 2.0 - * @generated - */ - @Override - public EClass getLicenseOwnerDescriptor() { - return licenseOwnerDescriptorEClass; - } - - /** - * - * - * @generated - */ - @Override - public EClass getUserDescriptor() { - return userDescriptorEClass; - } - - /** - * - * - * @since 2.0 - * @generated - */ - @Override - public EClass getUserGroupDescriptor() { - return userGroupDescriptorEClass; - } - /** * * @@ -522,16 +422,6 @@ public void createPackageContents() { isCreated = true; // Create classes and their features - contactDescriptorEClass = createEClass(CONTACT_DESCRIPTOR); - - licenseOwnerDescriptorEClass = createEClass(LICENSE_OWNER_DESCRIPTOR); - - userDescriptorEClass = createEClass(USER_DESCRIPTOR); - - userGroupDescriptorEClass = createEClass(USER_GROUP_DESCRIPTOR); - - userOriginDescriptorEClass = createEClass(USER_ORIGIN_DESCRIPTOR); - contactEClass = createEClass(CONTACT); createEAttribute(contactEClass, CONTACT__NAME); createEAttribute(contactEClass, CONTACT__TITLE); @@ -591,30 +481,10 @@ public void initializePackageContents() { // Set bounds for type parameters // Add supertypes to classes - contactEClass.getESuperTypes().add(this.getContactDescriptor()); - licenseOwnerEClass.getESuperTypes().add(this.getLicenseOwnerDescriptor()); - userEClass.getESuperTypes().add(this.getUserDescriptor()); userEClass.getESuperTypes().add(this.getLicenseOwner()); - userGroupEClass.getESuperTypes().add(this.getUserGroupDescriptor()); userGroupEClass.getESuperTypes().add(this.getLicenseOwner()); - userOriginEClass.getESuperTypes().add(this.getUserOriginDescriptor()); // Initialize classes, features, and operations; add parameters - initEClass(contactDescriptorEClass, ContactDescriptor.class, "ContactDescriptor", IS_ABSTRACT, IS_INTERFACE, //$NON-NLS-1$ - !IS_GENERATED_INSTANCE_CLASS); - - initEClass(licenseOwnerDescriptorEClass, LicenseOwnerDescriptor.class, "LicenseOwnerDescriptor", IS_ABSTRACT, //$NON-NLS-1$ - IS_INTERFACE, !IS_GENERATED_INSTANCE_CLASS); - - initEClass(userDescriptorEClass, UserDescriptor.class, "UserDescriptor", IS_ABSTRACT, IS_INTERFACE, //$NON-NLS-1$ - !IS_GENERATED_INSTANCE_CLASS); - - initEClass(userGroupDescriptorEClass, UserGroupDescriptor.class, "UserGroupDescriptor", IS_ABSTRACT, //$NON-NLS-1$ - IS_INTERFACE, !IS_GENERATED_INSTANCE_CLASS); - - initEClass(userOriginDescriptorEClass, UserOriginDescriptor.class, "UserOriginDescriptor", IS_ABSTRACT, //$NON-NLS-1$ - IS_INTERFACE, !IS_GENERATED_INSTANCE_CLASS); - initEClass(contactEClass, Contact.class, "Contact", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$ initEAttribute(getContact_Name(), ecorePackage.getEString(), "name", null, 1, 1, Contact.class, !IS_TRANSIENT, //$NON-NLS-1$ !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); @@ -682,4 +552,4 @@ public void initializePackageContents() { createResource(eNS_URI); } -} //UsersPackageImpl +} // UsersPackageImpl diff --git a/bundles/org.eclipse.passage.lic.users.model/src-gen/org/eclipse/passage/lic/users/model/meta/UsersFactory.java b/bundles/org.eclipse.passage.lic.users.model/src-gen/org/eclipse/passage/lic/users/model/meta/UsersFactory.java index 714e26115..9b4440557 100644 --- a/bundles/org.eclipse.passage.lic.users.model/src-gen/org/eclipse/passage/lic/users/model/meta/UsersFactory.java +++ b/bundles/org.eclipse.passage.lic.users.model/src-gen/org/eclipse/passage/lic/users/model/meta/UsersFactory.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2018, 2021 ArSysOp + * Copyright (c) 2018, 2024 ArSysOp * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at @@ -13,7 +13,6 @@ package org.eclipse.passage.lic.users.model.meta; import org.eclipse.emf.ecore.EFactory; - import org.eclipse.passage.lic.users.model.api.Contact; import org.eclipse.passage.lic.users.model.api.User; import org.eclipse.passage.lic.users.model.api.UserGroup; @@ -83,4 +82,4 @@ public interface UsersFactory extends EFactory { */ UsersPackage getUsersPackage(); -} //UsersFactory +} // UsersFactory diff --git a/bundles/org.eclipse.passage.lic.users.model/src-gen/org/eclipse/passage/lic/users/model/meta/UsersPackage.java b/bundles/org.eclipse.passage.lic.users.model/src-gen/org/eclipse/passage/lic/users/model/meta/UsersPackage.java index b4125bcef..6b4df1930 100644 --- a/bundles/org.eclipse.passage.lic.users.model/src-gen/org/eclipse/passage/lic/users/model/meta/UsersPackage.java +++ b/bundles/org.eclipse.passage.lic.users.model/src-gen/org/eclipse/passage/lic/users/model/meta/UsersPackage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2018, 2021 ArSysOp + * Copyright (c) 2018, 2024 ArSysOp * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at @@ -48,7 +48,7 @@ public interface UsersPackage extends EPackage { * * @generated */ - String eNS_URI = "http://www.eclipse.org/passage/lic/users/2.0.0"; //$NON-NLS-1$ + String eNS_URI = "http://www.eclipse.org/passage/lic/users/3.0.0"; //$NON-NLS-1$ /** * The package namespace name. @@ -66,155 +66,6 @@ public interface UsersPackage extends EPackage { */ UsersPackage eINSTANCE = org.eclipse.passage.lic.users.model.impl.UsersPackageImpl.init(); - /** - * The meta object id for the '{@link org.eclipse.passage.lic.users.UserOriginDescriptor User Origin Descriptor}' class. - * - * - * @see org.eclipse.passage.lic.users.UserOriginDescriptor - * @see org.eclipse.passage.lic.users.model.impl.UsersPackageImpl#getUserOriginDescriptor() - * @generated - */ - int USER_ORIGIN_DESCRIPTOR = 4; - - /** - * The meta object id for the '{@link org.eclipse.passage.lic.users.ContactDescriptor Contact Descriptor}' class. - * - * - * @see org.eclipse.passage.lic.users.ContactDescriptor - * @see org.eclipse.passage.lic.users.model.impl.UsersPackageImpl#getContactDescriptor() - * @since 2.0 - * @generated - */ - int CONTACT_DESCRIPTOR = 0; - - /** - * The number of structural features of the 'Contact Descriptor' class. - * - * - * @since 2.0 - * @generated - * @ordered - */ - int CONTACT_DESCRIPTOR_FEATURE_COUNT = 0; - - /** - * The number of operations of the 'Contact Descriptor' class. - * - * - * @since 2.0 - * @generated - * @ordered - */ - int CONTACT_DESCRIPTOR_OPERATION_COUNT = 0; - - /** - * The meta object id for the '{@link org.eclipse.passage.lic.users.LicenseOwnerDescriptor License Owner Descriptor}' class. - * - * - * @see org.eclipse.passage.lic.users.LicenseOwnerDescriptor - * @see org.eclipse.passage.lic.users.model.impl.UsersPackageImpl#getLicenseOwnerDescriptor() - * @since 2.0 - * @generated - */ - int LICENSE_OWNER_DESCRIPTOR = 1; - - /** - * The number of structural features of the 'License Owner Descriptor' class. - * - * - * @since 2.0 - * @generated - * @ordered - */ - int LICENSE_OWNER_DESCRIPTOR_FEATURE_COUNT = 0; - - /** - * The number of operations of the 'License Owner Descriptor' class. - * - * - * @since 2.0 - * @generated - * @ordered - */ - int LICENSE_OWNER_DESCRIPTOR_OPERATION_COUNT = 0; - - /** - * The meta object id for the '{@link org.eclipse.passage.lic.users.UserDescriptor User Descriptor}' class. - * - * - * @see org.eclipse.passage.lic.users.UserDescriptor - * @see org.eclipse.passage.lic.users.model.impl.UsersPackageImpl#getUserDescriptor() - * @generated - */ - int USER_DESCRIPTOR = 2; - - /** - * The number of structural features of the 'User Descriptor' class. - * - * - * @generated - * @ordered - */ - int USER_DESCRIPTOR_FEATURE_COUNT = 0; - - /** - * The number of operations of the 'User Descriptor' class. - * - * - * @generated - * @ordered - */ - int USER_DESCRIPTOR_OPERATION_COUNT = 0; - - /** - * The meta object id for the '{@link org.eclipse.passage.lic.users.UserGroupDescriptor User Group Descriptor}' class. - * - * - * @see org.eclipse.passage.lic.users.UserGroupDescriptor - * @see org.eclipse.passage.lic.users.model.impl.UsersPackageImpl#getUserGroupDescriptor() - * @since 2.0 - * @generated - */ - int USER_GROUP_DESCRIPTOR = 3; - - /** - * The number of structural features of the 'User Group Descriptor' class. - * - * - * @since 2.0 - * @generated - * @ordered - */ - int USER_GROUP_DESCRIPTOR_FEATURE_COUNT = 0; - - /** - * The number of operations of the 'User Group Descriptor' class. - * - * - * @since 2.0 - * @generated - * @ordered - */ - int USER_GROUP_DESCRIPTOR_OPERATION_COUNT = 0; - - /** - * The number of structural features of the 'User Origin Descriptor' class. - * - * - * @generated - * @ordered - */ - int USER_ORIGIN_DESCRIPTOR_FEATURE_COUNT = 0; - - /** - * The number of operations of the 'User Origin Descriptor' class. - * - * - * @generated - * @ordered - */ - int USER_ORIGIN_DESCRIPTOR_OPERATION_COUNT = 0; - /** * The meta object id for the '{@link org.eclipse.passage.lic.users.model.impl.UserOriginImpl User Origin}' class. * @@ -223,7 +74,7 @@ public interface UsersPackage extends EPackage { * @see org.eclipse.passage.lic.users.model.impl.UsersPackageImpl#getUserOrigin() * @generated */ - int USER_ORIGIN = 9; + int USER_ORIGIN = 4; /** * The meta object id for the '{@link org.eclipse.passage.lic.users.model.impl.UserImpl User}' class. @@ -233,7 +84,7 @@ public interface UsersPackage extends EPackage { * @see org.eclipse.passage.lic.users.model.impl.UsersPackageImpl#getUser() * @generated */ - int USER = 7; + int USER = 2; /** * The meta object id for the '{@link org.eclipse.passage.lic.users.model.impl.UserGroupImpl User Group}' class. @@ -244,7 +95,7 @@ public interface UsersPackage extends EPackage { * @since 2.0 * @generated */ - int USER_GROUP = 8; + int USER_GROUP = 3; /** * The meta object id for the '{@link org.eclipse.passage.lic.users.model.impl.ContactImpl Contact}' class. @@ -255,7 +106,7 @@ public interface UsersPackage extends EPackage { * @since 2.0 * @generated */ - int CONTACT = 5; + int CONTACT = 0; /** * The feature id for the 'Name' attribute. @@ -265,7 +116,7 @@ public interface UsersPackage extends EPackage { * @generated * @ordered */ - int CONTACT__NAME = CONTACT_DESCRIPTOR_FEATURE_COUNT + 0; + int CONTACT__NAME = 0; /** * The feature id for the 'Title' attribute. @@ -275,7 +126,7 @@ public interface UsersPackage extends EPackage { * @generated * @ordered */ - int CONTACT__TITLE = CONTACT_DESCRIPTOR_FEATURE_COUNT + 1; + int CONTACT__TITLE = 1; /** * The feature id for the 'Position' attribute. @@ -285,7 +136,7 @@ public interface UsersPackage extends EPackage { * @generated * @ordered */ - int CONTACT__POSITION = CONTACT_DESCRIPTOR_FEATURE_COUNT + 2; + int CONTACT__POSITION = 2; /** * The feature id for the 'Email' attribute. @@ -295,7 +146,7 @@ public interface UsersPackage extends EPackage { * @generated * @ordered */ - int CONTACT__EMAIL = CONTACT_DESCRIPTOR_FEATURE_COUNT + 3; + int CONTACT__EMAIL = 3; /** * The feature id for the 'Address' attribute. @@ -305,7 +156,7 @@ public interface UsersPackage extends EPackage { * @generated * @ordered */ - int CONTACT__ADDRESS = CONTACT_DESCRIPTOR_FEATURE_COUNT + 4; + int CONTACT__ADDRESS = 4; /** * The number of structural features of the 'Contact' class. @@ -315,7 +166,7 @@ public interface UsersPackage extends EPackage { * @generated * @ordered */ - int CONTACT_FEATURE_COUNT = CONTACT_DESCRIPTOR_FEATURE_COUNT + 5; + int CONTACT_FEATURE_COUNT = 5; /** * The number of operations of the 'Contact' class. @@ -325,7 +176,7 @@ public interface UsersPackage extends EPackage { * @generated * @ordered */ - int CONTACT_OPERATION_COUNT = CONTACT_DESCRIPTOR_OPERATION_COUNT + 0; + int CONTACT_OPERATION_COUNT = 0; /** * The meta object id for the '{@link org.eclipse.passage.lic.users.model.api.LicenseOwner License Owner}' class. @@ -336,7 +187,7 @@ public interface UsersPackage extends EPackage { * @since 2.0 * @generated */ - int LICENSE_OWNER = 6; + int LICENSE_OWNER = 1; /** * The feature id for the 'Identifier' attribute. @@ -346,7 +197,7 @@ public interface UsersPackage extends EPackage { * @generated * @ordered */ - int LICENSE_OWNER__IDENTIFIER = LICENSE_OWNER_DESCRIPTOR_FEATURE_COUNT + 0; + int LICENSE_OWNER__IDENTIFIER = 0; /** * The feature id for the 'Name' attribute. @@ -356,7 +207,7 @@ public interface UsersPackage extends EPackage { * @generated * @ordered */ - int LICENSE_OWNER__NAME = LICENSE_OWNER_DESCRIPTOR_FEATURE_COUNT + 1; + int LICENSE_OWNER__NAME = 1; /** * The feature id for the 'Description' attribute. @@ -366,7 +217,7 @@ public interface UsersPackage extends EPackage { * @generated * @ordered */ - int LICENSE_OWNER__DESCRIPTION = LICENSE_OWNER_DESCRIPTOR_FEATURE_COUNT + 2; + int LICENSE_OWNER__DESCRIPTION = 2; /** * The feature id for the 'Contact' containment reference. @@ -376,7 +227,7 @@ public interface UsersPackage extends EPackage { * @generated * @ordered */ - int LICENSE_OWNER__CONTACT = LICENSE_OWNER_DESCRIPTOR_FEATURE_COUNT + 3; + int LICENSE_OWNER__CONTACT = 3; /** * The number of structural features of the 'License Owner' class. @@ -386,7 +237,7 @@ public interface UsersPackage extends EPackage { * @generated * @ordered */ - int LICENSE_OWNER_FEATURE_COUNT = LICENSE_OWNER_DESCRIPTOR_FEATURE_COUNT + 4; + int LICENSE_OWNER_FEATURE_COUNT = 4; /** * The number of operations of the 'License Owner' class. @@ -396,7 +247,7 @@ public interface UsersPackage extends EPackage { * @generated * @ordered */ - int LICENSE_OWNER_OPERATION_COUNT = LICENSE_OWNER_DESCRIPTOR_OPERATION_COUNT + 0; + int LICENSE_OWNER_OPERATION_COUNT = 0; /** * The feature id for the 'Identifier' attribute. @@ -406,7 +257,7 @@ public interface UsersPackage extends EPackage { * @generated * @ordered */ - int USER__IDENTIFIER = USER_DESCRIPTOR_FEATURE_COUNT + 0; + int USER__IDENTIFIER = LICENSE_OWNER__IDENTIFIER; /** * The feature id for the 'Name' attribute. @@ -416,7 +267,7 @@ public interface UsersPackage extends EPackage { * @generated * @ordered */ - int USER__NAME = USER_DESCRIPTOR_FEATURE_COUNT + 1; + int USER__NAME = LICENSE_OWNER__NAME; /** * The feature id for the 'Description' attribute. @@ -426,7 +277,7 @@ public interface UsersPackage extends EPackage { * @generated * @ordered */ - int USER__DESCRIPTION = USER_DESCRIPTOR_FEATURE_COUNT + 2; + int USER__DESCRIPTION = LICENSE_OWNER__DESCRIPTION; /** * The feature id for the 'Contact' containment reference. @@ -436,7 +287,7 @@ public interface UsersPackage extends EPackage { * @generated * @ordered */ - int USER__CONTACT = USER_DESCRIPTOR_FEATURE_COUNT + 3; + int USER__CONTACT = LICENSE_OWNER__CONTACT; /** * The feature id for the 'Preferred Evaluation Type' attribute. @@ -446,7 +297,7 @@ public interface UsersPackage extends EPackage { * @generated * @ordered */ - int USER__PREFERRED_EVALUATION_TYPE = USER_DESCRIPTOR_FEATURE_COUNT + 4; + int USER__PREFERRED_EVALUATION_TYPE = LICENSE_OWNER_FEATURE_COUNT + 0; /** * The feature id for the 'Preferred Evaluation Expression' attribute. @@ -456,7 +307,7 @@ public interface UsersPackage extends EPackage { * @generated * @ordered */ - int USER__PREFERRED_EVALUATION_EXPRESSION = USER_DESCRIPTOR_FEATURE_COUNT + 5; + int USER__PREFERRED_EVALUATION_EXPRESSION = LICENSE_OWNER_FEATURE_COUNT + 1; /** * The feature id for the 'Origin' container reference. @@ -466,7 +317,7 @@ public interface UsersPackage extends EPackage { * @generated * @ordered */ - int USER__ORIGIN = USER_DESCRIPTOR_FEATURE_COUNT + 6; + int USER__ORIGIN = LICENSE_OWNER_FEATURE_COUNT + 2; /** * The number of structural features of the 'User' class. @@ -475,7 +326,7 @@ public interface UsersPackage extends EPackage { * @generated * @ordered */ - int USER_FEATURE_COUNT = USER_DESCRIPTOR_FEATURE_COUNT + 7; + int USER_FEATURE_COUNT = LICENSE_OWNER_FEATURE_COUNT + 3; /** * The number of operations of the 'User' class. @@ -484,7 +335,7 @@ public interface UsersPackage extends EPackage { * @generated * @ordered */ - int USER_OPERATION_COUNT = USER_DESCRIPTOR_OPERATION_COUNT + 0; + int USER_OPERATION_COUNT = LICENSE_OWNER_OPERATION_COUNT + 0; /** * The feature id for the 'Identifier' attribute. @@ -494,7 +345,7 @@ public interface UsersPackage extends EPackage { * @generated * @ordered */ - int USER_GROUP__IDENTIFIER = USER_GROUP_DESCRIPTOR_FEATURE_COUNT + 0; + int USER_GROUP__IDENTIFIER = LICENSE_OWNER__IDENTIFIER; /** * The feature id for the 'Name' attribute. @@ -504,7 +355,7 @@ public interface UsersPackage extends EPackage { * @generated * @ordered */ - int USER_GROUP__NAME = USER_GROUP_DESCRIPTOR_FEATURE_COUNT + 1; + int USER_GROUP__NAME = LICENSE_OWNER__NAME; /** * The feature id for the 'Description' attribute. @@ -514,7 +365,7 @@ public interface UsersPackage extends EPackage { * @generated * @ordered */ - int USER_GROUP__DESCRIPTION = USER_GROUP_DESCRIPTOR_FEATURE_COUNT + 2; + int USER_GROUP__DESCRIPTION = LICENSE_OWNER__DESCRIPTION; /** * The feature id for the 'Contact' containment reference. @@ -524,7 +375,7 @@ public interface UsersPackage extends EPackage { * @generated * @ordered */ - int USER_GROUP__CONTACT = USER_GROUP_DESCRIPTOR_FEATURE_COUNT + 3; + int USER_GROUP__CONTACT = LICENSE_OWNER__CONTACT; /** * The feature id for the 'Users' reference list. @@ -534,7 +385,7 @@ public interface UsersPackage extends EPackage { * @generated * @ordered */ - int USER_GROUP__USERS = USER_GROUP_DESCRIPTOR_FEATURE_COUNT + 4; + int USER_GROUP__USERS = LICENSE_OWNER_FEATURE_COUNT + 0; /** * The feature id for the 'Origin' container reference. @@ -544,7 +395,7 @@ public interface UsersPackage extends EPackage { * @generated * @ordered */ - int USER_GROUP__ORIGIN = USER_GROUP_DESCRIPTOR_FEATURE_COUNT + 5; + int USER_GROUP__ORIGIN = LICENSE_OWNER_FEATURE_COUNT + 1; /** * The number of structural features of the 'User Group' class. @@ -554,7 +405,7 @@ public interface UsersPackage extends EPackage { * @generated * @ordered */ - int USER_GROUP_FEATURE_COUNT = USER_GROUP_DESCRIPTOR_FEATURE_COUNT + 6; + int USER_GROUP_FEATURE_COUNT = LICENSE_OWNER_FEATURE_COUNT + 2; /** * The number of operations of the 'User Group' class. @@ -564,7 +415,7 @@ public interface UsersPackage extends EPackage { * @generated * @ordered */ - int USER_GROUP_OPERATION_COUNT = USER_GROUP_DESCRIPTOR_OPERATION_COUNT + 0; + int USER_GROUP_OPERATION_COUNT = LICENSE_OWNER_OPERATION_COUNT + 0; /** * The feature id for the 'Identifier' attribute. @@ -573,7 +424,7 @@ public interface UsersPackage extends EPackage { * @generated * @ordered */ - int USER_ORIGIN__IDENTIFIER = USER_ORIGIN_DESCRIPTOR_FEATURE_COUNT + 0; + int USER_ORIGIN__IDENTIFIER = 0; /** * The feature id for the 'Name' attribute. @@ -582,7 +433,7 @@ public interface UsersPackage extends EPackage { * @generated * @ordered */ - int USER_ORIGIN__NAME = USER_ORIGIN_DESCRIPTOR_FEATURE_COUNT + 1; + int USER_ORIGIN__NAME = 1; /** * The feature id for the 'Description' attribute. @@ -591,7 +442,7 @@ public interface UsersPackage extends EPackage { * @generated * @ordered */ - int USER_ORIGIN__DESCRIPTION = USER_ORIGIN_DESCRIPTOR_FEATURE_COUNT + 2; + int USER_ORIGIN__DESCRIPTION = 2; /** * The feature id for the 'Users' containment reference list. @@ -600,7 +451,7 @@ public interface UsersPackage extends EPackage { * @generated * @ordered */ - int USER_ORIGIN__USERS = USER_ORIGIN_DESCRIPTOR_FEATURE_COUNT + 3; + int USER_ORIGIN__USERS = 3; /** * The feature id for the 'Groups' containment reference list. @@ -610,7 +461,7 @@ public interface UsersPackage extends EPackage { * @generated * @ordered */ - int USER_ORIGIN__GROUPS = USER_ORIGIN_DESCRIPTOR_FEATURE_COUNT + 4; + int USER_ORIGIN__GROUPS = 4; /** * The number of structural features of the 'User Origin' class. @@ -619,7 +470,7 @@ public interface UsersPackage extends EPackage { * @generated * @ordered */ - int USER_ORIGIN_FEATURE_COUNT = USER_ORIGIN_DESCRIPTOR_FEATURE_COUNT + 5; + int USER_ORIGIN_FEATURE_COUNT = 5; /** * The number of operations of the 'User Origin' class. @@ -628,65 +479,7 @@ public interface UsersPackage extends EPackage { * @generated * @ordered */ - int USER_ORIGIN_OPERATION_COUNT = USER_ORIGIN_DESCRIPTOR_OPERATION_COUNT + 0; - - /** - * Returns the meta object for class '{@link org.eclipse.passage.lic.users.UserOriginDescriptor User Origin Descriptor}'. - * - * - * @return the meta object for class 'User Origin Descriptor'. - * @see org.eclipse.passage.lic.users.UserOriginDescriptor - * @model instanceClass="org.eclipse.passage.lic.users.UserOriginDescriptor" - * @generated - */ - EClass getUserOriginDescriptor(); - - /** - * Returns the meta object for class '{@link org.eclipse.passage.lic.users.ContactDescriptor Contact Descriptor}'. - * - * - * @return the meta object for class 'Contact Descriptor'. - * @see org.eclipse.passage.lic.users.ContactDescriptor - * @model instanceClass="org.eclipse.passage.lic.users.ContactDescriptor" - * @since 2.0 - * @generated - */ - EClass getContactDescriptor(); - - /** - * Returns the meta object for class '{@link org.eclipse.passage.lic.users.LicenseOwnerDescriptor License Owner Descriptor}'. - * - * - * @return the meta object for class 'License Owner Descriptor'. - * @see org.eclipse.passage.lic.users.LicenseOwnerDescriptor - * @model instanceClass="org.eclipse.passage.lic.users.LicenseOwnerDescriptor" - * @since 2.0 - * @generated - */ - EClass getLicenseOwnerDescriptor(); - - /** - * Returns the meta object for class '{@link org.eclipse.passage.lic.users.UserDescriptor User Descriptor}'. - * - * - * @return the meta object for class 'User Descriptor'. - * @see org.eclipse.passage.lic.users.UserDescriptor - * @model instanceClass="org.eclipse.passage.lic.users.UserDescriptor" - * @generated - */ - EClass getUserDescriptor(); - - /** - * Returns the meta object for class '{@link org.eclipse.passage.lic.users.UserGroupDescriptor User Group Descriptor}'. - * - * - * @return the meta object for class 'User Group Descriptor'. - * @see org.eclipse.passage.lic.users.UserGroupDescriptor - * @model instanceClass="org.eclipse.passage.lic.users.UserGroupDescriptor" - * @since 2.0 - * @generated - */ - EClass getUserGroupDescriptor(); + int USER_ORIGIN_OPERATION_COUNT = 0; /** * Returns the meta object for class '{@link org.eclipse.passage.lic.users.model.api.UserOrigin User Origin}'. @@ -974,4 +767,4 @@ public interface UsersPackage extends EPackage { */ UsersFactory getUsersFactory(); -} //UsersPackage +} // UsersPackage diff --git a/bundles/org.eclipse.passage.lic.users.model/src-gen/org/eclipse/passage/lic/users/model/util/UsersAdapterFactory.java b/bundles/org.eclipse.passage.lic.users.model/src-gen/org/eclipse/passage/lic/users/model/util/UsersAdapterFactory.java index 1d175223c..5bb36f9c7 100644 --- a/bundles/org.eclipse.passage.lic.users.model/src-gen/org/eclipse/passage/lic/users/model/util/UsersAdapterFactory.java +++ b/bundles/org.eclipse.passage.lic.users.model/src-gen/org/eclipse/passage/lic/users/model/util/UsersAdapterFactory.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2018, 2021 ArSysOp + * Copyright (c) 2018, 2024 ArSysOp * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at @@ -14,19 +14,13 @@ import org.eclipse.emf.common.notify.Adapter; import org.eclipse.emf.common.notify.Notifier; - import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl; - import org.eclipse.emf.ecore.EObject; - -import org.eclipse.passage.lic.users.ContactDescriptor; -import org.eclipse.passage.lic.users.LicenseOwnerDescriptor; -import org.eclipse.passage.lic.users.UserDescriptor; -import org.eclipse.passage.lic.users.UserGroupDescriptor; -import org.eclipse.passage.lic.users.UserOriginDescriptor; - -import org.eclipse.passage.lic.users.model.api.*; - +import org.eclipse.passage.lic.users.model.api.Contact; +import org.eclipse.passage.lic.users.model.api.LicenseOwner; +import org.eclipse.passage.lic.users.model.api.User; +import org.eclipse.passage.lic.users.model.api.UserGroup; +import org.eclipse.passage.lic.users.model.api.UserOrigin; import org.eclipse.passage.lic.users.model.meta.UsersPackage; /** @@ -84,31 +78,6 @@ public boolean isFactoryForType(Object object) { * @generated */ protected UsersSwitch modelSwitch = new UsersSwitch() { - @Override - public Adapter caseContactDescriptor(ContactDescriptor object) { - return createContactDescriptorAdapter(); - } - - @Override - public Adapter caseLicenseOwnerDescriptor(LicenseOwnerDescriptor object) { - return createLicenseOwnerDescriptorAdapter(); - } - - @Override - public Adapter caseUserDescriptor(UserDescriptor object) { - return createUserDescriptorAdapter(); - } - - @Override - public Adapter caseUserGroupDescriptor(UserGroupDescriptor object) { - return createUserGroupDescriptorAdapter(); - } - - @Override - public Adapter caseUserOriginDescriptor(UserOriginDescriptor object) { - return createUserOriginDescriptorAdapter(); - } - @Override public Adapter caseContact(Contact object) { return createContactAdapter(); @@ -153,79 +122,6 @@ public Adapter createAdapter(Notifier target) { return modelSwitch.doSwitch((EObject) target); } - /** - * Creates a new adapter for an object of class '{@link org.eclipse.passage.lic.users.UserOriginDescriptor User Origin 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.users.UserOriginDescriptor - * @generated - */ - public Adapter createUserOriginDescriptorAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.passage.lic.users.ContactDescriptor Contact 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.users.ContactDescriptor - * @since 2.0 - * @generated - */ - public Adapter createContactDescriptorAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.passage.lic.users.LicenseOwnerDescriptor License Owner 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.users.LicenseOwnerDescriptor - * @since 2.0 - * @generated - */ - public Adapter createLicenseOwnerDescriptorAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.passage.lic.users.UserDescriptor User 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.users.UserDescriptor - * @generated - */ - public Adapter createUserDescriptorAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.passage.lic.users.UserGroupDescriptor User Group 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.users.UserGroupDescriptor - * @since 2.0 - * @generated - */ - public Adapter createUserGroupDescriptorAdapter() { - return null; - } - /** * Creates a new adapter for an object of class '{@link org.eclipse.passage.lic.users.model.api.UserOrigin User Origin}'. * @@ -311,4 +207,4 @@ public Adapter createEObjectAdapter() { return null; } -} //UsersAdapterFactory +} // UsersAdapterFactory diff --git a/bundles/org.eclipse.passage.lic.users.model/src-gen/org/eclipse/passage/lic/users/model/util/UsersResourceFactoryImpl.java b/bundles/org.eclipse.passage.lic.users.model/src-gen/org/eclipse/passage/lic/users/model/util/UsersResourceFactoryImpl.java index 83ac6227d..607485964 100644 --- a/bundles/org.eclipse.passage.lic.users.model/src-gen/org/eclipse/passage/lic/users/model/util/UsersResourceFactoryImpl.java +++ b/bundles/org.eclipse.passage.lic.users.model/src-gen/org/eclipse/passage/lic/users/model/util/UsersResourceFactoryImpl.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2018, 2021 ArSysOp + * Copyright (c) 2018, 2024 ArSysOp * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at @@ -47,4 +47,4 @@ public Resource createResource(URI uri) { return result; } -} //UsersResourceFactoryImpl +} // UsersResourceFactoryImpl diff --git a/bundles/org.eclipse.passage.lic.users.model/src-gen/org/eclipse/passage/lic/users/model/util/UsersResourceImpl.java b/bundles/org.eclipse.passage.lic.users.model/src-gen/org/eclipse/passage/lic/users/model/util/UsersResourceImpl.java index c5dd586f6..744ed53fc 100644 --- a/bundles/org.eclipse.passage.lic.users.model/src-gen/org/eclipse/passage/lic/users/model/util/UsersResourceImpl.java +++ b/bundles/org.eclipse.passage.lic.users.model/src-gen/org/eclipse/passage/lic/users/model/util/UsersResourceImpl.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2018, 2021 ArSysOp + * Copyright (c) 2018, 2024 ArSysOp * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at @@ -59,4 +59,4 @@ protected void init() { options.put(OPTION_RESOURCE_HANDLER, new UsersResourceHandler()); } -} //UsersResourceImpl +} // UsersResourceImpl diff --git a/bundles/org.eclipse.passage.lic.users.model/src-gen/org/eclipse/passage/lic/users/model/util/UsersSwitch.java b/bundles/org.eclipse.passage.lic.users.model/src-gen/org/eclipse/passage/lic/users/model/util/UsersSwitch.java index 94e4244d4..c5818e728 100644 --- a/bundles/org.eclipse.passage.lic.users.model/src-gen/org/eclipse/passage/lic/users/model/util/UsersSwitch.java +++ b/bundles/org.eclipse.passage.lic.users.model/src-gen/org/eclipse/passage/lic/users/model/util/UsersSwitch.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2018, 2021 ArSysOp + * Copyright (c) 2018, 2024 ArSysOp * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at @@ -14,17 +14,12 @@ import org.eclipse.emf.ecore.EObject; import org.eclipse.emf.ecore.EPackage; - import org.eclipse.emf.ecore.util.Switch; - -import org.eclipse.passage.lic.users.ContactDescriptor; -import org.eclipse.passage.lic.users.LicenseOwnerDescriptor; -import org.eclipse.passage.lic.users.UserDescriptor; -import org.eclipse.passage.lic.users.UserGroupDescriptor; -import org.eclipse.passage.lic.users.UserOriginDescriptor; - -import org.eclipse.passage.lic.users.model.api.*; - +import org.eclipse.passage.lic.users.model.api.Contact; +import org.eclipse.passage.lic.users.model.api.LicenseOwner; +import org.eclipse.passage.lic.users.model.api.User; +import org.eclipse.passage.lic.users.model.api.UserGroup; +import org.eclipse.passage.lic.users.model.api.UserOrigin; import org.eclipse.passage.lic.users.model.meta.UsersPackage; /** @@ -84,46 +79,9 @@ protected boolean isSwitchFor(EPackage ePackage) { @Override protected T doSwitch(int classifierID, EObject theEObject) { switch (classifierID) { - case UsersPackage.CONTACT_DESCRIPTOR: { - ContactDescriptor contactDescriptor = (ContactDescriptor) theEObject; - T result = caseContactDescriptor(contactDescriptor); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case UsersPackage.LICENSE_OWNER_DESCRIPTOR: { - LicenseOwnerDescriptor licenseOwnerDescriptor = (LicenseOwnerDescriptor) theEObject; - T result = caseLicenseOwnerDescriptor(licenseOwnerDescriptor); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case UsersPackage.USER_DESCRIPTOR: { - UserDescriptor userDescriptor = (UserDescriptor) theEObject; - T result = caseUserDescriptor(userDescriptor); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case UsersPackage.USER_GROUP_DESCRIPTOR: { - UserGroupDescriptor userGroupDescriptor = (UserGroupDescriptor) theEObject; - T result = caseUserGroupDescriptor(userGroupDescriptor); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case UsersPackage.USER_ORIGIN_DESCRIPTOR: { - UserOriginDescriptor userOriginDescriptor = (UserOriginDescriptor) theEObject; - T result = caseUserOriginDescriptor(userOriginDescriptor); - if (result == null) - result = defaultCase(theEObject); - return result; - } case UsersPackage.CONTACT: { Contact contact = (Contact) theEObject; T result = caseContact(contact); - if (result == null) - result = caseContactDescriptor(contact); if (result == null) result = defaultCase(theEObject); return result; @@ -131,8 +89,6 @@ protected T doSwitch(int classifierID, EObject theEObject) { case UsersPackage.LICENSE_OWNER: { LicenseOwner licenseOwner = (LicenseOwner) theEObject; T result = caseLicenseOwner(licenseOwner); - if (result == null) - result = caseLicenseOwnerDescriptor(licenseOwner); if (result == null) result = defaultCase(theEObject); return result; @@ -140,12 +96,8 @@ protected T doSwitch(int classifierID, EObject theEObject) { case UsersPackage.USER: { User user = (User) theEObject; T result = caseUser(user); - if (result == null) - result = caseUserDescriptor(user); if (result == null) result = caseLicenseOwner(user); - if (result == null) - result = caseLicenseOwnerDescriptor(user); if (result == null) result = defaultCase(theEObject); return result; @@ -153,12 +105,8 @@ protected T doSwitch(int classifierID, EObject theEObject) { case UsersPackage.USER_GROUP: { UserGroup userGroup = (UserGroup) theEObject; T result = caseUserGroup(userGroup); - if (result == null) - result = caseUserGroupDescriptor(userGroup); if (result == null) result = caseLicenseOwner(userGroup); - if (result == null) - result = caseLicenseOwnerDescriptor(userGroup); if (result == null) result = defaultCase(theEObject); return result; @@ -166,8 +114,6 @@ protected T doSwitch(int classifierID, EObject theEObject) { case UsersPackage.USER_ORIGIN: { UserOrigin userOrigin = (UserOrigin) theEObject; T result = caseUserOrigin(userOrigin); - if (result == null) - result = caseUserOriginDescriptor(userOrigin); if (result == null) result = defaultCase(theEObject); return result; @@ -177,84 +123,6 @@ protected T doSwitch(int classifierID, EObject theEObject) { } } - /** - * Returns the result of interpreting the object as an instance of 'User Origin 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 'User Origin Descriptor'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseUserOriginDescriptor(UserOriginDescriptor object) { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of 'Contact 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 'Contact Descriptor'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @since 2.0 - * @generated - */ - public T caseContactDescriptor(ContactDescriptor object) { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of 'License Owner 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 Owner Descriptor'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @since 2.0 - * @generated - */ - public T caseLicenseOwnerDescriptor(LicenseOwnerDescriptor object) { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of 'User 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 'User Descriptor'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseUserDescriptor(UserDescriptor object) { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of 'User Group 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 'User Group Descriptor'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @since 2.0 - * @generated - */ - public T caseUserGroupDescriptor(UserGroupDescriptor object) { - return null; - } - /** * Returns the result of interpreting the object as an instance of 'User Origin'. * @@ -349,4 +217,4 @@ public T defaultCase(EObject object) { return null; } -} //UsersSwitch +} // UsersSwitch diff --git a/bundles/org.eclipse.passage.lic.users.model/src/org/eclipse/passage/lic/internal/users/model/UsersClassMetadata.java b/bundles/org.eclipse.passage.lic.users.model/src/org/eclipse/passage/lic/internal/users/model/UsersClassMetadata.java index c681d40ee..4f362febf 100644 --- a/bundles/org.eclipse.passage.lic.users.model/src/org/eclipse/passage/lic/internal/users/model/UsersClassMetadata.java +++ b/bundles/org.eclipse.passage.lic.users.model/src/org/eclipse/passage/lic/internal/users/model/UsersClassMetadata.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2020 ArSysOp + * Copyright (c) 2020, 2024 ArSysOp * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at @@ -19,8 +19,6 @@ import org.eclipse.passage.lic.emf.meta.ClassMetadata; import org.eclipse.passage.lic.emf.meta.EntityMetadata; import org.eclipse.passage.lic.emf.meta.PlainEntityMetadata; -import org.eclipse.passage.lic.users.UserDescriptor; -import org.eclipse.passage.lic.users.UserOriginDescriptor; import org.eclipse.passage.lic.users.model.api.User; import org.eclipse.passage.lic.users.model.api.UserOrigin; import org.eclipse.passage.lic.users.model.meta.UsersPackage; @@ -33,18 +31,16 @@ public final class UsersClassMetadata implements ClassMetadata { public UsersClassMetadata() { meta = UsersPackage.eINSTANCE; map = new HashMap, EntityMetadata>(); - map.put(UserOriginDescriptor.class, // + map.put(UserOrigin.class, // new PlainEntityMetadata(// meta.getUserOrigin(), // meta.getUserOrigin_Identifier(), // meta.getUserOrigin_Name())); - map.put(UserOrigin.class, map.get(UserOriginDescriptor.class)); - map.put(UserDescriptor.class, // + map.put(User.class, // new PlainEntityMetadata(// meta.getUser(), // meta.getLicenseOwner_Identifier(), // meta.getLicenseOwner_Name())); - map.put(User.class, map.get(UserDescriptor.class)); } @Override 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 dc93cb30e..f2ffc599d 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 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2021 ArSysOp + * Copyright (c) 2021, 2024 ArSysOp * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at @@ -12,6 +12,7 @@ *******************************************************************************/ package org.eclipse.passage.lic.internal.users.model.migration; +import org.eclipse.emf.ecore.EPackage; import org.eclipse.emf.ecore.xmi.XMLResource; import org.eclipse.passage.lic.emf.migration.DelegateClassifiers; import org.eclipse.passage.lic.emf.migration.EClassRoutes; @@ -34,13 +35,14 @@ protected void register() { migrate050(); migrate100(); migrate110(); + migrate200(); } @Override protected void complete(XMLResource resource) { resource.getContents().stream()// - .filter(UserOrigin.class::isInstance)// - .map(UserOrigin.class::cast) // + .filter(UserOrigin.class::isInstance)// + .map(UserOrigin.class::cast) // .forEach(this::complete); } @@ -84,6 +86,12 @@ private void migrate110() { new DelegateClassifiers(uri).delegate(classRoutes200()); } + private void migrate200() { + String uri = "http://www.eclipse.org/passage/lic/users/2.0.0"; //$NON-NLS-1$ + UsersPackage delegate = UsersPackage.eINSTANCE; + EPackage.Registry.INSTANCE.computeIfAbsent(uri, ns -> delegate); + } + private EClassRoutes classRoutes200() { UsersPackage delegate = UsersPackage.eINSTANCE; EClassRoutes.Smart routes = new EClassRoutes.Smart(new SimpleClassRoutes()); @@ -98,10 +106,10 @@ private void complete(UserOrigin origin) { private void complete(User user) { Contact contact = new EnsureLicenseOwnerContact().apply(user); - if(user.getIdentifier() == null) { + if (user.getIdentifier() == null) { user.setIdentifier(contact.getEmail()); } - if(user.getName() == null) { + if (user.getName() == null) { user.setName(contact.getName()); } } diff --git a/bundles/org.eclipse.passage.lic.users/.classpath b/bundles/org.eclipse.passage.lic.users/.classpath deleted file mode 100644 index 81fe078c2..000000000 --- a/bundles/org.eclipse.passage.lic.users/.classpath +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/bundles/org.eclipse.passage.lic.users/.project b/bundles/org.eclipse.passage.lic.users/.project index c8bfe1891..fe61f83b3 100644 --- a/bundles/org.eclipse.passage.lic.users/.project +++ b/bundles/org.eclipse.passage.lic.users/.project @@ -5,11 +5,6 @@ - - org.eclipse.jdt.core.javabuilder - - - org.eclipse.pde.ManifestBuilder @@ -28,7 +23,6 @@ org.eclipse.pde.PluginNature - org.eclipse.jdt.core.javanature org.eclipse.pde.api.tools.apiAnalysisNature diff --git a/bundles/org.eclipse.passage.lic.users/META-INF/MANIFEST.MF b/bundles/org.eclipse.passage.lic.users/META-INF/MANIFEST.MF index ab1ee6527..6b9aa3013 100644 --- a/bundles/org.eclipse.passage.lic.users/META-INF/MANIFEST.MF +++ b/bundles/org.eclipse.passage.lic.users/META-INF/MANIFEST.MF @@ -8,4 +8,3 @@ Bundle-Vendor: %Bundle-Vendor Bundle-Copyright: %Bundle-Copyright Bundle-RequiredExecutionEnvironment: JavaSE-17 Require-Bundle: org.eclipse.passage.lic.api;bundle-version="0.0.0";visibility:=reexport -Export-Package: org.eclipse.passage.lic.users diff --git a/bundles/org.eclipse.passage.lic.users/build.properties b/bundles/org.eclipse.passage.lic.users/build.properties index 31247d8d1..40677a74b 100644 --- a/bundles/org.eclipse.passage.lic.users/build.properties +++ b/bundles/org.eclipse.passage.lic.users/build.properties @@ -1,5 +1,5 @@ ############################################################################### -# Copyright (c) 2018, 2020 ArSysOp and others +# Copyright (c) 2018, 2024 ArSysOp and others # # This program and the accompanying materials are made available under the # terms of the Eclipse Public License 2.0 which is available at @@ -11,8 +11,6 @@ # ArSysOp - initial API and implementation ############################################################################### -source.. = src/ -output.. = bin/ bin.includes = META-INF/,\ .,\ OSGI-INF/,\ diff --git a/bundles/org.eclipse.passage.lic.users/src/org/eclipse/passage/lic/users/ContactDescriptor.java b/bundles/org.eclipse.passage.lic.users/src/org/eclipse/passage/lic/users/ContactDescriptor.java deleted file mode 100644 index 6dd122575..000000000 --- a/bundles/org.eclipse.passage.lic.users/src/org/eclipse/passage/lic/users/ContactDescriptor.java +++ /dev/null @@ -1,30 +0,0 @@ -/******************************************************************************* - * 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.users; - -/** - * @since 2.0 - */ -public interface ContactDescriptor { - - String getName(); - - String getTitle(); - - String getPosition(); - - String getEmail(); - - String getAddress(); - -} diff --git a/bundles/org.eclipse.passage.lic.users/src/org/eclipse/passage/lic/users/LicenseOwnerDescriptor.java b/bundles/org.eclipse.passage.lic.users/src/org/eclipse/passage/lic/users/LicenseOwnerDescriptor.java deleted file mode 100644 index 9b45024e5..000000000 --- a/bundles/org.eclipse.passage.lic.users/src/org/eclipse/passage/lic/users/LicenseOwnerDescriptor.java +++ /dev/null @@ -1,28 +0,0 @@ -/******************************************************************************* - * 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.users; - -/** - * @since 2.0 - */ -public interface LicenseOwnerDescriptor { - - String getIdentifier(); - - String getName(); - - String getDescription(); - - ContactDescriptor getContact(); - -} diff --git a/bundles/org.eclipse.passage.lic.users/src/org/eclipse/passage/lic/users/UserDescriptor.java b/bundles/org.eclipse.passage.lic.users/src/org/eclipse/passage/lic/users/UserDescriptor.java deleted file mode 100644 index 4672707f1..000000000 --- a/bundles/org.eclipse.passage.lic.users/src/org/eclipse/passage/lic/users/UserDescriptor.java +++ /dev/null @@ -1,51 +0,0 @@ -/******************************************************************************* - * 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.users; - -/** - *

- * A "User" describes the licensee of your functionality. - *

- * - */ -public interface UserDescriptor extends LicenseOwnerDescriptor { - - /** - * Returns the preferred condition type of this user. This is the value of its - * "preferredConditionType" attribute. - * - * @return the preferred condition type - * @since 2.0 - * @see LicenseGrantDescriptor#getConditionType() - */ - String getPreferredEvaluationType(); - - /** - * Returns the preferred condition expression of this user. This is the value of - * its "preferredConditionExpression" attribute. - * - * @return the preferred condition expression - * @since 2.0 - * @see LicenseGrantDescriptor#getConditionExpression() - */ - String getPreferredEvaluationExpression(); - - /** - * Returns the containing origin of this user. - * - * @return the user origin - * @since 2.0 - */ - UserOriginDescriptor getOrigin(); - -} diff --git a/bundles/org.eclipse.passage.lic.users/src/org/eclipse/passage/lic/users/UserGroupDescriptor.java b/bundles/org.eclipse.passage.lic.users/src/org/eclipse/passage/lic/users/UserGroupDescriptor.java deleted file mode 100644 index dc179d75f..000000000 --- a/bundles/org.eclipse.passage.lic.users/src/org/eclipse/passage/lic/users/UserGroupDescriptor.java +++ /dev/null @@ -1,26 +0,0 @@ -/******************************************************************************* - * 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.users; - -import java.util.List; - -/** - * @since 2.0 - */ -public interface UserGroupDescriptor { - - List getUsers(); - - UserOriginDescriptor getOrigin(); - -} diff --git a/bundles/org.eclipse.passage.lic.users/src/org/eclipse/passage/lic/users/UserOriginDescriptor.java b/bundles/org.eclipse.passage.lic.users/src/org/eclipse/passage/lic/users/UserOriginDescriptor.java deleted file mode 100644 index 915030b86..000000000 --- a/bundles/org.eclipse.passage.lic.users/src/org/eclipse/passage/lic/users/UserOriginDescriptor.java +++ /dev/null @@ -1,66 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2018, 2020 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.users; - -import java.util.List; - -/** - *

- * A "User Origin" provides access to "User" - * descriptors. The typical example of the "User Origin" is the - * list of users registered on your web site to download - * "Product Version". - *

- * - */ -public interface UserOriginDescriptor { - - /** - * Returns the identifier of this user origin. This is the value of its - * "identifier" attribute. - * - * @return the identifier - */ - String getIdentifier(); - - /** - * Returns the name of this user origin. This is the value of its - * "name" attribute. - * - * @return the name - */ - String getName(); - - /** - * Returns the description of this user origin. This is the value of its - * "description" attribute. - * - * @return the description - */ - String getDescription(); - - /** - * Returns the "User"(s) contained in this user origin. This is the - * value of its "users" reference. - * - * @return the users - * @since 2.0 - */ - List getUsers(); - - /** - * @since 2.0 - */ - List getGroups(); - -} diff --git a/bundles/org.eclipse.passage.loc.dashboard.ui/src/org/eclipse/passage/loc/dashboard/ui/handlers/DashboardIssueFloatingLicenseHandler.java b/bundles/org.eclipse.passage.loc.dashboard.ui/src/org/eclipse/passage/loc/dashboard/ui/handlers/DashboardIssueFloatingLicenseHandler.java index 2541badc1..728670a6f 100644 --- a/bundles/org.eclipse.passage.loc.dashboard.ui/src/org/eclipse/passage/loc/dashboard/ui/handlers/DashboardIssueFloatingLicenseHandler.java +++ b/bundles/org.eclipse.passage.loc.dashboard.ui/src/org/eclipse/passage/loc/dashboard/ui/handlers/DashboardIssueFloatingLicenseHandler.java @@ -27,7 +27,7 @@ import org.eclipse.passage.lic.licenses.model.api.LicensePlan; import org.eclipse.passage.lic.licenses.model.meta.LicensesPackage; import org.eclipse.passage.lic.products.model.api.ProductVersion; -import org.eclipse.passage.lic.users.UserDescriptor; +import org.eclipse.passage.lic.users.model.api.User; import org.eclipse.passage.loc.dashboard.ui.wizards.floating.FloatingDataPack; import org.eclipse.passage.loc.dashboard.ui.wizards.floating.IssueFloatingLicenseWizard; import org.eclipse.passage.loc.internal.api.OperatorLicenseService; @@ -39,7 +39,7 @@ public final class DashboardIssueFloatingLicenseHandler { @Execute public void execute(IEclipseContext context, @Named(IServiceConstants.ACTIVE_SELECTION) @Optional LicensePlan plan, - @Named(IServiceConstants.ACTIVE_SELECTION) @Optional UserDescriptor user, + @Named(IServiceConstants.ACTIVE_SELECTION) @Optional User user, @Named(IServiceConstants.ACTIVE_SELECTION) @Optional ProductVersion product) { new LicensedRunnableUI(feature, () -> open(context, // new IssueFloatingLicenseWizard(// diff --git a/bundles/org.eclipse.passage.loc.dashboard.ui/src/org/eclipse/passage/loc/dashboard/ui/handlers/DashboardIssueLicenseHandler.java b/bundles/org.eclipse.passage.loc.dashboard.ui/src/org/eclipse/passage/loc/dashboard/ui/handlers/DashboardIssueLicenseHandler.java index 062bae36c..3aee5cc77 100644 --- a/bundles/org.eclipse.passage.loc.dashboard.ui/src/org/eclipse/passage/loc/dashboard/ui/handlers/DashboardIssueLicenseHandler.java +++ b/bundles/org.eclipse.passage.loc.dashboard.ui/src/org/eclipse/passage/loc/dashboard/ui/handlers/DashboardIssueLicenseHandler.java @@ -25,7 +25,7 @@ import org.eclipse.passage.lic.licenses.model.api.LicensePlan; import org.eclipse.passage.lic.licenses.model.meta.LicensesPackage; import org.eclipse.passage.lic.products.model.api.ProductVersion; -import org.eclipse.passage.lic.users.UserDescriptor; +import org.eclipse.passage.lic.users.model.api.User; import org.eclipse.passage.loc.dashboard.ui.wizards.IssueLicenseWizard; import org.eclipse.passage.loc.dashboard.ui.wizards.PersonalDataPack; import org.eclipse.passage.loc.internal.api.OperatorLicenseService; @@ -37,13 +37,13 @@ public class DashboardIssueLicenseHandler { @Execute public void execute(IEclipseContext context, @Named(IServiceConstants.ACTIVE_SELECTION) @Optional LicensePlan plan, - @Named(IServiceConstants.ACTIVE_SELECTION) @Optional UserDescriptor user, + @Named(IServiceConstants.ACTIVE_SELECTION) @Optional User user, @Named(IServiceConstants.ACTIVE_SELECTION) @Optional ProductVersion product) { Shell shell = context.get(Shell.class); new LicensedRunnableUI(() -> shell, feature, () -> startWizard(shell, context, plan, user, product)).run(); } - private void startWizard(Shell shell, IEclipseContext context, LicensePlan plan, UserDescriptor user, + private void startWizard(Shell shell, IEclipseContext context, LicensePlan plan, User user, ProductVersion product) { IssueLicenseWizard wizard = new IssueLicenseWizard(context, new PersonalDataPack(// java.util.Optional.ofNullable(plan), // diff --git a/bundles/org.eclipse.passage.loc.dashboard.ui/src/org/eclipse/passage/loc/dashboard/ui/panel/DashboardPanelPart.java b/bundles/org.eclipse.passage.loc.dashboard.ui/src/org/eclipse/passage/loc/dashboard/ui/panel/DashboardPanelPart.java index 84086a1a7..539ba37a0 100644 --- a/bundles/org.eclipse.passage.loc.dashboard.ui/src/org/eclipse/passage/loc/dashboard/ui/panel/DashboardPanelPart.java +++ b/bundles/org.eclipse.passage.loc.dashboard.ui/src/org/eclipse/passage/loc/dashboard/ui/panel/DashboardPanelPart.java @@ -40,8 +40,8 @@ import org.eclipse.passage.lic.products.model.api.ProductLine; import org.eclipse.passage.lic.products.model.api.ProductVersion; import org.eclipse.passage.lic.products.model.api.ProductVersionFeature; -import org.eclipse.passage.lic.users.UserDescriptor; -import org.eclipse.passage.lic.users.UserOriginDescriptor; +import org.eclipse.passage.lic.users.model.api.User; +import org.eclipse.passage.lic.users.model.api.UserOrigin; import org.eclipse.passage.loc.internal.agreements.AgreementRegistry; import org.eclipse.passage.loc.internal.agreements.AgreementRegistryEvents; import org.eclipse.passage.loc.internal.features.FeatureRegistry; @@ -228,25 +228,25 @@ public void deletedProductVersionFeature( @Inject @Optional - public void createdUserOrigin(@UIEventTopic(UserRegistryEvents.USER_ORIGIN_CREATE) UserOriginDescriptor input) { + public void createdUserOrigin(@UIEventTopic(UserRegistryEvents.USER_ORIGIN_CREATE) UserOrigin input) { dashboard.updateUserInfo(users); } @Inject @Optional - public void deletedUserOrigin(@UIEventTopic(UserRegistryEvents.USER_ORIGIN_DELETE) UserOriginDescriptor input) { + public void deletedUserOrigin(@UIEventTopic(UserRegistryEvents.USER_ORIGIN_DELETE) UserOrigin input) { dashboard.updateUserInfo(users); } @Inject @Optional - public void createdUser(@UIEventTopic(UserRegistryEvents.USER_CREATE) UserDescriptor input) { + public void createdUser(@UIEventTopic(UserRegistryEvents.USER_CREATE) User input) { dashboard.updateUserInfo(users); } @Inject @Optional - public void deletedUser(@UIEventTopic(UserRegistryEvents.USER_DELETE) UserDescriptor input) { + public void deletedUser(@UIEventTopic(UserRegistryEvents.USER_DELETE) User input) { dashboard.updateUserInfo(users); } diff --git a/bundles/org.eclipse.passage.loc.dashboard.ui/src/org/eclipse/passage/loc/dashboard/ui/panel/DefaultDashboardPanelAdvisor.java b/bundles/org.eclipse.passage.loc.dashboard.ui/src/org/eclipse/passage/loc/dashboard/ui/panel/DefaultDashboardPanelAdvisor.java index 0754a8412..9b2b32254 100644 --- a/bundles/org.eclipse.passage.loc.dashboard.ui/src/org/eclipse/passage/loc/dashboard/ui/panel/DefaultDashboardPanelAdvisor.java +++ b/bundles/org.eclipse.passage.loc.dashboard.ui/src/org/eclipse/passage/loc/dashboard/ui/panel/DefaultDashboardPanelAdvisor.java @@ -225,8 +225,8 @@ protected DashboardPanelBlock createUserBlock(Composite parent) { @Override public void updateUserInfo(UserRegistry userRegistry) { - userOrigins.update(userRegistry.getUserOrigins()); - users.update(userRegistry.getUsers()); + userOrigins.update(userRegistry.userOrigins()); + users.update(userRegistry.users()); } @Override diff --git a/bundles/org.eclipse.passage.loc.dashboard.ui/src/org/eclipse/passage/loc/dashboard/ui/wizards/IssueLicenseRequestPage.java b/bundles/org.eclipse.passage.loc.dashboard.ui/src/org/eclipse/passage/loc/dashboard/ui/wizards/IssueLicenseRequestPage.java index 2e3e74a34..a80947b92 100644 --- a/bundles/org.eclipse.passage.loc.dashboard.ui/src/org/eclipse/passage/loc/dashboard/ui/wizards/IssueLicenseRequestPage.java +++ b/bundles/org.eclipse.passage.loc.dashboard.ui/src/org/eclipse/passage/loc/dashboard/ui/wizards/IssueLicenseRequestPage.java @@ -21,7 +21,7 @@ import org.eclipse.jface.wizard.IWizardPage; import org.eclipse.passage.lic.licenses.model.api.LicensePlan; import org.eclipse.passage.lic.products.model.api.ProductVersion; -import org.eclipse.passage.lic.users.UserDescriptor; +import org.eclipse.passage.lic.users.model.api.User; import org.eclipse.passage.loc.dashboard.ui.wizards.license.ComposedPage; import org.eclipse.passage.loc.dashboard.ui.wizards.license.PageFields; import org.eclipse.passage.loc.internal.api.PersonalLicenseRequest; @@ -31,7 +31,7 @@ public final class IssueLicenseRequestPage implements Supplier { private final Supplier> plan; - private final Supplier> user; + private final Supplier> user; private final Supplier> product; private final Supplier>> period; private final ComposedPage page; diff --git a/bundles/org.eclipse.passage.loc.dashboard.ui/src/org/eclipse/passage/loc/dashboard/ui/wizards/PersonalDataPack.java b/bundles/org.eclipse.passage.loc.dashboard.ui/src/org/eclipse/passage/loc/dashboard/ui/wizards/PersonalDataPack.java index 87c202d35..61fdd2aee 100644 --- a/bundles/org.eclipse.passage.loc.dashboard.ui/src/org/eclipse/passage/loc/dashboard/ui/wizards/PersonalDataPack.java +++ b/bundles/org.eclipse.passage.loc.dashboard.ui/src/org/eclipse/passage/loc/dashboard/ui/wizards/PersonalDataPack.java @@ -16,16 +16,16 @@ import org.eclipse.passage.lic.licenses.model.api.LicensePlan; import org.eclipse.passage.lic.products.model.api.ProductVersion; -import org.eclipse.passage.lic.users.UserDescriptor; +import org.eclipse.passage.lic.users.model.api.User; public final class PersonalDataPack { private final Optional plan; - private final Optional user; + private final Optional user; private final Optional product; public PersonalDataPack(// Optional plan, // - Optional user, // + Optional user, // Optional product) { this.plan = plan; this.user = user; @@ -40,7 +40,7 @@ Optional plan() { return plan; } - Optional user() { + Optional user() { return user; } diff --git a/bundles/org.eclipse.passage.loc.dashboard.ui/src/org/eclipse/passage/loc/dashboard/ui/wizards/floating/FloatingDataPack.java b/bundles/org.eclipse.passage.loc.dashboard.ui/src/org/eclipse/passage/loc/dashboard/ui/wizards/floating/FloatingDataPack.java index 6d1fbb4d7..e6f078394 100644 --- a/bundles/org.eclipse.passage.loc.dashboard.ui/src/org/eclipse/passage/loc/dashboard/ui/wizards/floating/FloatingDataPack.java +++ b/bundles/org.eclipse.passage.loc.dashboard.ui/src/org/eclipse/passage/loc/dashboard/ui/wizards/floating/FloatingDataPack.java @@ -19,17 +19,17 @@ import org.eclipse.passage.lic.licenses.model.api.LicensePlan; import org.eclipse.passage.lic.products.model.api.ProductVersion; -import org.eclipse.passage.lic.users.UserDescriptor; +import org.eclipse.passage.lic.users.model.api.User; public final class FloatingDataPack { private final Optional plan; - private final List users; + private final List users; private final Optional product; public FloatingDataPack(// Optional plan, // - List users, // + List users, // Optional product) { this.plan = plan; this.users = users; @@ -38,14 +38,14 @@ public FloatingDataPack(// public FloatingDataPack(// Optional plan, // - Optional user, // + Optional user, // Optional product) { this.plan = plan; this.users = users(user); this.product = product; } - private List users(Optional user) { + private List users(Optional user) { if (user.isEmpty()) { return Collections.emptyList(); } @@ -60,7 +60,7 @@ Optional plan() { return plan; } - List users() { + List users() { return users; } diff --git a/bundles/org.eclipse.passage.loc.dashboard.ui/src/org/eclipse/passage/loc/dashboard/ui/wizards/floating/IssueLicenseRequestPage.java b/bundles/org.eclipse.passage.loc.dashboard.ui/src/org/eclipse/passage/loc/dashboard/ui/wizards/floating/IssueLicenseRequestPage.java index f5f7d63d9..ea40b1269 100644 --- a/bundles/org.eclipse.passage.loc.dashboard.ui/src/org/eclipse/passage/loc/dashboard/ui/wizards/floating/IssueLicenseRequestPage.java +++ b/bundles/org.eclipse.passage.loc.dashboard.ui/src/org/eclipse/passage/loc/dashboard/ui/wizards/floating/IssueLicenseRequestPage.java @@ -23,7 +23,7 @@ import org.eclipse.jface.wizard.IWizardPage; import org.eclipse.passage.lic.licenses.model.api.LicensePlan; import org.eclipse.passage.lic.products.model.api.ProductVersion; -import org.eclipse.passage.lic.users.UserDescriptor; +import org.eclipse.passage.lic.users.model.api.User; import org.eclipse.passage.loc.dashboard.ui.wizards.license.ComposedPage; import org.eclipse.passage.loc.dashboard.ui.wizards.license.PageFields; import org.eclipse.passage.loc.internal.api.FloatingLicenseRequest; @@ -33,7 +33,7 @@ public final class IssueLicenseRequestPage implements Supplier { private final Supplier> plan; - private final Supplier>> users; + private final Supplier>> users; private final Supplier> product; private final Supplier>> period; private final Supplier> capacity; diff --git a/bundles/org.eclipse.passage.loc.dashboard.ui/src/org/eclipse/passage/loc/dashboard/ui/wizards/license/PageFields.java b/bundles/org.eclipse.passage.loc.dashboard.ui/src/org/eclipse/passage/loc/dashboard/ui/wizards/license/PageFields.java index 02137e684..cda7ec469 100644 --- a/bundles/org.eclipse.passage.loc.dashboard.ui/src/org/eclipse/passage/loc/dashboard/ui/wizards/license/PageFields.java +++ b/bundles/org.eclipse.passage.loc.dashboard.ui/src/org/eclipse/passage/loc/dashboard/ui/wizards/license/PageFields.java @@ -25,7 +25,7 @@ import org.eclipse.passage.lic.api.MandatoryService; import org.eclipse.passage.lic.licenses.model.api.LicensePlan; import org.eclipse.passage.lic.products.model.api.ProductVersion; -import org.eclipse.passage.lic.users.UserDescriptor; +import org.eclipse.passage.lic.users.model.api.User; import org.eclipse.passage.loc.internal.dashboard.ui.i18n.IssueLicensePageMessages; import org.eclipse.passage.loc.internal.workbench.MandatoryEclipseContext; import org.eclipse.passage.loc.workbench.viewers.DomainRegistryLabelProvider; @@ -47,11 +47,11 @@ public Supplier> withLicensePlan(Optional pla return with(new LicensePlanField(plan, this::modified, labels, context)); } - public Supplier> withUser(Optional user) { + public Supplier> withUser(Optional user) { return with(new UserField(user, this::modified, labels, context)); } - public Supplier>> withUsers(List users) { + public Supplier>> withUsers(List users) { return with(new UsersField(users, this::modified, labels, context)); } diff --git a/bundles/org.eclipse.passage.loc.dashboard.ui/src/org/eclipse/passage/loc/dashboard/ui/wizards/license/UserField.java b/bundles/org.eclipse.passage.loc.dashboard.ui/src/org/eclipse/passage/loc/dashboard/ui/wizards/license/UserField.java index d42950d9f..2accc33c5 100644 --- a/bundles/org.eclipse.passage.loc.dashboard.ui/src/org/eclipse/passage/loc/dashboard/ui/wizards/license/UserField.java +++ b/bundles/org.eclipse.passage.loc.dashboard.ui/src/org/eclipse/passage/loc/dashboard/ui/wizards/license/UserField.java @@ -17,15 +17,15 @@ import org.eclipse.jface.viewers.LabelProvider; import org.eclipse.passage.lic.api.MandatoryService; -import org.eclipse.passage.lic.users.UserDescriptor; +import org.eclipse.passage.lic.users.model.api.User; import org.eclipse.passage.loc.internal.dashboard.ui.i18n.IssueLicensePageMessages; import org.eclipse.passage.loc.internal.users.ui.SelectUser; import org.eclipse.passage.loc.internal.workbench.SelectRoot; import org.eclipse.swt.widgets.Text; -public final class UserField extends SelectableField { +public final class UserField extends SelectableField { - UserField(Optional user, Runnable modified, LabelProvider labels, MandatoryService context) { + UserField(Optional user, Runnable modified, LabelProvider labels, MandatoryService context) { super(user, modified, labels, context); } @@ -40,7 +40,7 @@ protected String errorText() { } @Override - protected Optional select(Text control) { + protected Optional select(Text control) { return new SelectRoot<>(new SelectUser(context, data()).get(), context).get(); } diff --git a/bundles/org.eclipse.passage.loc.dashboard.ui/src/org/eclipse/passage/loc/dashboard/ui/wizards/license/UsersField.java b/bundles/org.eclipse.passage.loc.dashboard.ui/src/org/eclipse/passage/loc/dashboard/ui/wizards/license/UsersField.java index 4d31a0026..717cb1b85 100644 --- a/bundles/org.eclipse.passage.loc.dashboard.ui/src/org/eclipse/passage/loc/dashboard/ui/wizards/license/UsersField.java +++ b/bundles/org.eclipse.passage.loc.dashboard.ui/src/org/eclipse/passage/loc/dashboard/ui/wizards/license/UsersField.java @@ -19,15 +19,15 @@ import org.eclipse.jface.viewers.LabelProvider; import org.eclipse.passage.lic.api.MandatoryService; -import org.eclipse.passage.lic.users.UserDescriptor; +import org.eclipse.passage.lic.users.model.api.User; import org.eclipse.passage.loc.internal.dashboard.ui.i18n.IssueLicensePageMessages; import org.eclipse.passage.loc.internal.users.ui.SelectUsers; import org.eclipse.passage.loc.internal.workbench.SelectRoots; import org.eclipse.swt.widgets.Text; -public final class UsersField extends SelectableField> { +public final class UsersField extends SelectableField> { - UsersField(Collection users, Runnable modified, LabelProvider labels, MandatoryService context) { + UsersField(Collection users, Runnable modified, LabelProvider labels, MandatoryService context) { super(Optional.of(users), modified, labels, context); } @@ -42,7 +42,7 @@ protected String errorText() { } @Override - protected Optional> select(Text control) { + protected Optional> select(Text control) { return Optional.of(// new SelectRoots<>(// new SelectUsers(context, data().orElseGet(Collections::emptyList)).get(), context).get()); 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 37cf93dac..1b920afce 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 @@ -41,8 +41,8 @@ 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.users.UserDescriptor; -import org.eclipse.passage.lic.users.UserOriginDescriptor; +import org.eclipse.passage.lic.users.model.api.User; +import org.eclipse.passage.lic.users.model.api.UserOrigin; import org.eclipse.passage.loc.internal.api.FloatingLicenseRequest; import org.eclipse.passage.loc.internal.licenses.LicenseRegistry; import org.eclipse.passage.loc.internal.users.UserRegistry; @@ -116,7 +116,7 @@ private String serverAuthenticationExpression() { } private CompanyRef company() { - UserOriginDescriptor origin = users.getUser(request.users().iterator().next()).getOrigin(); + UserOrigin origin = users.user(request.users().iterator().next()).get().getOrigin(); CompanyRef company = LicensesFactory.eINSTANCE.createCompanyRef(); company.setIdentifier(origin.getIdentifier()); company.setName(origin.getName()); @@ -140,26 +140,27 @@ private ProductRef product() { private Collection userGrants() { return request.users().stream()// - .map(users::getUser)// + .map(users::user)// + .map(Optional::get)// .map(this::userGrant)// .collect(Collectors.toSet()); } - private UserGrant userGrant(UserDescriptor user) { + private UserGrant userGrant(User user) { UserGrant grant = LicensesFactory.eINSTANCE.createUserGrant(); grant.setAuthentication(userAuthentication(user)); grant.setUser(user.getContact().getEmail()); return grant; } - private EvaluationInstructions userAuthentication(UserDescriptor user) { + private EvaluationInstructions userAuthentication(User user) { EvaluationInstructions auth = LicensesFactory.eINSTANCE.createEvaluationInstructions(); auth.setExpression(userAuthenticationExpression(user)); auth.setType(userAuthenticationType(user)); return auth; } - private String userAuthenticationType(UserDescriptor user) { + private String userAuthenticationType(User user) { return template// .flatMap(l -> forUser(l.getUsers(), user))// .map(UserGrant::getAuthentication)// @@ -167,7 +168,7 @@ private String userAuthenticationType(UserDescriptor user) { .orElseGet(user::getPreferredEvaluationType); } - private String userAuthenticationExpression(UserDescriptor user) { + private String userAuthenticationExpression(User user) { return template// .flatMap(l -> forUser(l.getUsers(), user))// .map(UserGrant::getAuthentication)// @@ -175,7 +176,7 @@ private String userAuthenticationExpression(UserDescriptor user) { .orElseGet(user::getPreferredEvaluationExpression); } - private Optional forUser(List all, UserDescriptor user) { + private Optional forUser(List all, User user) { return all.stream().filter(u -> user.getContact().getEmail().equals(u.getUser())).findFirst(); } diff --git a/bundles/org.eclipse.passage.loc.licenses.core/src/org/eclipse/passage/loc/internal/licenses/core/request/FloatingLicenseData.java b/bundles/org.eclipse.passage.loc.licenses.core/src/org/eclipse/passage/loc/internal/licenses/core/request/FloatingLicenseData.java index 020bf0c1d..9f0dd9bc7 100644 --- a/bundles/org.eclipse.passage.loc.licenses.core/src/org/eclipse/passage/loc/internal/licenses/core/request/FloatingLicenseData.java +++ b/bundles/org.eclipse.passage.loc.licenses.core/src/org/eclipse/passage/loc/internal/licenses/core/request/FloatingLicenseData.java @@ -23,15 +23,15 @@ import org.eclipse.passage.lic.base.conditions.BaseEvaluationInstructions; import org.eclipse.passage.lic.licenses.model.api.LicensePlan; import org.eclipse.passage.lic.products.model.api.ProductVersion; -import org.eclipse.passage.lic.users.UserDescriptor; +import org.eclipse.passage.lic.users.model.api.User; import org.eclipse.passage.loc.internal.api.FloatingLicenseRequest; public final class FloatingLicenseData extends GeneralLicenseData implements FloatingLicenseRequest { - private final Supplier> users; + private final Supplier> users; private final Supplier capacity; - public FloatingLicenseData(Supplier> users, Supplier plan, + public FloatingLicenseData(Supplier> users, Supplier plan, Supplier product, Supplier from, Supplier until, Supplier capacity) { super(plan, product, from, until); @@ -49,13 +49,13 @@ public Collection users() { @Override public EvaluationInstructions userAuthentication(String user) { - UserDescriptor target = user(user); + User target = user(user); return new BaseEvaluationInstructions(// new EvaluationType.Of(target.getPreferredEvaluationExpression()), // target.getPreferredEvaluationType()); } - private UserDescriptor user(String identifier) { + private User user(String identifier) { return users.get().stream()// .filter(user -> identifier.equals(user.getContact().getEmail()))// .findAny()// diff --git a/bundles/org.eclipse.passage.loc.licenses.core/src/org/eclipse/passage/loc/internal/licenses/core/request/PersonalLicenseData.java b/bundles/org.eclipse.passage.loc.licenses.core/src/org/eclipse/passage/loc/internal/licenses/core/request/PersonalLicenseData.java index fb41d291f..cc4dfdd23 100644 --- a/bundles/org.eclipse.passage.loc.licenses.core/src/org/eclipse/passage/loc/internal/licenses/core/request/PersonalLicenseData.java +++ b/bundles/org.eclipse.passage.loc.licenses.core/src/org/eclipse/passage/loc/internal/licenses/core/request/PersonalLicenseData.java @@ -18,18 +18,17 @@ import org.eclipse.passage.lic.licenses.model.api.LicensePlan; import org.eclipse.passage.lic.products.model.api.ProductVersion; -import org.eclipse.passage.lic.users.UserDescriptor; +import org.eclipse.passage.lic.users.model.api.User; import org.eclipse.passage.loc.internal.api.PersonalLicenseRequest; public final class PersonalLicenseData extends GeneralLicenseData implements PersonalLicenseRequest { - private final Supplier user; + private final Supplier user; - public PersonalLicenseData(Supplier user, Supplier plan, - Supplier product, Supplier from, Supplier until) { + public PersonalLicenseData(Supplier user, Supplier plan, Supplier product, + Supplier from, Supplier until) { super(plan, product, from, until); - Objects.requireNonNull(user, "PersonalLicenseData::user"); //$NON-NLS-1$ - this.user = user; + this.user = Objects.requireNonNull(user); } @Override diff --git a/bundles/org.eclipse.passage.loc.licenses.ui/src/org/eclipse/passage/loc/internal/licenses/ui/handlers/LicenseExportHandler.java b/bundles/org.eclipse.passage.loc.licenses.ui/src/org/eclipse/passage/loc/internal/licenses/ui/handlers/LicenseExportHandler.java index 3b2d9d3fd..6c939af4c 100644 --- a/bundles/org.eclipse.passage.loc.licenses.ui/src/org/eclipse/passage/loc/internal/licenses/ui/handlers/LicenseExportHandler.java +++ b/bundles/org.eclipse.passage.loc.licenses.ui/src/org/eclipse/passage/loc/internal/licenses/ui/handlers/LicenseExportHandler.java @@ -33,8 +33,8 @@ import org.eclipse.passage.lic.licenses.model.api.LicensePlan; import org.eclipse.passage.lic.licenses.model.api.PersonalLicensePack; import org.eclipse.passage.lic.products.model.api.ProductVersion; -import org.eclipse.passage.lic.users.UserDescriptor; -import org.eclipse.passage.lic.users.UserOriginDescriptor; +import org.eclipse.passage.lic.users.model.api.User; +import org.eclipse.passage.lic.users.model.api.UserOrigin; import org.eclipse.passage.loc.internal.api.IssuedLicense; import org.eclipse.passage.loc.internal.api.OperatorLicenseService; import org.eclipse.passage.loc.internal.api.PersonalLicenseRequest; @@ -57,8 +57,8 @@ public class LicenseExportHandler { public void execute(@Named(IServiceConstants.ACTIVE_SELECTION) LicensePlan plan, IEclipseContext context) { Shell shell = context.get(Shell.class); MandatoryEclipseContext resolution = new MandatoryEclipseContext(context); - java.util.Optional user = new SelectInner( - new SelectUser(resolution).get(), new SelectUserOrigin(resolution).get(), resolution).get(); + java.util.Optional user = new SelectInner(new SelectUser(resolution).get(), + new SelectUserOrigin(resolution).get(), resolution).get(); if (!user.isPresent()) { return; } @@ -120,7 +120,7 @@ public boolean canExecute(@Named(IServiceConstants.ACTIVE_SELECTION) @Optional L return licensePlan != null; } - private PersonalLicenseRequest createLicensingRequest(UserDescriptor user, LicensePlan plan, ProductVersion product, + private PersonalLicenseRequest createLicensingRequest(User user, LicensePlan plan, ProductVersion product, LocalDate from, LocalDate until) { return new PersonalLicenseData(() -> user, () -> plan, () -> product, () -> from, () -> until); } diff --git a/bundles/org.eclipse.passage.loc.report.core/src/org/eclipse/passage/loc/report/internal/core/user/CustomerStorage.java b/bundles/org.eclipse.passage.loc.report.core/src/org/eclipse/passage/loc/report/internal/core/user/CustomerStorage.java index ef66d4b91..ac2aca48c 100644 --- a/bundles/org.eclipse.passage.loc.report.core/src/org/eclipse/passage/loc/report/internal/core/user/CustomerStorage.java +++ b/bundles/org.eclipse.passage.loc.report.core/src/org/eclipse/passage/loc/report/internal/core/user/CustomerStorage.java @@ -14,8 +14,8 @@ import java.util.Set; -import org.eclipse.passage.lic.users.UserDescriptor; -import org.eclipse.passage.lic.users.UserOriginDescriptor; +import org.eclipse.passage.lic.users.model.api.User; +import org.eclipse.passage.lic.users.model.api.UserOrigin; import org.eclipse.passage.loc.internal.users.UserRegistry; import org.eclipse.passage.loc.yars.internal.api.Storage; @@ -26,7 +26,7 @@ * @since 0.2 */ @SuppressWarnings("restriction") -public interface CustomerStorage extends Storage { +public interface CustomerStorage extends Storage { /** * Retrieve information of all users who ever got licenses (personal type of @@ -37,7 +37,7 @@ public interface CustomerStorage extends Storage { * in a product from the given set * @since 0.1 */ - Set personsUsedProducts(Set products); + Set personsUsedProducts(Set products); /** * Retrieve information of all companies who ever got licenses (floating) for @@ -48,7 +48,7 @@ public interface CustomerStorage extends Storage { * interested in a product from the given set * @since 0.1 */ - Set companiesUsedProducts(Set products); + Set companiesUsedProducts(Set products); /** * Find all products for which any known user ever has got a license. diff --git a/bundles/org.eclipse.passage.loc.report.core/src/org/eclipse/passage/loc/report/internal/core/user/Customers.java b/bundles/org.eclipse.passage.loc.report.core/src/org/eclipse/passage/loc/report/internal/core/user/Customers.java index 1d5a230c4..53d588dfb 100644 --- a/bundles/org.eclipse.passage.loc.report.core/src/org/eclipse/passage/loc/report/internal/core/user/Customers.java +++ b/bundles/org.eclipse.passage.loc.report.core/src/org/eclipse/passage/loc/report/internal/core/user/Customers.java @@ -13,6 +13,7 @@ package org.eclipse.passage.loc.report.internal.core.user; import java.util.Collection; +import java.util.Optional; import java.util.Set; import java.util.function.Function; import java.util.stream.Collectors; @@ -21,8 +22,8 @@ import org.eclipse.passage.lic.licenses.model.api.LicensePlan; import org.eclipse.passage.lic.licenses.model.api.LicenseRequisites; import org.eclipse.passage.lic.licenses.model.api.PersonalLicensePack; -import org.eclipse.passage.lic.users.UserDescriptor; -import org.eclipse.passage.lic.users.UserOriginDescriptor; +import org.eclipse.passage.lic.users.model.api.User; +import org.eclipse.passage.lic.users.model.api.UserOrigin; import org.eclipse.passage.loc.internal.licenses.LicenseRegistry; import org.eclipse.passage.loc.internal.users.UserRegistry; import org.osgi.service.component.annotations.Component; @@ -47,24 +48,28 @@ public final class Customers implements CustomerStorage { private LicenseRegistry licenses; @Override - public Set personsUsedProducts(Set products) { + public Set personsUsedProducts(Set products) { return licenses.plans().stream() // .map(plan -> licenses(plan.getPersonal(), products, PersonalLicensePack::getLicense))// .flatMap(Collection::stream)// .map(this::user)// .distinct()// - .map(users::getUser)// + .map(users::user)// + .filter(Optional::isPresent)// + .map(Optional::get)// .collect(Collectors.toSet()); } @Override - public Set companiesUsedProducts(Set products) { + public Set companiesUsedProducts(Set products) { return licenses.plans().stream() // .map(plan -> licenses(plan.getFloating(), products, FloatingLicensePack::getLicense))// .flatMap(Collection::stream)// .map(this::company)// .distinct()// - .map(users::getUserOrigin)// + .map(users::userOrigin)// + .filter(Optional::isPresent)// + .map(Optional::get)// .collect(Collectors.toSet()); } diff --git a/bundles/org.eclipse.passage.loc.report.core/src/org/eclipse/passage/loc/report/internal/core/user/CustomersFetch.java b/bundles/org.eclipse.passage.loc.report.core/src/org/eclipse/passage/loc/report/internal/core/user/CustomersFetch.java index 4408472ed..726599d26 100644 --- a/bundles/org.eclipse.passage.loc.report.core/src/org/eclipse/passage/loc/report/internal/core/user/CustomersFetch.java +++ b/bundles/org.eclipse.passage.loc.report.core/src/org/eclipse/passage/loc/report/internal/core/user/CustomersFetch.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2019, 2021 ArSysOp + * Copyright (c) 2019, 2024 ArSysOp * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at diff --git a/bundles/org.eclipse.passage.loc.report.core/src/org/eclipse/passage/loc/report/internal/core/user/ProductCustomer.java b/bundles/org.eclipse.passage.loc.report.core/src/org/eclipse/passage/loc/report/internal/core/user/ProductCustomer.java index 96f4e09fd..7e1c7a2db 100644 --- a/bundles/org.eclipse.passage.loc.report.core/src/org/eclipse/passage/loc/report/internal/core/user/ProductCustomer.java +++ b/bundles/org.eclipse.passage.loc.report.core/src/org/eclipse/passage/loc/report/internal/core/user/ProductCustomer.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2019, 2021 ArSysOp + * Copyright (c) 2019, 2024 ArSysOp * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at @@ -12,8 +12,8 @@ *******************************************************************************/ package org.eclipse.passage.loc.report.internal.core.user; -import org.eclipse.passage.lic.users.UserDescriptor; -import org.eclipse.passage.lic.users.UserOriginDescriptor; +import org.eclipse.passage.lic.users.model.api.User; +import org.eclipse.passage.lic.users.model.api.UserOrigin; import org.eclipse.passage.loc.yars.internal.api.DosHandleMedia; import org.eclipse.passage.loc.yars.internal.api.ExportData; import org.eclipse.passage.loc.yars.internal.api.Progress; @@ -45,11 +45,11 @@ public final class ProductCustomer implements ExportData void addUsers(String title, Function> .forEach(users::add); } - private String userInfo(UserDescriptor user) { + private String userInfo(User user) { return NLS.bind("{0} ({1})", user.getContact().getName(), user.getContact().getEmail()); //$NON-NLS-1$ } - private String companyInfo(UserOriginDescriptor company) { + private String companyInfo(UserOrigin company) { if (company == null) { return ExportCustomersWizardMessages.PreviewPage_noinfo_company; } diff --git a/bundles/org.eclipse.passage.loc.users.core/src/org/eclipse/passage/loc/internal/users/UserRegistry.java b/bundles/org.eclipse.passage.loc.users.core/src/org/eclipse/passage/loc/internal/users/UserRegistry.java index 806446319..9c57d1c3a 100644 --- a/bundles/org.eclipse.passage.loc.users.core/src/org/eclipse/passage/loc/internal/users/UserRegistry.java +++ b/bundles/org.eclipse.passage.loc.users.core/src/org/eclipse/passage/loc/internal/users/UserRegistry.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2018, 2021 ArSysOp + * Copyright (c) 2018, 2024 ArSysOp * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at @@ -12,17 +12,20 @@ *******************************************************************************/ package org.eclipse.passage.loc.internal.users; -import org.eclipse.passage.lic.users.UserDescriptor; -import org.eclipse.passage.lic.users.UserOriginDescriptor; +import java.util.Collection; +import java.util.Optional; + +import org.eclipse.passage.lic.users.model.api.User; +import org.eclipse.passage.lic.users.model.api.UserOrigin; public interface UserRegistry { - Iterable getUserOrigins(); + Collection userOrigins(); - UserOriginDescriptor getUserOrigin(String userOriginId); + Optional userOrigin(String id); - Iterable getUsers(); + Collection users(); - UserDescriptor getUser(String userId); + Optional user(String userId); } diff --git a/bundles/org.eclipse.passage.loc.users.core/src/org/eclipse/passage/loc/internal/users/core/UserDomainRegistry.java b/bundles/org.eclipse.passage.loc.users.core/src/org/eclipse/passage/loc/internal/users/core/UserDomainRegistry.java index fcd4b349d..09c480b9b 100644 --- a/bundles/org.eclipse.passage.loc.users.core/src/org/eclipse/passage/loc/internal/users/core/UserDomainRegistry.java +++ b/bundles/org.eclipse.passage.loc.users.core/src/org/eclipse/passage/loc/internal/users/core/UserDomainRegistry.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2018, 2022 ArSysOp + * Copyright (c) 2018, 2024 ArSysOp * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at @@ -13,9 +13,10 @@ package org.eclipse.passage.loc.internal.users.core; import java.util.ArrayList; -import java.util.Collections; +import java.util.Collection; import java.util.HashMap; import java.util.Map; +import java.util.Optional; import org.eclipse.core.runtime.Platform; import org.eclipse.emf.common.util.URI; @@ -24,8 +25,8 @@ import org.eclipse.emf.ecore.resource.Resource; import org.eclipse.osgi.util.NLS; import org.eclipse.passage.lic.internal.equinox.events.EquinoxEvent; -import org.eclipse.passage.lic.users.UserDescriptor; -import org.eclipse.passage.lic.users.UserOriginDescriptor; +import org.eclipse.passage.lic.users.model.api.User; +import org.eclipse.passage.lic.users.model.api.UserOrigin; import org.eclipse.passage.lic.users.model.meta.UsersPackage; import org.eclipse.passage.lic.users.model.util.UsersResourceImpl; import org.eclipse.passage.loc.internal.api.OperatorGearSupplier; @@ -49,11 +50,11 @@ @SuppressWarnings("restriction") @Component(property = { EditingDomainRegistryAccess.PROPERTY_DOMAIN_NAME + '=' + UsersPackage.eNAME, EditingDomainRegistryAccess.PROPERTY_FILE_EXTENSION + '=' + "users_xmi" }) -public class UserDomainRegistry extends BaseDomainRegistry - implements UserRegistry, EditingDomainRegistry { +public class UserDomainRegistry extends BaseDomainRegistry + implements UserRegistry, EditingDomainRegistry { - private final Map userOriginIndex = new HashMap<>(); - private final Map userIndex = new HashMap<>(); + private final Map origins = new HashMap<>(); + private final Map users = new HashMap<>(); private EventAdmin events; @@ -86,8 +87,8 @@ public void activate(Map properties) { @Deactivate @Override public void deactivate(Map properties) { - userIndex.clear(); - userOriginIndex.clear(); + users.clear(); + origins.clear(); super.deactivate(properties); } @@ -97,81 +98,69 @@ public String getFileExtension() { } @Override - public Class getContentClass() { - return UserOriginDescriptor.class; + public Class getContentClass() { + return UserOrigin.class; } @Override - public String resolveIdentifier(UserOriginDescriptor content) { + public String resolveIdentifier(UserOrigin content) { return content.getIdentifier(); } @Override - public Iterable getUserOrigins() { - return new ArrayList<>(userOriginIndex.values()); + public Collection userOrigins() { + return new ArrayList<>(origins.values()); } @Override - public UserOriginDescriptor getUserOrigin(String identifier) { - return userOriginIndex.get(identifier); + public Optional userOrigin(String identifier) { + return Optional.ofNullable(origins.get(identifier)); } @Override - public Iterable getUsers() { - return new ArrayList<>(userIndex.values()); - } - - public Iterable getUsers(String userOriginId) { - UserOriginDescriptor userOrigin = userOriginIndex.get(userOriginId); - if (userOrigin == null) { - return Collections.emptyList(); - } - return userOrigin.getUsers(); + public Collection users() { + return new ArrayList<>(users.values()); } @Override - public UserDescriptor getUser(String identifier) { - return userIndex.get(identifier); + public Optional user(String identifier) { + return Optional.ofNullable(users.get(identifier)); } @Override - protected DomainContentAdapter createContentAdapter() { + protected DomainContentAdapter createContentAdapter() { return new UsersDomainRegistryTracker(this); } - public void registerUserOrigin(UserOriginDescriptor userOrigin) { - String identifier = userOrigin.getIdentifier(); - UserOriginDescriptor existing = userOriginIndex.put(identifier, userOrigin); - if ((existing != null) && (existing != userOrigin)) { - String msg = NLS.bind(UsersCoreMessages.UserDomain_instance_duplication_message, existing, userOrigin); - Platform.getLog(getClass()).warn(msg); + void registerUserOrigin(UserOrigin origin) { + UserOrigin existing = origins.put(origin.getIdentifier(), origin); + if ((existing != null) && (existing != origin)) { + Platform.getLog(getClass()) + .warn(NLS.bind(UsersCoreMessages.UserDomain_instance_duplication_message, existing, origin)); } - events.postEvent(new EquinoxEvent(UserRegistryEvents.USER_ORIGIN_CREATE, userOrigin).get()); - userOrigin.getUsers().forEach(u -> registerUser(u)); + events.postEvent(new EquinoxEvent(UserRegistryEvents.USER_ORIGIN_CREATE, origin).get()); + origin.getUsers().forEach(u -> registerUser(u)); } - public void registerUser(UserDescriptor user) { - String identifier = user.getContact().getEmail(); - UserDescriptor existing = userIndex.put(identifier, user); + void registerUser(User user) { + User existing = users.put(user.getContact().getEmail(), user); if ((existing != null) && (existing != user)) { - String msg = NLS.bind(UsersCoreMessages.UserDomain_instance_duplication_message, existing, user); - Platform.getLog(getClass()).warn(msg); + Platform.getLog(getClass()) + .warn(NLS.bind(UsersCoreMessages.UserDomain_instance_duplication_message, existing, user)); } events.postEvent(new EquinoxEvent(UserRegistryEvents.USER_CREATE, user).get()); } - public void unregisterUserOrigin(String userOriginId) { - UserOriginDescriptor removed = userOriginIndex.remove(userOriginId); + void unregisterUserOrigin(String id) { + UserOrigin removed = origins.remove(id); if (removed != null) { events.postEvent(new EquinoxEvent(UserRegistryEvents.USER_ORIGIN_DELETE, removed).get()); - removed.getUsers().forEach(u -> { - unregisterUser(u.getContact().getEmail()); - }); + removed.getUsers().forEach(u -> unregisterUser(u.getContact().getEmail())); } } - public void unregisterUser(String userId) { - UserDescriptor removed = userIndex.remove(userId); + void unregisterUser(String userId) { + User removed = users.remove(userId); if (removed != null) { events.postEvent(new EquinoxEvent(UserRegistryEvents.USER_DELETE, removed).get()); } @@ -193,7 +182,7 @@ public EStructuralFeature getContentNameAttribute() { } @Override - public void registerContent(UserOriginDescriptor content) { + public void registerContent(UserOrigin content) { registerUserOrigin(content); } diff --git a/bundles/org.eclipse.passage.loc.users.core/src/org/eclipse/passage/loc/internal/users/core/UsersDomainRegistryTracker.java b/bundles/org.eclipse.passage.loc.users.core/src/org/eclipse/passage/loc/internal/users/core/UsersDomainRegistryTracker.java index 3b9792931..d802cd604 100644 --- a/bundles/org.eclipse.passage.loc.users.core/src/org/eclipse/passage/loc/internal/users/core/UsersDomainRegistryTracker.java +++ b/bundles/org.eclipse.passage.loc.users.core/src/org/eclipse/passage/loc/internal/users/core/UsersDomainRegistryTracker.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2018, 2021 ArSysOp + * Copyright (c) 2018, 2024 ArSysOp * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at @@ -14,14 +14,13 @@ import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.ecore.EObject; -import org.eclipse.passage.lic.users.UserOriginDescriptor; import org.eclipse.passage.lic.users.model.api.Contact; import org.eclipse.passage.lic.users.model.api.User; import org.eclipse.passage.lic.users.model.api.UserOrigin; import org.eclipse.passage.lic.users.model.meta.UsersPackage; import org.eclipse.passage.loc.internal.emf.DomainContentAdapter; -public class UsersDomainRegistryTracker extends DomainContentAdapter { +public class UsersDomainRegistryTracker extends DomainContentAdapter { public UsersDomainRegistryTracker(UserDomainRegistry registry) { super(registry); diff --git a/bundles/org.eclipse.passage.loc.users.core/src/org/eclipse/passage/loc/internal/users/core/UsersSelectionCommandAdvisor.java b/bundles/org.eclipse.passage.loc.users.core/src/org/eclipse/passage/loc/internal/users/core/UsersSelectionCommandAdvisor.java index 770c29761..bc651d9a0 100644 --- a/bundles/org.eclipse.passage.loc.users.core/src/org/eclipse/passage/loc/internal/users/core/UsersSelectionCommandAdvisor.java +++ b/bundles/org.eclipse.passage.loc.users.core/src/org/eclipse/passage/loc/internal/users/core/UsersSelectionCommandAdvisor.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2018, 2021 ArSysOp + * Copyright (c) 2018, 2024 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,16 +25,16 @@ @Component(property = { EditingDomainRegistryAccess.PROPERTY_DOMAIN_NAME + '=' + UsersPackage.eNAME }) public class UsersSelectionCommandAdvisor implements SelectionCommandAdvisor { - private UserRegistry userRegistry; + private UserRegistry users; @Reference public void bindDomainRegistry(UserRegistry registry) { - this.userRegistry = registry; + this.users = registry; } public void unbindDomainRegistry(UserRegistry registry) { - if (this.userRegistry == registry) { - this.userRegistry = null; + if (this.users == registry) { + this.users = null; } } @@ -51,14 +51,14 @@ public String getSelectionTitle(String classifier) { @Override public Iterable getSelectionInput(String classifier) { - if (userRegistry == null) { + if (users == null) { return Collections.emptyList(); } if (UsersPackage.eINSTANCE.getUserOrigin().getName().equals(classifier)) { - return userRegistry.getUserOrigins(); + return users.userOrigins(); } if (UsersPackage.eINSTANCE.getUser().getName().equals(classifier)) { - return userRegistry.getUsers(); + return users.users(); } return Collections.emptyList(); } diff --git a/bundles/org.eclipse.passage.loc.users.emfforms/viewmodels/User.view b/bundles/org.eclipse.passage.loc.users.emfforms/viewmodels/User.view index 6ecc38033..c5d31f8e0 100644 --- a/bundles/org.eclipse.passage.loc.users.emfforms/viewmodels/User.view +++ b/bundles/org.eclipse.passage.loc.users.emfforms/viewmodels/User.view @@ -1,20 +1,20 @@ - + - + - + - + @@ -22,12 +22,12 @@ - + - + @@ -35,32 +35,32 @@ - - + + - - + + - - + + - - + + - - + + diff --git a/bundles/org.eclipse.passage.loc.users.emfforms/viewmodels/UserGroup.view b/bundles/org.eclipse.passage.loc.users.emfforms/viewmodels/UserGroup.view index af1d3809e..369eff9bc 100644 --- a/bundles/org.eclipse.passage.loc.users.emfforms/viewmodels/UserGroup.view +++ b/bundles/org.eclipse.passage.loc.users.emfforms/viewmodels/UserGroup.view @@ -1,57 +1,57 @@ - + - + - + - + - + - - + + - - + + - - + + - - + + - - + + diff --git a/bundles/org.eclipse.passage.loc.users.emfforms/viewmodels/UserOrigin.view b/bundles/org.eclipse.passage.loc.users.emfforms/viewmodels/UserOrigin.view index 8caac1800..4440698cb 100644 --- a/bundles/org.eclipse.passage.loc.users.emfforms/viewmodels/UserOrigin.view +++ b/bundles/org.eclipse.passage.loc.users.emfforms/viewmodels/UserOrigin.view @@ -1,19 +1,19 @@ - + - + - + - + /org.eclipse.passage.lic.users.ecore/model/users.ecore diff --git a/bundles/org.eclipse.passage.loc.users.ui/src/org/eclipse/passage/loc/internal/users/ui/SelectUser.java b/bundles/org.eclipse.passage.loc.users.ui/src/org/eclipse/passage/loc/internal/users/ui/SelectUser.java index 11f10f4cf..6bc2ec59f 100644 --- a/bundles/org.eclipse.passage.loc.users.ui/src/org/eclipse/passage/loc/internal/users/ui/SelectUser.java +++ b/bundles/org.eclipse.passage.loc.users.ui/src/org/eclipse/passage/loc/internal/users/ui/SelectUser.java @@ -20,8 +20,7 @@ import org.eclipse.passage.lic.api.MandatoryService; import org.eclipse.passage.lic.jface.resource.LicensingImages; -import org.eclipse.passage.lic.users.UserDescriptor; -import org.eclipse.passage.lic.users.UserOriginDescriptor; +import org.eclipse.passage.lic.users.model.api.User; import org.eclipse.passage.lic.users.model.meta.UsersPackage; import org.eclipse.passage.loc.internal.users.UserRegistry; import org.eclipse.passage.loc.internal.users.ui.i18n.UsersUiMessages; @@ -35,23 +34,23 @@ * {@link Optional#empty()} * */ -public final class SelectUser extends SupplySelectRequest { +public final class SelectUser extends SupplySelectRequest { public SelectUser(MandatoryService context) { this(context, Optional.empty()); } - public SelectUser(MandatoryService context, Optional selection) { + public SelectUser(MandatoryService context, Optional selection) { super(context, selection); } @Override - public SelectRequest get() { - return new SelectRequest<>(UserDescriptor.class, domain(), input(), () -> initial, appearance()); + public SelectRequest get() { + return new SelectRequest<>(User.class, domain(), input(), () -> initial, appearance()); } - private Supplier> input() { - return () -> StreamSupport.stream(context.get(UserRegistry.class).getUsers().spliterator(), false)// + private Supplier> input() { + return () -> StreamSupport.stream(context.get(UserRegistry.class).users().spliterator(), false)// .collect(Collectors.toList()); } diff --git a/bundles/org.eclipse.passage.loc.users.ui/src/org/eclipse/passage/loc/internal/users/ui/SelectUserOrigin.java b/bundles/org.eclipse.passage.loc.users.ui/src/org/eclipse/passage/loc/internal/users/ui/SelectUserOrigin.java index 0ed99f4d3..d0d09f251 100644 --- a/bundles/org.eclipse.passage.loc.users.ui/src/org/eclipse/passage/loc/internal/users/ui/SelectUserOrigin.java +++ b/bundles/org.eclipse.passage.loc.users.ui/src/org/eclipse/passage/loc/internal/users/ui/SelectUserOrigin.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2020, 2021 ArSysOp + * Copyright (c) 2020, 2024 ArSysOp * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at @@ -18,7 +18,7 @@ import org.eclipse.passage.lic.api.MandatoryService; import org.eclipse.passage.lic.jface.resource.LicensingImages; -import org.eclipse.passage.lic.users.UserOriginDescriptor; +import org.eclipse.passage.lic.users.model.api.UserOrigin; import org.eclipse.passage.lic.users.model.meta.UsersPackage; import org.eclipse.passage.loc.internal.users.UserRegistry; import org.eclipse.passage.loc.internal.users.ui.i18n.UsersUiMessages; @@ -27,23 +27,23 @@ import org.eclipse.passage.loc.jface.dialogs.Appearance; /** - * Creates {@link SelectRequest} for {@link UserOriginDescriptor} from the given + * Creates {@link SelectRequest} for {@link UserOrigin} from the given * {@link MandatoryService}. * */ -public final class SelectUserOrigin extends SupplySelectRequest { +public final class SelectUserOrigin extends SupplySelectRequest { public SelectUserOrigin(MandatoryService context) { super(context); } @Override - public SelectRequest get() { - return new SelectRequest<>(UserOriginDescriptor.class, domain(), input(), appearance()); + public SelectRequest get() { + return new SelectRequest<>(UserOrigin.class, domain(), input(), appearance()); } - private Supplier> input() { - return () -> StreamSupport.stream(context.get(UserRegistry.class).getUserOrigins().spliterator(), false)// + private Supplier> input() { + return () -> StreamSupport.stream(context.get(UserRegistry.class).userOrigins().spliterator(), false)// .collect(Collectors.toList()); } diff --git a/bundles/org.eclipse.passage.loc.users.ui/src/org/eclipse/passage/loc/internal/users/ui/SelectUsers.java b/bundles/org.eclipse.passage.loc.users.ui/src/org/eclipse/passage/loc/internal/users/ui/SelectUsers.java index d5ccf687f..b5ab484a2 100644 --- a/bundles/org.eclipse.passage.loc.users.ui/src/org/eclipse/passage/loc/internal/users/ui/SelectUsers.java +++ b/bundles/org.eclipse.passage.loc.users.ui/src/org/eclipse/passage/loc/internal/users/ui/SelectUsers.java @@ -22,8 +22,7 @@ import org.eclipse.passage.lic.api.MandatoryService; import org.eclipse.passage.lic.jface.resource.LicensingImages; -import org.eclipse.passage.lic.users.UserDescriptor; -import org.eclipse.passage.lic.users.UserOriginDescriptor; +import org.eclipse.passage.lic.users.model.api.User; import org.eclipse.passage.lic.users.model.meta.UsersPackage; import org.eclipse.passage.loc.internal.users.UserRegistry; import org.eclipse.passage.loc.internal.users.ui.i18n.UsersUiMessages; @@ -32,28 +31,28 @@ import org.eclipse.passage.loc.jface.dialogs.Appearance; /** - * Selects or creates {@link UserOriginDescriptor}. Will return either - * {@link Optional} with selected/created {@link UserOriginDescriptor} or + * Selects or creates {@link User}. Will return either + * {@link Optional} with selected/created {@link User} or * {@link Optional#empty()} * */ -public final class SelectUsers extends SupplySelectRequest { +public final class SelectUsers extends SupplySelectRequest { public SelectUsers(MandatoryService context) { this(context, Collections.emptyList()); } - public SelectUsers(MandatoryService context, Collection selection) { + public SelectUsers(MandatoryService context, Collection selection) { super(context, selection); } @Override - public SelectRequest get() { - return new SelectRequest<>(UserDescriptor.class, domain(), input(), () -> initial, appearance()); + public SelectRequest get() { + return new SelectRequest<>(User.class, domain(), input(), () -> initial, appearance()); } - private Supplier> input() { - return () -> StreamSupport.stream(context.get(UserRegistry.class).getUsers().spliterator(), false)// + private Supplier> input() { + return () -> StreamSupport.stream(context.get(UserRegistry.class).users().spliterator(), false)// .collect(Collectors.toList()); } diff --git a/bundles/org.eclipse.passage.loc.users.ui/src/org/eclipse/passage/loc/internal/users/ui/SupplyUserOrigin.java b/bundles/org.eclipse.passage.loc.users.ui/src/org/eclipse/passage/loc/internal/users/ui/SupplyUserOrigin.java index 122d0f818..feb7f9734 100644 --- a/bundles/org.eclipse.passage.loc.users.ui/src/org/eclipse/passage/loc/internal/users/ui/SupplyUserOrigin.java +++ b/bundles/org.eclipse.passage.loc.users.ui/src/org/eclipse/passage/loc/internal/users/ui/SupplyUserOrigin.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2020, 2021 ArSysOp + * Copyright (c) 2020, 2024 ArSysOp * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at @@ -15,11 +15,11 @@ import java.util.Optional; import org.eclipse.passage.lic.api.MandatoryService; -import org.eclipse.passage.lic.users.UserOriginDescriptor; +import org.eclipse.passage.lic.users.model.api.UserOrigin; import org.eclipse.passage.loc.internal.api.InstanceSupply; import org.eclipse.passage.loc.internal.workbench.SelectRoot; -public class SupplyUserOrigin implements InstanceSupply { +public class SupplyUserOrigin implements InstanceSupply { private final MandatoryService context; @@ -28,8 +28,8 @@ public SupplyUserOrigin(MandatoryService context) { } @Override - public Optional supply() { - return new SelectRoot(new SelectUserOrigin(context).get(), context).get(); + public Optional supply() { + return new SelectRoot<>(new SelectUserOrigin(context).get(), context).get(); } } diff --git a/bundles/org.eclipse.passage.loc.users.ui/src/org/eclipse/passage/loc/internal/users/ui/UsersInstanceSupply.java b/bundles/org.eclipse.passage.loc.users.ui/src/org/eclipse/passage/loc/internal/users/ui/UsersInstanceSupply.java index a257e8897..ef81c19a8 100644 --- a/bundles/org.eclipse.passage.loc.users.ui/src/org/eclipse/passage/loc/internal/users/ui/UsersInstanceSupply.java +++ b/bundles/org.eclipse.passage.loc.users.ui/src/org/eclipse/passage/loc/internal/users/ui/UsersInstanceSupply.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2020, 2021 ArSysOp + * Copyright (c) 2020, 2024 ArSysOp * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at @@ -15,7 +15,7 @@ import java.util.Optional; import org.eclipse.passage.lic.api.MandatoryService; -import org.eclipse.passage.lic.users.UserOriginDescriptor; +import org.eclipse.passage.lic.users.model.api.UserOrigin; import org.eclipse.passage.loc.internal.api.ClassSupply; import org.eclipse.passage.loc.internal.api.InstanceSupply; import org.osgi.service.component.annotations.Component; @@ -25,7 +25,7 @@ public final class UsersInstanceSupply implements ClassSupply { @Override public Optional> find(Class clazz, MandatoryService context) { - if (UserOriginDescriptor.class.isAssignableFrom(clazz)) { + if (UserOrigin.class.isAssignableFrom(clazz)) { return Optional.of(new SupplyUserOrigin(context)); } return Optional.empty(); diff --git a/tests/org.eclipse.passage.lic.users.model.tests/src/org/eclipse/passage/lic/users/model/tests/UsersClassMetadataTest.java b/tests/org.eclipse.passage.lic.users.model.tests/src/org/eclipse/passage/lic/users/model/tests/UsersClassMetadataTest.java index bc7cf72ca..1c4b856fe 100644 --- a/tests/org.eclipse.passage.lic.users.model.tests/src/org/eclipse/passage/lic/users/model/tests/UsersClassMetadataTest.java +++ b/tests/org.eclipse.passage.lic.users.model.tests/src/org/eclipse/passage/lic/users/model/tests/UsersClassMetadataTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2020 ArSysOp + * Copyright (c) 2020, 2024 ArSysOp * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at @@ -15,8 +15,6 @@ import static org.junit.Assert.assertTrue; import org.eclipse.passage.lic.internal.users.model.UsersClassMetadata; -import org.eclipse.passage.lic.users.UserDescriptor; -import org.eclipse.passage.lic.users.UserOriginDescriptor; import org.eclipse.passage.lic.users.model.api.User; import org.eclipse.passage.lic.users.model.api.UserOrigin; import org.junit.Test; @@ -31,13 +29,11 @@ public UsersClassMetadataTest() { @Test public void userOriginMetadata() { - assertTrue(metadata.find(UserOriginDescriptor.class).isPresent()); assertTrue(metadata.find(UserOrigin.class).isPresent()); } @Test public void userMetadata() { - assertTrue(metadata.find(UserDescriptor.class).isPresent()); assertTrue(metadata.find(User.class).isPresent()); } diff --git a/tests/org.eclipse.passage.loc.report.core.tests/src/org/eclipse/passage/loc/report/internal/core/FakeUserRegistry.java b/tests/org.eclipse.passage.loc.report.core.tests/src/org/eclipse/passage/loc/report/internal/core/FakeUserRegistry.java index 1ed2a7a4a..385fbeedf 100644 --- a/tests/org.eclipse.passage.loc.report.core.tests/src/org/eclipse/passage/loc/report/internal/core/FakeUserRegistry.java +++ b/tests/org.eclipse.passage.loc.report.core.tests/src/org/eclipse/passage/loc/report/internal/core/FakeUserRegistry.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2021 ArSysOp + * Copyright (c) 2021, 2024 ArSysOp * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at @@ -12,41 +12,42 @@ *******************************************************************************/ package org.eclipse.passage.loc.report.internal.core; +import java.util.Collection; import java.util.List; +import java.util.Optional; -import org.eclipse.passage.lic.users.UserDescriptor; -import org.eclipse.passage.lic.users.UserOriginDescriptor; +import org.eclipse.passage.lic.users.model.api.User; +import org.eclipse.passage.lic.users.model.api.UserOrigin; import org.eclipse.passage.loc.internal.users.UserRegistry; final class FakeUserRegistry implements UserRegistry { - private final List users; + private final List users; - FakeUserRegistry(List users) { + FakeUserRegistry(List users) { this.users = users; } @Override - public Iterable getUserOrigins() { + public Collection userOrigins() { throw new UnsupportedOperationException(); } @Override - public UserOriginDescriptor getUserOrigin(String userOriginId) { + public Optional userOrigin(String userOriginId) { throw new UnsupportedOperationException(); } @Override - public Iterable getUsers() { + public Collection users() { return users; } @Override - public UserDescriptor getUser(String id) { + public Optional user(String id) { return users.stream() // .filter(user -> user.getIdentifier().equals(id)) // - .findFirst() // - .get(); + .findFirst(); } } diff --git a/tests/org.eclipse.passage.loc.report.core.tests/src/org/eclipse/passage/loc/report/internal/core/TestData.java b/tests/org.eclipse.passage.loc.report.core.tests/src/org/eclipse/passage/loc/report/internal/core/TestData.java index c3bfa700d..926bd1138 100644 --- a/tests/org.eclipse.passage.loc.report.core.tests/src/org/eclipse/passage/loc/report/internal/core/TestData.java +++ b/tests/org.eclipse.passage.loc.report.core.tests/src/org/eclipse/passage/loc/report/internal/core/TestData.java @@ -17,8 +17,6 @@ import org.eclipse.passage.lic.internal.users.model.EmptyUser; import org.eclipse.passage.lic.licenses.model.api.LicensePlan; import org.eclipse.passage.lic.licenses.model.meta.LicensesFactory; -import org.eclipse.passage.lic.users.UserDescriptor; -import org.eclipse.passage.lic.users.UserOriginDescriptor; import org.eclipse.passage.lic.users.model.api.User; import org.eclipse.passage.lic.users.model.api.UserOrigin; import org.eclipse.passage.lic.users.model.meta.UsersFactory; @@ -31,7 +29,7 @@ public abstract class TestData> { public abstract S storage(); - protected final UserDescriptor user(String id, String email, String name) { + protected final User user(String id, String email, String name) { User user = new EmptyUser().get(); user.setIdentifier(id); user.getContact().setEmail(email); @@ -39,7 +37,7 @@ protected final UserDescriptor user(String id, String email, String name) { return user; } - protected final UserOriginDescriptor company(String[] data) { + protected final UserOrigin company(String[] data) { UserOrigin company = UsersFactory.eINSTANCE.createUserOrigin(); company.setName(data[0]); return company; diff --git a/tests/org.eclipse.passage.loc.report.core.tests/src/org/eclipse/passage/loc/report/internal/core/license/TestLicenses.java b/tests/org.eclipse.passage.loc.report.core.tests/src/org/eclipse/passage/loc/report/internal/core/license/TestLicenses.java index abfbf78b4..4518cd257 100644 --- a/tests/org.eclipse.passage.loc.report.core.tests/src/org/eclipse/passage/loc/report/internal/core/license/TestLicenses.java +++ b/tests/org.eclipse.passage.loc.report.core.tests/src/org/eclipse/passage/loc/report/internal/core/license/TestLicenses.java @@ -27,8 +27,8 @@ import org.eclipse.passage.lic.internal.licenses.model.EmptyPersonalLicensePack; import org.eclipse.passage.lic.licenses.model.api.LicensePlan; import org.eclipse.passage.lic.licenses.model.api.PersonalLicensePack; -import org.eclipse.passage.lic.users.UserDescriptor; -import org.eclipse.passage.lic.users.UserOriginDescriptor; +import org.eclipse.passage.lic.users.model.api.User; +import org.eclipse.passage.lic.users.model.api.UserOrigin; import org.eclipse.passage.loc.report.internal.core.FakeLicenseRegistry; import org.eclipse.passage.loc.report.internal.core.TestData; @@ -36,8 +36,8 @@ abstract class TestLicenses extends TestData { protected List plans = Collections.emptyList(); - protected List users = Collections.emptyList(); - protected List companies = Collections.emptyList(); + protected List users = Collections.emptyList(); + protected List companies = Collections.emptyList(); protected final Date from; protected final Date to; @@ -65,7 +65,7 @@ protected LicensePlan plan(String id) { .get(); } - protected Optional user(String segment) { + protected Optional user(String segment) { return users.stream()// .filter(user -> user.getContact().getEmail().contains(segment))// .findFirst(); @@ -134,9 +134,9 @@ protected void initData() { } private void issueLicenses() { - UserDescriptor evan = user("evan").get(); //$NON-NLS-1$ - UserDescriptor dorothea = user("dorothea").get(); //$NON-NLS-1$ - UserDescriptor zena = user("zena").get(); //$NON-NLS-1$ + User evan = user("evan").get(); //$NON-NLS-1$ + User dorothea = user("dorothea").get(); //$NON-NLS-1$ + User zena = user("zena").get(); //$NON-NLS-1$ LicensePlan planA = plan("plan-a"); //$NON-NLS-1$ LicensePlan planB = plan("plan-b"); //$NON-NLS-1$ issuePersonal(planA, evan, new MovedNow(date -> date.plus(2, ChronoUnit.MONTHS)).get()); @@ -169,7 +169,7 @@ public Set csv() { header(false))); } - private void issuePersonal(LicensePlan plan, UserDescriptor user, Date issued) { + private void issuePersonal(LicensePlan plan, User user, Date issued) { LicensedProduct product = new BaseLicensedProduct("pop", "1.0.1"); //$NON-NLS-1$ //$NON-NLS-2$ PersonalLicensePack pack = new EmptyPersonalLicensePack().get(); pack.getLicense().setPlan(plan.getIdentifier()); diff --git a/tests/org.eclipse.passage.loc.report.core.tests/src/org/eclipse/passage/loc/report/internal/core/user/FakeCustomersBase.java b/tests/org.eclipse.passage.loc.report.core.tests/src/org/eclipse/passage/loc/report/internal/core/user/FakeCustomersBase.java index b1beccbc2..e6af58af3 100644 --- a/tests/org.eclipse.passage.loc.report.core.tests/src/org/eclipse/passage/loc/report/internal/core/user/FakeCustomersBase.java +++ b/tests/org.eclipse.passage.loc.report.core.tests/src/org/eclipse/passage/loc/report/internal/core/user/FakeCustomersBase.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2019, 2021 ArSysOp + * Copyright (c) 2019, 2024 ArSysOp * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at @@ -14,8 +14,8 @@ import java.util.Set; -import org.eclipse.passage.lic.users.UserDescriptor; -import org.eclipse.passage.lic.users.UserOriginDescriptor; +import org.eclipse.passage.lic.users.model.api.User; +import org.eclipse.passage.lic.users.model.api.UserOrigin; final class FakeCustomersBase implements CustomerStorage { @@ -26,12 +26,12 @@ final class FakeCustomersBase implements CustomerStorage { } @Override - public Set personsUsedProducts(Set products) { + public Set personsUsedProducts(Set products) { return customers.users(); } @Override - public Set companiesUsedProducts(Set products) { + public Set companiesUsedProducts(Set products) { return customers.companies(); } diff --git a/tests/org.eclipse.passage.loc.report.core.tests/src/org/eclipse/passage/loc/report/internal/core/user/TestCustomers.java b/tests/org.eclipse.passage.loc.report.core.tests/src/org/eclipse/passage/loc/report/internal/core/user/TestCustomers.java index d461411fc..004e78cfe 100644 --- a/tests/org.eclipse.passage.loc.report.core.tests/src/org/eclipse/passage/loc/report/internal/core/user/TestCustomers.java +++ b/tests/org.eclipse.passage.loc.report.core.tests/src/org/eclipse/passage/loc/report/internal/core/user/TestCustomers.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2019, 2020 ArSysOp + * Copyright (c) 2019, 2024 ArSysOp * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at @@ -17,8 +17,8 @@ import java.util.stream.Collectors; import java.util.stream.Stream; -import org.eclipse.passage.lic.users.UserDescriptor; -import org.eclipse.passage.lic.users.UserOriginDescriptor; +import org.eclipse.passage.lic.users.model.api.User; +import org.eclipse.passage.lic.users.model.api.UserOrigin; import org.eclipse.passage.loc.report.internal.core.TestData; abstract class TestCustomers extends TestData { @@ -31,13 +31,13 @@ protected TestCustomers(String[][] persons, String[][] companies) { this.companies = companies; } - Set users() { + Set users() { return Arrays.stream(persons)// .map(this::userWithUsage)// .collect(Collectors.toSet()); } - Set companies() { + Set companies() { return Arrays.stream(companies)// .map(this::company)// .collect(Collectors.toSet()); @@ -59,7 +59,7 @@ public CustomerStorage storage() { return new FakeCustomersBase(this); } - private UserDescriptor userWithUsage(String[] data) { + private User userWithUsage(String[] data) { return user("", data[2], data[0]); //$NON-NLS-1$ }