From 506435d5b7f304802126a506341b09a3c47eceb6 Mon Sep 17 00:00:00 2001 From: eparovyshnaya Date: Tue, 27 Oct 2020 11:22:17 +0300 Subject: [PATCH] Bug 567032 issue floating license configuration wizard Extend LicenseOperatorService further to facilitate floating licenses issuing. Signed-off-by: eparovyshnaya --- .../META-INF/MANIFEST.MF | 5 +- .../META-INF/MANIFEST.MF | 6 +- .../META-INF/MANIFEST.MF | 8 +- .../internal/api/FloatingLicenseRequest.java | 22 ++- .../internal/api/IssuedFloatingLicense.java | 17 ++ .../internal/api/OperatorLicenseService.java | 24 ++- .../META-INF/MANIFEST.MF | 3 +- .../META-INF/MANIFEST.MF | 3 +- .../core/FloatingLicensePackFromRequest.java | 154 ++++++++++++++++++ .../core/LicenseOperatorServiceImpl.java | 19 ++- .../core/PersonalLicensePackFromRequest.java | 9 +- .../core/request/FLoatingLicenseData.java | 26 ++- .../META-INF/MANIFEST.MF | 2 +- .../META-INF/MANIFEST.MF | 6 +- 14 files changed, 270 insertions(+), 34 deletions(-) create mode 100644 bundles/org.eclipse.passage.loc.api/src/org/eclipse/passage/loc/internal/api/IssuedFloatingLicense.java create mode 100644 bundles/org.eclipse.passage.loc.licenses.core/src/org/eclipse/passage/loc/internal/licenses/core/FloatingLicensePackFromRequest.java diff --git a/bundles/org.eclipse.passage.lic.api/META-INF/MANIFEST.MF b/bundles/org.eclipse.passage.lic.api/META-INF/MANIFEST.MF index 62e9840d5..452b94bf9 100644 --- a/bundles/org.eclipse.passage.lic.api/META-INF/MANIFEST.MF +++ b/bundles/org.eclipse.passage.lic.api/META-INF/MANIFEST.MF @@ -29,7 +29,10 @@ Export-Package: org.eclipse.passage.lic.internal.api; org.eclipse.passage.lbc.base, org.eclipse.passage.lic.base, org.eclipse.passage.lic.json, - org.eclipse.passage.lic.hc", + org.eclipse.passage.lic.hc, + org.eclipse.passage.lic.api, + org.eclipse.passage.loc.api, + org.eclipse.passage.loc.licenses.core", org.eclipse.passage.lic.internal.api.conditions.evaluation;x-internal:=true, org.eclipse.passage.lic.internal.api.conditions.mining; x-friends:="org.eclipse.passage.lbc.api, diff --git a/bundles/org.eclipse.passage.lic.base/META-INF/MANIFEST.MF b/bundles/org.eclipse.passage.lic.base/META-INF/MANIFEST.MF index 2fd99e389..0a80479a2 100644 --- a/bundles/org.eclipse.passage.lic.base/META-INF/MANIFEST.MF +++ b/bundles/org.eclipse.passage.lic.base/META-INF/MANIFEST.MF @@ -15,7 +15,11 @@ Export-Package: org.eclipse.passage.lic.internal.base; org.eclipse.passage.lic.jface, org.eclipse.passage.lic.base.tests", org.eclipse.passage.lic.internal.base.access;x-internal:=true, - org.eclipse.passage.lic.internal.base.conditions;x-friends:="org.eclipse.passage.lbc.base,org.eclipse.passage.lic.json,org.eclipse.passage.lic.hc", + org.eclipse.passage.lic.internal.base.conditions; + x-friends:="org.eclipse.passage.lbc.base, + org.eclipse.passage.lic.json, + org.eclipse.passage.lic.hc, + org.eclipse.passage.loc.licenses.core", org.eclipse.passage.lic.internal.base.conditions.evaluation;x-internal:=true, org.eclipse.passage.lic.internal.base.conditions.mining;x-friends:="org.eclipse.passage.lic.jface,org.eclipse.passage.lic.hc", org.eclipse.passage.lic.internal.base.diagnostic;x-friends:="org.eclipse.passage.lic.equinox.tests,org.eclipse.passage.lic.equinox,org.eclipse.passage.loc.dashboard.ui", diff --git a/bundles/org.eclipse.passage.lic.floating.model/META-INF/MANIFEST.MF b/bundles/org.eclipse.passage.lic.floating.model/META-INF/MANIFEST.MF index 573337cdc..72c4bc1e7 100644 --- a/bundles/org.eclipse.passage.lic.floating.model/META-INF/MANIFEST.MF +++ b/bundles/org.eclipse.passage.lic.floating.model/META-INF/MANIFEST.MF @@ -12,9 +12,13 @@ Require-Bundle: org.eclipse.core.runtime;bundle-version="0.0.0";x-installation:= org.eclipse.emf.ecore;bundle-version="0.0.0";visibility:=reexport, org.eclipse.passage.lic.emf.meta;bundle-version="0.6.0", org.eclipse.passage.lic.floating;bundle-version="0.0.0";visibility:=reexport -Export-Package: org.eclipse.passage.lic.floating.model.api;x-friends:="org.eclipse.passage.lic.floating.edit,org.eclipse.passage.loc.dashboard.ui,org.eclipse.passage.loc.api", +Export-Package: org.eclipse.passage.lic.floating.model.api; + x-friends:="org.eclipse.passage.lic.floating.edit, + org.eclipse.passage.loc.dashboard.ui, + org.eclipse.passage.loc.api, + org.eclipse.passage.loc.licenses.core", org.eclipse.passage.lic.floating.model.impl;x-internal:=true, - org.eclipse.passage.lic.floating.model.meta;x-friends:="org.eclipse.passage.lic.floating.e4.ui,org.eclipse.passage.lic.floating.edit", + org.eclipse.passage.lic.floating.model.meta;x-friends:="org.eclipse.passage.lic.floating.e4.ui,org.eclipse.passage.lic.floating.edit,org.eclipse.passage.loc.licenses.core", org.eclipse.passage.lic.floating.model.util;x-friends:="org.eclipse.passage.lic.floating.edit", org.eclipse.passage.lic.internal.floating.model;x-friends:="org.eclipse.passage.loc.dashboard.ui" Bundle-ClassPath: . diff --git a/bundles/org.eclipse.passage.loc.api/src/org/eclipse/passage/loc/internal/api/FloatingLicenseRequest.java b/bundles/org.eclipse.passage.loc.api/src/org/eclipse/passage/loc/internal/api/FloatingLicenseRequest.java index 6f32fa235..8283faaf1 100644 --- a/bundles/org.eclipse.passage.loc.api/src/org/eclipse/passage/loc/internal/api/FloatingLicenseRequest.java +++ b/bundles/org.eclipse.passage.loc.api/src/org/eclipse/passage/loc/internal/api/FloatingLicenseRequest.java @@ -14,6 +14,8 @@ import java.util.Collection; +import org.eclipse.passage.lic.internal.api.conditions.EvaluationInstructions; + /** * Collection of all the data required to issue a floating license pack. */ @@ -26,16 +28,10 @@ public interface FloatingLicenseRequest extends GeneralLicenseRequest { Collection users(); /** - * Type of licensing condition for a User identified by the given - * {@code user} value. - */ - String conditionType(String user); - - /** - * Condition expression for a User identified by the given + * Licensing condition for a User identified by the given * {@code user} value. */ - String conditionExpression(String user); + EvaluationInstructions userAuthentication(String user); /** * Default capacity for all the FeatureGrants defined in this @@ -43,4 +39,14 @@ public interface FloatingLicenseRequest extends GeneralLicenseRequest { */ int defaultCapacity(); + /** + * {@code FloatingServer} is to be authenticated. + */ + EvaluationInstructions serverAuthentication(); + + /** + * {@code FloatingServer} is to be named for convenience. + */ + String serverName(); + } diff --git a/bundles/org.eclipse.passage.loc.api/src/org/eclipse/passage/loc/internal/api/IssuedFloatingLicense.java b/bundles/org.eclipse.passage.loc.api/src/org/eclipse/passage/loc/internal/api/IssuedFloatingLicense.java new file mode 100644 index 000000000..dc40931b8 --- /dev/null +++ b/bundles/org.eclipse.passage.loc.api/src/org/eclipse/passage/loc/internal/api/IssuedFloatingLicense.java @@ -0,0 +1,17 @@ +/******************************************************************************* + * Copyright (c) 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.loc.internal.api; + +public interface IssuedFloatingLicense { + +} diff --git a/bundles/org.eclipse.passage.loc.api/src/org/eclipse/passage/loc/internal/api/OperatorLicenseService.java b/bundles/org.eclipse.passage.loc.api/src/org/eclipse/passage/loc/internal/api/OperatorLicenseService.java index 011a84585..b67d7df66 100644 --- a/bundles/org.eclipse.passage.loc.api/src/org/eclipse/passage/loc/internal/api/OperatorLicenseService.java +++ b/bundles/org.eclipse.passage.loc.api/src/org/eclipse/passage/loc/internal/api/OperatorLicenseService.java @@ -12,6 +12,7 @@ *******************************************************************************/ package org.eclipse.passage.loc.internal.api; +import org.eclipse.passage.lic.floating.model.api.FloatingLicensePack; import org.eclipse.passage.lic.internal.api.ServiceInvocationResult; import org.eclipse.passage.lic.licenses.LicensePackDescriptor; @@ -23,13 +24,26 @@ public interface OperatorLicenseService { /** - * - * @param request - * @return the License Pack to be verified and issued - * + * Create new instance of Personal License Pack to be verified and issued */ LicensePackDescriptor createLicensePack(PersonalLicenseRequest request); - ServiceInvocationResult issueLicensePack(PersonalLicenseRequest request, LicensePackDescriptor template); + /** + * Physically issue new Personal License Pack according to all the data supplied + * by the given data. + */ + ServiceInvocationResult issueLicensePack(PersonalLicenseRequest request, + LicensePackDescriptor template); + /** + * Create new instance of Floating License Pack to be verified and issued + */ + FloatingLicensePack createFloatingLicensePack(FloatingLicenseRequest request); + + /** + * Physically issue new Floating License Pack according to all the data supplied + * by the given data. + */ + ServiceInvocationResult issueFloatingLicensePack(FloatingLicenseRequest request, + FloatingLicensePack template); } diff --git a/bundles/org.eclipse.passage.loc.dashboard.ui/META-INF/MANIFEST.MF b/bundles/org.eclipse.passage.loc.dashboard.ui/META-INF/MANIFEST.MF index dec1f8af3..b6ad2a57c 100644 --- a/bundles/org.eclipse.passage.loc.dashboard.ui/META-INF/MANIFEST.MF +++ b/bundles/org.eclipse.passage.loc.dashboard.ui/META-INF/MANIFEST.MF @@ -25,7 +25,8 @@ Require-Bundle: org.eclipse.e4.core.di.annotations;bundle-version="0.0.0", org.eclipse.passage.loc.licenses.core;bundle-version="0.6.0", org.eclipse.passage.loc.products.ui;bundle-version="0.0.0", org.eclipse.passage.loc.users.ui;bundle-version="0.0.0", - org.eclipse.passage.loc.licenses.ui;bundle-version="0.0.0" + org.eclipse.passage.loc.licenses.ui;bundle-version="0.0.0", + org.eclipse.passage.lic.floating.model;bundle-version="0.1.0" Import-Package: javax.annotation;version="1.0.0";resolution:=optional, javax.inject;version="1.0.0" Export-Package: org.eclipse.passage.loc.dashboard.ui;x-internal:=true, diff --git a/bundles/org.eclipse.passage.loc.licenses.core/META-INF/MANIFEST.MF b/bundles/org.eclipse.passage.loc.licenses.core/META-INF/MANIFEST.MF index 6d4921c8a..2f7f836bf 100644 --- a/bundles/org.eclipse.passage.loc.licenses.core/META-INF/MANIFEST.MF +++ b/bundles/org.eclipse.passage.loc.licenses.core/META-INF/MANIFEST.MF @@ -16,7 +16,8 @@ Require-Bundle: org.eclipse.osgi.services;bundle-version="0.0.0", org.eclipse.passage.lic.users.model;bundle-version="1.0.0", org.eclipse.passage.loc.api;bundle-version="0.0.0", org.eclipse.passage.loc.products.core;bundle-version="0.6.0", - org.eclipse.passage.loc.users.core;bundle-version="1.0.0" + org.eclipse.passage.loc.users.core;bundle-version="1.0.0", + org.eclipse.passage.lic.floating.model;bundle-version="0.1.0" Export-Package: org.eclipse.passage.loc.internal.licenses;x-friends:="org.eclipse.passage.loc.licenses.emfforms,org.eclipse.passage.loc.licenses.ui,org.eclipse.passage.loc.dashboard.ui", org.eclipse.passage.loc.internal.licenses.core;x-friends:="org.eclipse.passage.loc.dashboard.ui", org.eclipse.passage.loc.internal.licenses.core.i18n;x-internal:=true, 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 new file mode 100644 index 000000000..1631671c6 --- /dev/null +++ b/bundles/org.eclipse.passage.loc.licenses.core/src/org/eclipse/passage/loc/internal/licenses/core/FloatingLicensePackFromRequest.java @@ -0,0 +1,154 @@ +/******************************************************************************* + * Copyright (c) 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.loc.internal.licenses.core; + +import java.util.Collection; +import java.util.Date; +import java.util.concurrent.atomic.AtomicInteger; +import java.util.function.Supplier; +import java.util.stream.Collectors; +import java.util.stream.StreamSupport; + +import org.eclipse.passage.lic.floating.model.api.EvaluationInstructions; +import org.eclipse.passage.lic.floating.model.api.FeatureGrant; +import org.eclipse.passage.lic.floating.model.api.FloatingLicensePack; +import org.eclipse.passage.lic.floating.model.api.FloatingServer; +import org.eclipse.passage.lic.floating.model.api.LicenseRequisites; +import org.eclipse.passage.lic.floating.model.api.ProductRef; +import org.eclipse.passage.lic.floating.model.api.UserGrant; +import org.eclipse.passage.lic.floating.model.api.ValidityPeriod; +import org.eclipse.passage.lic.floating.model.api.ValidityPeriodClosed; +import org.eclipse.passage.lic.floating.model.api.VersionMatch; +import org.eclipse.passage.lic.floating.model.meta.FloatingFactory; +import org.eclipse.passage.lic.licenses.LicensePlanDescriptor; +import org.eclipse.passage.lic.licenses.LicensePlanFeatureDescriptor; +import org.eclipse.passage.lic.users.UserDescriptor; +import org.eclipse.passage.loc.internal.api.FloatingLicenseRequest; +import org.eclipse.passage.loc.internal.licenses.LicenseRegistry; +import org.eclipse.passage.loc.internal.users.UserRegistry; + +final class FloatingLicensePackFromRequest implements Supplier { + + private final FloatingLicenseRequest request; + private final LicenseRegistry licenses; + private final UserRegistry users; + + FloatingLicensePackFromRequest(FloatingLicenseRequest request, LicenseRegistry licenses, UserRegistry users) { + this.request = request; + this.licenses = licenses; + this.users = users; + } + + @Override + public FloatingLicensePack get() { + FloatingLicensePack pack = FloatingFactory.eINSTANCE.createFloatingLicensePack(); + pack.setLicense(license()); + pack.setHost(host()); + userGrants().forEach(pack.getUsers()::add); + featureGrants(pack).forEach(pack.getFeatures()::add); + return pack; + } + + private FloatingServer host() { + FloatingServer server = FloatingFactory.eINSTANCE.createFloatingServer(); + server.setIdentifier(request.serverName()); + server.setAuthentication(serverAuthentication()); + return server; + } + + private EvaluationInstructions serverAuthentication() { + EvaluationInstructions auth = FloatingFactory.eINSTANCE.createEvaluationInstructions(); + org.eclipse.passage.lic.internal.api.conditions.EvaluationInstructions requested = // + request.serverAuthentication(); + auth.setExpression(requested.expression()); + auth.setType(requested.type().identifier()); + return auth; + } + + private LicenseRequisites license() { + LicenseRequisites license = FloatingFactory.eINSTANCE.createLicenseRequisites(); + license.setCompany(company()); + license.setIdentifier(request.identifier()); + license.setIssueDate(new Date()); + license.setPlan(request.plan()); + license.setProduct(product()); + license.setValid(period()); + return license; + } + + private String company() { + return users.getUser(request.users().iterator().next()).getUserOrigin().getIdentifier(); + } + + private ValidityPeriod period() { + ValidityPeriodClosed period = FloatingFactory.eINSTANCE.createValidityPeriodClosed(); + period.setFrom(request.validFrom()); + period.setUntil(request.validUntil()); + return period; + } + + private ProductRef product() { + ProductRef product = FloatingFactory.eINSTANCE.createProductRef(); + product.setProduct(request.productIdentifier()); + product.setVersion(request.productVersion()); + return product; + } + + private Collection userGrants() { + return request.users().stream()// + .map(users::getUser)// + .map(this::userGrant)// + .collect(Collectors.toSet()); + } + + private UserGrant userGrant(UserDescriptor user) { + UserGrant grant = FloatingFactory.eINSTANCE.createUserGrant(); + grant.setAuthentication(userAuthentication(user)); + grant.setUser(user.getIdentifier()); + return grant; + } + + private EvaluationInstructions userAuthentication(UserDescriptor user) { + EvaluationInstructions auth = FloatingFactory.eINSTANCE.createEvaluationInstructions(); + auth.setExpression(user.getPreferredConditionExpression()); + auth.setType(user.getPreferredConditionType()); + return auth; + } + + private Collection featureGrants(FloatingLicensePack pack) { + LicensePlanDescriptor plan = licenses.getLicensePlan(request.plan()); + AtomicInteger counter = new AtomicInteger(0); + return StreamSupport.stream(plan.getLicensePlanFeatures().spliterator(), false)// + .map(feature -> featureGrant(feature, pack, counter.getAndIncrement())) // + .collect(Collectors.toSet()); + } + + private FeatureGrant featureGrant(LicensePlanFeatureDescriptor feature, FloatingLicensePack pack, int no) { + FeatureGrant grant = FloatingFactory.eINSTANCE.createFeatureGrant(); + grant.setFeature(feature.getFeatureIdentifier()); + grant.setCapacity(request.defaultCapacity()); + grant.setIdentifier(String.format("%s#%d", request.identifier(), no)); //$NON-NLS-1$ + grant.setPack(pack); + grant.setValid(period()); + grant.setVersion(version(feature)); + return grant; + } + + private VersionMatch version(LicensePlanFeatureDescriptor feature) { + VersionMatch version = FloatingFactory.eINSTANCE.createVersionMatch(); + version.setVersion(feature.getMatchVersion()); + version.setRule(feature.getMatchRule()); + return version; + } + +} diff --git a/bundles/org.eclipse.passage.loc.licenses.core/src/org/eclipse/passage/loc/internal/licenses/core/LicenseOperatorServiceImpl.java b/bundles/org.eclipse.passage.loc.licenses.core/src/org/eclipse/passage/loc/internal/licenses/core/LicenseOperatorServiceImpl.java index 137f6326b..ac3d10636 100644 --- a/bundles/org.eclipse.passage.loc.licenses.core/src/org/eclipse/passage/loc/internal/licenses/core/LicenseOperatorServiceImpl.java +++ b/bundles/org.eclipse.passage.loc.licenses.core/src/org/eclipse/passage/loc/internal/licenses/core/LicenseOperatorServiceImpl.java @@ -16,9 +16,12 @@ import java.util.function.Supplier; import org.eclipse.osgi.service.environment.EnvironmentInfo; +import org.eclipse.passage.lic.floating.model.api.FloatingLicensePack; import org.eclipse.passage.lic.internal.api.ServiceInvocationResult; import org.eclipse.passage.lic.licenses.LicensePackDescriptor; import org.eclipse.passage.lic.licenses.model.api.LicensePack; +import org.eclipse.passage.loc.internal.api.FloatingLicenseRequest; +import org.eclipse.passage.loc.internal.api.IssuedFloatingLicense; import org.eclipse.passage.loc.internal.api.IssuedLicense; import org.eclipse.passage.loc.internal.api.OperatorLicenseService; import org.eclipse.passage.loc.internal.api.OperatorProductService; @@ -107,6 +110,11 @@ public void unbindProductOperatorService(OperatorProductService productService) } } + @Override + public LicensePack createLicensePack(PersonalLicenseRequest request) { + return new PersonalLicensePackFromRequest(request, licenseRegistry).get(); + } + @Override public ServiceInvocationResult issueLicensePack(PersonalLicenseRequest request, LicensePackDescriptor template) { @@ -120,8 +128,15 @@ public ServiceInvocationResult issueLicensePack(PersonalLicenseRe } @Override - public LicensePack createLicensePack(PersonalLicenseRequest request) { - return new PersonalLicensePackFromRequest(request, licenseRegistry).get(); + public FloatingLicensePack createFloatingLicensePack(FloatingLicenseRequest request) { + return new FloatingLicensePackFromRequest(request, licenseRegistry, userRegistry).get(); + } + + @Override + public ServiceInvocationResult issueFloatingLicensePack(FloatingLicenseRequest request, + FloatingLicensePack template) { + // TODO YTBD + return null; } } diff --git a/bundles/org.eclipse.passage.loc.licenses.core/src/org/eclipse/passage/loc/internal/licenses/core/PersonalLicensePackFromRequest.java b/bundles/org.eclipse.passage.loc.licenses.core/src/org/eclipse/passage/loc/internal/licenses/core/PersonalLicensePackFromRequest.java index d4e41d9f2..ee43fe168 100644 --- a/bundles/org.eclipse.passage.loc.licenses.core/src/org/eclipse/passage/loc/internal/licenses/core/PersonalLicensePackFromRequest.java +++ b/bundles/org.eclipse.passage.loc.licenses.core/src/org/eclipse/passage/loc/internal/licenses/core/PersonalLicensePackFromRequest.java @@ -24,12 +24,13 @@ import org.eclipse.passage.loc.internal.licenses.LicenseRegistry; final class PersonalLicensePackFromRequest implements Supplier { + private final PersonalLicenseRequest request; - private final LicenseRegistry registry; + private final LicenseRegistry licenses; - PersonalLicensePackFromRequest(PersonalLicenseRequest request, LicenseRegistry registry) { + PersonalLicensePackFromRequest(PersonalLicenseRequest request, LicenseRegistry licesnses) { this.request = request; - this.registry = registry; + this.licenses = licesnses; } @Override @@ -43,7 +44,7 @@ public LicensePack get() { pack.setProductVersion(request.productVersion()); String planIdentifier = request.plan(); pack.setPlanIdentifier(planIdentifier); - LicensePlanDescriptor plan = registry.getLicensePlan(planIdentifier); + LicensePlanDescriptor plan = licenses.getLicensePlan(planIdentifier); if (plan == null) { return pack; // FIXME: ServiceInvocationResult should probably be used } 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 4acc15299..4dc5a63e5 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 @@ -18,6 +18,9 @@ import java.util.Objects; import java.util.stream.Collectors; +import org.eclipse.passage.lic.internal.api.conditions.EvaluationInstructions; +import org.eclipse.passage.lic.internal.api.conditions.EvaluationType; +import org.eclipse.passage.lic.internal.base.conditions.BaseEvaluationInstructions; import org.eclipse.passage.lic.licenses.LicensePlanDescriptor; import org.eclipse.passage.lic.products.ProductVersionDescriptor; import org.eclipse.passage.lic.users.UserDescriptor; @@ -52,13 +55,11 @@ public Collection users() { } @Override - public String conditionType(String user) { - return user(user).getPreferredConditionType(); - } - - @Override - public String conditionExpression(String user) { - return user(user).getPreferredConditionExpression(); + public EvaluationInstructions userAuthentication(String user) { + UserDescriptor target = user(user); + return new BaseEvaluationInstructions(// + new EvaluationType.Of(target.getPreferredConditionExpression()), // + target.getPreferredConditionType()); } private UserDescriptor user(String identifier) { @@ -73,4 +74,15 @@ public int defaultCapacity() { return capacity; } + @Override + public EvaluationInstructions serverAuthentication() { + return null; + } + + @Override + public String serverName() { + // TODO Auto-generated method stub + return null; + } + } diff --git a/bundles/org.eclipse.passage.loc.report.core/META-INF/MANIFEST.MF b/bundles/org.eclipse.passage.loc.report.core/META-INF/MANIFEST.MF index 046593aa9..5ba67ed7e 100644 --- a/bundles/org.eclipse.passage.loc.report.core/META-INF/MANIFEST.MF +++ b/bundles/org.eclipse.passage.loc.report.core/META-INF/MANIFEST.MF @@ -16,6 +16,6 @@ Require-Bundle: org.apache.commons.csv;bundle-version="1.4.0", org.eclipse.passage.loc.users.core;bundle-version="1.0.0", org.eclipse.passage.loc.yars.api;bundle-version="0.1.0";visibility:=reexport Export-Package: org.eclipse.passage.loc.report.internal.core.license;x-internal:=true, - org.eclipse.passage.loc.report.internal.core.user;x-internal:=true + org.eclipse.passage.loc.report.internal.core.user;x-friends:="org.eclipse.passage.loc.report.core,org.eclipse.passage.loc.report.core.tests" Bundle-ActivationPolicy: lazy Service-Component: OSGI-INF/*.xml diff --git a/bundles/org.eclipse.passage.loc.users.core/META-INF/MANIFEST.MF b/bundles/org.eclipse.passage.loc.users.core/META-INF/MANIFEST.MF index f2742fbf9..68bfa5c3a 100644 --- a/bundles/org.eclipse.passage.loc.users.core/META-INF/MANIFEST.MF +++ b/bundles/org.eclipse.passage.loc.users.core/META-INF/MANIFEST.MF @@ -13,7 +13,11 @@ Require-Bundle: org.eclipse.osgi;bundle-version="0.0.0", org.eclipse.passage.lic.emf;bundle-version="0.0.0", org.eclipse.passage.lic.users.model;bundle-version="1.0.0";visibility:=reexport, org.eclipse.passage.loc.api;bundle-version="0.0.0" -Export-Package: org.eclipse.passage.loc.internal.users;x-friends:="org.eclipse.passage.loc.users.emfforms,org.eclipse.passage.loc.users.ui,org.eclipse.passage.loc.dashboard.ui", +Export-Package: org.eclipse.passage.loc.internal.users; + x-friends:="org.eclipse.passage.loc.users.emfforms, + org.eclipse.passage.loc.users.ui, + org.eclipse.passage.loc.dashboard.ui, + org.eclipse.passage.loc.licenses.core", org.eclipse.passage.loc.internal.users.core;x-internal:=true, org.eclipse.passage.loc.internal.users.core.i18n;x-internal:=true Bundle-ActivationPolicy: lazy