Skip to content

Commit

Permalink
Merge pull request #716 from eclipse-passage/572623-2
Browse files Browse the repository at this point in the history
572623 merge 'floating' feature into 'licenses'
  • Loading branch information
eparovyshnaya authored Apr 8, 2021
2 parents 071a9cf + e0a5200 commit c61528c
Show file tree
Hide file tree
Showing 106 changed files with 247 additions and 3,396 deletions.
3 changes: 1 addition & 2 deletions bundles/org.eclipse.passage.lbc.base/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Manifest-Version: 1.0
Automatic-Module-Name: org.eclipse.passage.lbc.base
Bundle-ManifestVersion: 2
Bundle-SymbolicName: org.eclipse.passage.lbc.base
Bundle-Version: 1.1.101.qualifier
Bundle-Version: 1.1.200.qualifier
Bundle-Name: %Bundle-Name
Bundle-Vendor: %Bundle-Vendor
Bundle-Copyright: %Bundle-Copyright
Expand All @@ -13,7 +13,6 @@ Require-Bundle: org.eclipse.osgi;bundle-version="0.0.0",
org.eclipse.passage.lic.licenses.model;bundle-version="0.0.0",
org.eclipse.emf.ecore.xmi;bundle-version="0.0.0",
org.eclipse.passage.lic.floating;bundle-version="0.1.0",
org.eclipse.passage.lic.floating.model;bundle-version="0.1.0",
org.eclipse.passage.lic.emf;bundle-version="1.0.100",
org.eclipse.passage.lic.oshi;bundle-version="1.0.1",
org.apache.logging.log4j;bundle-version="2.8.2",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@

import org.eclipse.emf.ecore.EObject;
import org.eclipse.passage.lbc.internal.base.api.RawRequest;
import org.eclipse.passage.lic.floating.model.api.GrantAcqisition;
import org.eclipse.passage.lic.floating.model.meta.FloatingPackage;
import org.eclipse.passage.lic.internal.api.LicensedProduct;
import org.eclipse.passage.lic.internal.api.LicensingException;
import org.eclipse.passage.lic.internal.base.io.MD5Hashes;
import org.eclipse.passage.lic.internal.base.io.PathKeyKeeper;
import org.eclipse.passage.lic.internal.emf.EObjectFromBytes;
import org.eclipse.passage.lic.internal.net.handle.ProductUserRequest;
import org.eclipse.passage.lic.internal.net.io.SafePayload;
import org.eclipse.passage.lic.licenses.model.api.GrantAcqisition;
import org.eclipse.passage.lic.licenses.model.meta.LicensesPackage;

public abstract class DecodedRequest<T extends EObject> {

Expand All @@ -52,7 +52,7 @@ private byte[] decoded(byte[] raw) throws LicensingException {
public static final class GrantAck extends DecodedRequest<GrantAcqisition> {

public GrantAck(RawRequest request) {
super(request, Collections.singletonMap(FloatingPackage.eNS_URI, FloatingPackage.eINSTANCE));
super(request, Collections.singletonMap(LicensesPackage.eNS_URI, LicensesPackage.eINSTANCE));
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
import java.util.Optional;
import java.util.function.Supplier;

import org.eclipse.passage.lic.floating.internal.model.net.ServerAuthenticationExpression;
import org.eclipse.passage.lic.floating.internal.model.net.ServerAuthenticationType;
import org.eclipse.passage.lic.internal.api.EvaluationInstructions;
import org.eclipse.passage.lic.internal.api.EvaluationType;
import org.eclipse.passage.lic.internal.base.conditions.BaseEvaluationInstructions;
import org.eclipse.passage.lic.internal.net.ServerAuthenticationExpression;
import org.eclipse.passage.lic.internal.net.ServerAuthenticationType;
import org.eclipse.passage.lic.internal.net.api.handle.NetRequest;

final class ServerAuthenticationInstructions implements Supplier<Optional<EvaluationInstructions>> {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2020 ArSysOp
* Copyright (c) 2020, 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
Expand All @@ -18,12 +18,12 @@
import java.util.function.Supplier;

import org.eclipse.passage.lbc.internal.base.api.Grants;
import org.eclipse.passage.lic.floating.model.api.FeatureGrant;
import org.eclipse.passage.lic.floating.model.api.GrantAcqisition;
import org.eclipse.passage.lic.internal.api.LicensedProduct;
import org.eclipse.passage.lic.internal.api.LicensingException;
import org.eclipse.passage.lic.internal.base.io.LicensingFolder;
import org.eclipse.passage.lic.internal.base.io.UserHomePath;
import org.eclipse.passage.lic.licenses.model.api.FeatureGrant;
import org.eclipse.passage.lic.licenses.model.api.GrantAcqisition;

public final class AcquiredGrants implements Grants {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2020 ArSysOp
* Copyright (c) 2020, 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
Expand All @@ -22,10 +22,10 @@

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.eclipse.passage.lic.floating.model.api.FeatureGrant;
import org.eclipse.passage.lic.floating.model.api.GrantAcqisition;
import org.eclipse.passage.lic.floating.model.meta.FloatingFactory;
import org.eclipse.passage.lic.internal.api.LicensedProduct;
import org.eclipse.passage.lic.licenses.model.api.FeatureGrant;
import org.eclipse.passage.lic.licenses.model.api.GrantAcqisition;
import org.eclipse.passage.lic.licenses.model.meta.LicensesFactory;

final class AcquiredGrantsStorage {

Expand Down Expand Up @@ -78,7 +78,7 @@ private boolean matches(GrantAcqisition actual, GrantAcqisition expected) {
}

private GrantAcqisition acquistion(FeatureGrant grant, String user) {
GrantAcqisition acquisition = FloatingFactory.eINSTANCE.createGrantAcqisition();
GrantAcqisition acquisition = LicensesFactory.eINSTANCE.createGrantAcqisition();
acquisition.setCreated(new Date());
acquisition.setFeature(grant.getFeature());
acquisition.setGrant(grant.getIdentifier());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@
import org.eclipse.passage.lbc.internal.base.EncodedResponse;
import org.eclipse.passage.lbc.internal.base.api.Grants;
import org.eclipse.passage.lbc.internal.base.api.RawRequest;
import org.eclipse.passage.lic.floating.model.api.GrantAcqisition;
import org.eclipse.passage.lic.internal.api.LicensingException;
import org.eclipse.passage.lic.internal.api.PassageAction;
import org.eclipse.passage.lic.internal.base.FeatureIdentifier;
import org.eclipse.passage.lic.internal.net.api.handle.NetResponse;
import org.eclipse.passage.lic.internal.net.handle.Failure;
import org.eclipse.passage.lic.internal.net.handle.PlainSuceess;
import org.eclipse.passage.lic.internal.net.handle.ProductUserRequest;
import org.eclipse.passage.lic.licenses.model.api.GrantAcqisition;

public final class Acquisition {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2020 ArSysOp
* Copyright (c) 2020, 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
Expand All @@ -14,7 +14,7 @@

import java.util.function.Predicate;

import org.eclipse.passage.lic.floating.model.api.FloatingLicensePack;
import org.eclipse.passage.lic.licenses.model.api.FloatingLicensePack;

final class AvailableForUser implements Predicate<FloatingLicensePack> {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@
import org.apache.logging.log4j.Logger;
import org.eclipse.passage.lbc.internal.base.api.FlsGear;
import org.eclipse.passage.lbc.internal.base.api.FlsGearAwre;
import org.eclipse.passage.lic.floating.model.api.FeatureGrant;
import org.eclipse.passage.lic.floating.model.api.FloatingLicensePack;
import org.eclipse.passage.lic.internal.api.LicensedProduct;
import org.eclipse.passage.lic.internal.api.LicensingException;
import org.eclipse.passage.lic.licenses.model.api.FeatureGrant;
import org.eclipse.passage.lic.licenses.model.api.FloatingLicensePack;

final class FeatureGrants {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.eclipse.passage.lic.floating.FloatingFileExtension;
import org.eclipse.passage.lic.floating.model.api.FloatingLicensePack;
import org.eclipse.passage.lic.floating.model.meta.FloatingPackage;
import org.eclipse.passage.lic.internal.api.LicensedProduct;
import org.eclipse.passage.lic.internal.api.LicensingException;
import org.eclipse.passage.lic.internal.api.io.KeyKeeper;
Expand All @@ -32,6 +30,8 @@
import org.eclipse.passage.lic.internal.base.io.FileCollection;
import org.eclipse.passage.lic.internal.base.io.PathFromLicensedProduct;
import org.eclipse.passage.lic.internal.emf.EObjectFromBytes;
import org.eclipse.passage.lic.licenses.model.api.FloatingLicensePack;
import org.eclipse.passage.lic.licenses.model.meta.LicensesPackage;

final class LicensePacks {

Expand Down Expand Up @@ -67,7 +67,7 @@ private Optional<FloatingLicensePack> pack(Path license) {
FloatingLicensePack pack;
try {
pack = new EObjectFromBytes<>(decoded(license), FloatingLicensePack.class)//
.get(Collections.singletonMap(FloatingPackage.eNS_URI, FloatingPackage.eINSTANCE));
.get(Collections.singletonMap(LicensesPackage.eNS_URI, LicensesPackage.eINSTANCE));
} catch (LicensingException e) {
log.error("failed: ", e); //$NON-NLS-1$
return Optional.empty();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
*******************************************************************************/
package org.eclipse.passage.lbc.internal.base.acquire;

import org.eclipse.passage.lic.floating.model.api.GrantAcqisition;
import org.eclipse.passage.lic.internal.api.LicensedProduct;
import org.eclipse.passage.lic.internal.net.handle.Failure;
import org.eclipse.passage.lic.licenses.model.api.GrantAcqisition;

/**
* Public only for test purposes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@

import java.util.Optional;

import org.eclipse.passage.lic.floating.model.api.GrantAcqisition;
import org.eclipse.passage.lic.internal.api.LicensedProduct;
import org.eclipse.passage.lic.internal.api.LicensingException;
import org.eclipse.passage.lic.licenses.model.api.GrantAcqisition;

public interface Grants {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,16 @@

import org.eclipse.passage.lbc.internal.base.api.FlsGear;
import org.eclipse.passage.lbc.internal.base.api.FlsGearAwre;
import org.eclipse.passage.lic.floating.model.api.FloatingLicensePack;
import org.eclipse.passage.lic.floating.model.api.ProductRef;
import org.eclipse.passage.lic.floating.model.meta.FloatingPackage;
import org.eclipse.passage.lic.internal.api.LicensedProduct;
import org.eclipse.passage.lic.internal.api.LicensingException;
import org.eclipse.passage.lic.internal.base.BaseLicensedProduct;
import org.eclipse.passage.lic.internal.base.InvalidLicensedProduct;
import org.eclipse.passage.lic.internal.base.conditions.mining.DecodedContent;
import org.eclipse.passage.lic.internal.base.io.FileKeyKeeper;
import org.eclipse.passage.lic.internal.emf.EObjectFromBytes;
import org.eclipse.passage.lic.licenses.model.api.FloatingLicensePack;
import org.eclipse.passage.lic.licenses.model.api.ProductRef;
import org.eclipse.passage.lic.licenses.model.meta.LicensesPackage;

final class Pack {

Expand Down Expand Up @@ -65,7 +65,7 @@ private FloatingLicensePack read(byte[] bytes) throws LicensingException {
return new EObjectFromBytes<>(//
bytes, //
FloatingLicensePack.class//
).get(Collections.singletonMap(FloatingPackage.eNAME, FloatingPackage.eINSTANCE));
).get(Collections.singletonMap(LicensesPackage.eNAME, LicensesPackage.eINSTANCE));
}

private byte[] decoded() throws LicensingException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,6 @@
import java.util.Optional;

import org.eclipse.passage.lbc.internal.base.i18n.BaseMessages;
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.UserGrant;
import org.eclipse.passage.lic.floating.model.api.ValidityPeriodClosed;
import org.eclipse.passage.lic.internal.api.EvaluationInstructions;
import org.eclipse.passage.lic.internal.api.EvaluationType;
import org.eclipse.passage.lic.internal.api.LicensingException;
Expand All @@ -36,6 +32,10 @@
import org.eclipse.passage.lic.internal.base.conditions.BaseValidityPeriodClosed;
import org.eclipse.passage.lic.internal.base.conditions.BaseVersionMatch;
import org.eclipse.passage.lic.internal.base.conditions.MatchingRuleForIdentifier;
import org.eclipse.passage.lic.licenses.model.api.FeatureGrant;
import org.eclipse.passage.lic.licenses.model.api.FloatingLicensePack;
import org.eclipse.passage.lic.licenses.model.api.UserGrant;
import org.eclipse.passage.lic.licenses.model.api.ValidityPeriodClosed;

final class AssembledConditions {

Expand Down Expand Up @@ -79,7 +79,7 @@ private EvaluationInstructions evaluation(UserGrant user) {
}

private ValidityPeriod period(FeatureGrant feature) throws LicensingException {
org.eclipse.passage.lic.floating.model.api.ValidityPeriod origin = feature.getValid();
org.eclipse.passage.lic.licenses.model.api.ValidityPeriod origin = feature.getValid();
if (!ValidityPeriodClosed.class.isInstance(origin)) {
throw new LicensingException(String.format(BaseMessages.AssembledConditions_validity_period_type_unknown,
origin.eClass().getName()));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2020 ArSysOp
* Copyright (c) 2020, 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
Expand All @@ -21,9 +21,6 @@
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.eclipse.passage.lbc.internal.base.i18n.BaseMessages;
import org.eclipse.passage.lic.floating.model.api.FloatingLicensePack;
import org.eclipse.passage.lic.floating.model.api.ProductRef;
import org.eclipse.passage.lic.floating.model.meta.FloatingPackage;
import org.eclipse.passage.lic.internal.api.LicensedProduct;
import org.eclipse.passage.lic.internal.api.LicensingException;
import org.eclipse.passage.lic.internal.api.ServiceInvocationResult;
Expand All @@ -42,6 +39,9 @@
import org.eclipse.passage.lic.internal.base.diagnostic.BaseDiagnostic;
import org.eclipse.passage.lic.internal.base.diagnostic.code.ServiceFailedOnMorsel;
import org.eclipse.passage.lic.internal.emf.EObjectFromBytes;
import org.eclipse.passage.lic.licenses.model.api.FloatingLicensePack;
import org.eclipse.passage.lic.licenses.model.api.ProductRef;
import org.eclipse.passage.lic.licenses.model.meta.LicensesPackage;

final class ReassemblingMiningTool extends ArmedMiningTool {

Expand Down Expand Up @@ -93,7 +93,7 @@ private FloatingLicensePack pack(Path source) throws LicensingException {
return new EObjectFromBytes<>(//
decoded(source), //
FloatingLicensePack.class//
).get(Collections.singletonMap(FloatingPackage.eNAME, FloatingPackage.eINSTANCE));
).get(Collections.singletonMap(LicensesPackage.eNS_URI, LicensesPackage.eINSTANCE));
}

private BaseConditionPack noConditions(Path license) {
Expand Down
8 changes: 5 additions & 3 deletions bundles/org.eclipse.passage.lic.api/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Manifest-Version: 1.0
Automatic-Module-Name: org.eclipse.passage.lic.api
Bundle-ManifestVersion: 2
Bundle-SymbolicName: org.eclipse.passage.lic.api
Bundle-Version: 1.0.201.qualifier
Bundle-Version: 1.0.202.qualifier
Bundle-Name: %Bundle-Name
Bundle-Vendor: %Bundle-Vendor
Bundle-Copyright: %Bundle-Copyright
Expand Down Expand Up @@ -42,7 +42,8 @@ Export-Package: org.eclipse.passage.lic.internal.api;
org.eclipse.passage.seal.demo,
org.eclipse.passage.seal.demo.tests,
org.eclipse.passage.lic.jetty,
org.eclipse.passage.lbc.jetty",
org.eclipse.passage.lbc.jetty,
org.eclipse.passage.lic.licenses.model",
org.eclipse.passage.lic.internal.api.access;
x-friends:="org.eclipse.passage.lac,
org.eclipse.passage.lic.base,
Expand All @@ -56,7 +57,8 @@ Export-Package: org.eclipse.passage.lic.internal.api;
org.eclipse.passage.lic.floating.model,
org.eclipse.passage.lic.base,
org.eclipse.passage.lic.hc.tests,
org.eclipse.passage.lbc.jetty",
org.eclipse.passage.lbc.jetty,
org.eclipse.passage.lic.licenses.model",
org.eclipse.passage.lic.internal.api.conditions;
x-friends:="org.eclipse.passage.lbc.api,
org.eclipse.passage.lbc.base,
Expand Down
4 changes: 2 additions & 2 deletions bundles/org.eclipse.passage.lic.base/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Manifest-Version: 1.0
Automatic-Module-Name: org.eclipse.passage.lic.api.base
Bundle-ManifestVersion: 2
Bundle-SymbolicName: org.eclipse.passage.lic.base
Bundle-Version: 1.0.201.qualifier
Bundle-Version: 1.0.202.qualifier
Bundle-Name: %Bundle-Name
Bundle-Vendor: %Bundle-Vendor
Bundle-Copyright: %Bundle-Copyright
Expand All @@ -26,7 +26,7 @@ Export-Package: org.eclipse.passage.lic.internal.base;
org.eclipse.passage.seal.demo,
org.eclipse.passage.seal.demo.tests",
org.eclipse.passage.lic.internal.base.access;x-friends:="org.eclipse.passage.seal.demo.tests,org.eclipse.passage.lic.equinox",
org.eclipse.passage.lic.internal.base.acquire;x-friends:="org.eclipse.passage.lic.floating.model,org.eclipse.passage.lic.equinox",
org.eclipse.passage.lic.internal.base.acquire;x-friends:="org.eclipse.passage.lic.floating.model,org.eclipse.passage.lic.equinox,org.eclipse.passage.lic.licenses.model",
org.eclipse.passage.lic.internal.base.conditions;
x-friends:="org.eclipse.passage.lbc.base,
org.eclipse.passage.lic.json,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Automatic-Module-Name: org.eclipse.passage.lic.floating.e4.ui
Bundle-ManifestVersion: 2
Bundle-Name: %Bundle-Name
Bundle-SymbolicName: org.eclipse.passage.lic.floating.e4.ui;singleton:=true
Bundle-Version: 0.1.0.qualifier
Bundle-Version: 0.1.100.qualifier
Bundle-Vendor: %Bundle-Vendor
Bundle-Copyright: %Bundle-Copyright
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,4 @@ output.. = bin/
bin.includes = META-INF/,\
.,\
OSGI-INF/,\
plugin.xml,\
about.html
26 changes: 0 additions & 26 deletions bundles/org.eclipse.passage.lic.floating.e4.ui/plugin.xml

This file was deleted.

Loading

0 comments on commit c61528c

Please sign in to comment.