diff --git a/bundles/org.eclipse.passage.lbc.base/src/org/eclipse/passage/lbc/internal/base/VaultMinedConditions.java b/bundles/org.eclipse.passage.lbc.base/src/org/eclipse/passage/lbc/internal/base/VaultMinedConditions.java index 82462d86c..b99ac02f0 100644 --- a/bundles/org.eclipse.passage.lbc.base/src/org/eclipse/passage/lbc/internal/base/VaultMinedConditions.java +++ b/bundles/org.eclipse.passage.lbc.base/src/org/eclipse/passage/lbc/internal/base/VaultMinedConditions.java @@ -16,7 +16,7 @@ import java.util.function.Supplier; import org.eclipse.passage.lic.internal.api.LicensedProduct; -import org.eclipse.passage.lic.internal.api.registry.StringServiceId; +import org.eclipse.passage.lic.internal.api.conditions.mining.ConditionMiningTarget; import org.eclipse.passage.lic.internal.base.conditions.mining.LocalConditions; import org.eclipse.passage.lic.internal.base.conditions.mining.MiningEquipment; import org.eclipse.passage.lic.internal.base.io.LicensingFolder; @@ -29,7 +29,7 @@ public class VaultMinedConditions extends LocalConditions { protected VaultMinedConditions(MiningEquipment equipment) { - super(new StringServiceId("server-conditions"), equipment); //$NON-NLS-1$ + super(new ConditionMiningTarget.Of("server-conditions"), equipment); //$NON-NLS-1$ } @Override 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 e3d44f8d8..1896fa02e 100644 --- a/bundles/org.eclipse.passage.lic.api/META-INF/MANIFEST.MF +++ b/bundles/org.eclipse.passage.lic.api/META-INF/MANIFEST.MF @@ -47,7 +47,9 @@ Export-Package: org.eclipse.passage.lic.internal.api; org.eclipse.passage.lic.json, org.eclipse.passage.lic.hc, org.eclipse.passage.lic.licenses.migration, - org.eclipse.passage.lic.base", + org.eclipse.passage.lic.base, + org.eclipse.passage.lic.equinox, + org.eclipse.passage.lic.base.tests", org.eclipse.passage.lic.internal.api.diagnostic; x-friends:="org.eclipse.passage.lic.base, org.eclipse.passage.lic.jface, diff --git a/bundles/org.eclipse.passage.lic.api/src/org/eclipse/passage/lic/internal/api/conditions/ConditionSource.java b/bundles/org.eclipse.passage.lic.api/src/org/eclipse/passage/lic/internal/api/conditions/ConditionSource.java new file mode 100644 index 000000000..ff248f722 --- /dev/null +++ b/bundles/org.eclipse.passage.lic.api/src/org/eclipse/passage/lic/internal/api/conditions/ConditionSource.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.lic.internal.api.conditions; + +public interface ConditionSource { + +} diff --git a/bundles/org.eclipse.passage.lic.api/src/org/eclipse/passage/lic/internal/api/conditions/mining/ConditionMiningTarget.java b/bundles/org.eclipse.passage.lic.api/src/org/eclipse/passage/lic/internal/api/conditions/mining/ConditionMiningTarget.java new file mode 100644 index 000000000..6ede5b129 --- /dev/null +++ b/bundles/org.eclipse.passage.lic.api/src/org/eclipse/passage/lic/internal/api/conditions/mining/ConditionMiningTarget.java @@ -0,0 +1,81 @@ +/******************************************************************************* + * 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.lic.internal.api.conditions.mining; + +import java.util.Objects; + +import org.eclipse.passage.lic.internal.api.registry.ServiceId; + +/** + * String-valued {@linkplain ServiceId} with mime content type semantics + */ +public abstract class ConditionMiningTarget implements ServiceId { + + private final String target; + + public ConditionMiningTarget(String target) { + Objects.requireNonNull(target, "ConditionMiningTarget::target"); //$NON-NLS-1$ + this.target = target; + } + + @Override + public boolean equals(Object object) { + if (!getClass().isInstance(object)) { + return false; + } + return target.equals(((ConditionMiningTarget) object).target()); + } + + public String target() { + return target; + } + + @Override + public int hashCode() { + return target.hashCode(); + } + + @Override + public String toString() { + return target; + } + + public ConditionMiningTarget child(String subtarget) { + Objects.requireNonNull(subtarget, "ConditionMiningTarget::child"); //$NON-NLS-1$ + return new Of(String.format("%s/%s", target, subtarget)); //$NON-NLS-1$ + } + + public static final class Local extends ConditionMiningTarget { + + public Local() { + super("local-file-system"); //$NON-NLS-1$ + } + + } + + public static final class Remote extends ConditionMiningTarget { + + public Remote() { + super("remote"); //$NON-NLS-1$ + } + + } + + public static final class Of extends ConditionMiningTarget { + + public Of(String target) { + super(target.toLowerCase()); + } + + } +} diff --git a/bundles/org.eclipse.passage.lic.api/src/org/eclipse/passage/lic/internal/api/conditions/mining/MinedConditions.java b/bundles/org.eclipse.passage.lic.api/src/org/eclipse/passage/lic/internal/api/conditions/mining/MinedConditions.java index f22edb786..3f85a1a45 100644 --- a/bundles/org.eclipse.passage.lic.api/src/org/eclipse/passage/lic/internal/api/conditions/mining/MinedConditions.java +++ b/bundles/org.eclipse.passage.lic.api/src/org/eclipse/passage/lic/internal/api/conditions/mining/MinedConditions.java @@ -19,7 +19,6 @@ import org.eclipse.passage.lic.internal.api.conditions.Condition; import org.eclipse.passage.lic.internal.api.conditions.ConditionPack; import org.eclipse.passage.lic.internal.api.registry.Service; -import org.eclipse.passage.lic.internal.api.registry.StringServiceId; /** *

@@ -39,7 +38,7 @@ * The service is intended to implement the third phase of access cycle. *

*/ -public interface MinedConditions extends Service { +public interface MinedConditions extends Service { /** *

diff --git a/bundles/org.eclipse.passage.lic.api/src/org/eclipse/passage/lic/internal/api/conditions/mining/MinedConditionsRegistry.java b/bundles/org.eclipse.passage.lic.api/src/org/eclipse/passage/lic/internal/api/conditions/mining/MinedConditionsRegistry.java index f53b3d017..11c24448a 100644 --- a/bundles/org.eclipse.passage.lic.api/src/org/eclipse/passage/lic/internal/api/conditions/mining/MinedConditionsRegistry.java +++ b/bundles/org.eclipse.passage.lic.api/src/org/eclipse/passage/lic/internal/api/conditions/mining/MinedConditionsRegistry.java @@ -15,8 +15,7 @@ import java.util.function.Supplier; import org.eclipse.passage.lic.internal.api.registry.Registry; -import org.eclipse.passage.lic.internal.api.registry.StringServiceId; -public interface MinedConditionsRegistry extends Supplier> { +public interface MinedConditionsRegistry extends Supplier> { } 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 69764a410..9a988e6a2 100644 --- a/bundles/org.eclipse.passage.lic.base/META-INF/MANIFEST.MF +++ b/bundles/org.eclipse.passage.lic.base/META-INF/MANIFEST.MF @@ -25,7 +25,13 @@ Export-Package: org.eclipse.passage.lic.internal.base; org.eclipse.passage.loc.workbench.emfforms, org.eclipse.passage.lic.licenses.migration", 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.lbc.base", + org.eclipse.passage.lic.internal.base.conditions.mining; + x-friends:="org.eclipse.passage.lic.jface, + org.eclipse.passage.lic.hc, + org.eclipse.passage.lbc.base, + org.eclipse.passage.lic.equinox, + org.eclipse.passage.lic.base.tests, + org.eclipse.passage.lic.base", org.eclipse.passage.lic.internal.base.diagnostic; x-friends:="org.eclipse.passage.lic.equinox.tests, org.eclipse.passage.lic.equinox, @@ -41,7 +47,9 @@ Export-Package: org.eclipse.passage.lic.internal.base; org.eclipse.passage.lic.equinox, org.eclipse.passage.lic.floating, org.eclipse.passage.loc.licenses.core, - org.eclipse.passage.lic.hc", + org.eclipse.passage.lic.hc, + org.eclipse.passage.lic.base, + org.eclipse.passage.lic.base.tests", org.eclipse.passage.lic.internal.base.observatory;x-internal:=true, org.eclipse.passage.lic.internal.base.registry;x-friends:="org.eclipse.passage.lbc.base", org.eclipse.passage.lic.internal.base.requirements;x-internal:=true, diff --git a/bundles/org.eclipse.passage.lic.base/src/org/eclipse/passage/lic/internal/base/access/Assess.java b/bundles/org.eclipse.passage.lic.base/src/org/eclipse/passage/lic/internal/base/access/Assess.java index 528724c72..5e091e92e 100644 --- a/bundles/org.eclipse.passage.lic.base/src/org/eclipse/passage/lic/internal/base/access/Assess.java +++ b/bundles/org.eclipse.passage.lic.base/src/org/eclipse/passage/lic/internal/base/access/Assess.java @@ -39,6 +39,9 @@ protected ServiceInvocationResult stopOnError(Diagnostic @Override protected ServiceInvocationResult stopOnCertificate(ExaminationCertificate certificate, Diagnostic diagnostic) { + if (feature().isPresent()) { + return acquire(certificate, diagnostic); + } return new BaseServiceInvocationResult(diagnostic, certificate); } @@ -50,4 +53,11 @@ protected ServiceInvocationResult freeWayOut() { Collections.emptySet())); } + private ServiceInvocationResult acquire(ExaminationCertificate certificate, + Diagnostic diagnostic) { + + // TODO: YTBD + return new BaseServiceInvocationResult(diagnostic, certificate); + } + } diff --git a/bundles/org.eclipse.passage.lic.base/src/org/eclipse/passage/lic/internal/base/access/Conditions.java b/bundles/org.eclipse.passage.lic.base/src/org/eclipse/passage/lic/internal/base/access/Conditions.java index 6de83a03c..4d0518248 100644 --- a/bundles/org.eclipse.passage.lic.base/src/org/eclipse/passage/lic/internal/base/access/Conditions.java +++ b/bundles/org.eclipse.passage.lic.base/src/org/eclipse/passage/lic/internal/base/access/Conditions.java @@ -21,34 +21,34 @@ import org.eclipse.passage.lic.internal.api.LicensedProduct; import org.eclipse.passage.lic.internal.api.ServiceInvocationResult; import org.eclipse.passage.lic.internal.api.conditions.ConditionPack; +import org.eclipse.passage.lic.internal.api.conditions.mining.ConditionMiningTarget; import org.eclipse.passage.lic.internal.api.conditions.mining.MinedConditions; import org.eclipse.passage.lic.internal.api.diagnostic.Trouble; import org.eclipse.passage.lic.internal.api.registry.Registry; -import org.eclipse.passage.lic.internal.api.registry.StringServiceId; import org.eclipse.passage.lic.internal.base.BaseServiceInvocationResult; import org.eclipse.passage.lic.internal.base.SumOfCollections; import org.eclipse.passage.lic.internal.base.conditions.ConditionsFeatureFilter; import org.eclipse.passage.lic.internal.base.diagnostic.code.NoServicesOfType; import org.eclipse.passage.lic.internal.base.i18n.AccessCycleMessages; -@SuppressWarnings("restriction") public final class Conditions implements Supplier>> { - private final Registry registry; + private final Registry registry; private final LicensedProduct product; private final Function>, // ServiceInvocationResult>> filter; - public Conditions(Registry registry, LicensedProduct product, String feature) { + public Conditions(Registry registry, LicensedProduct product, + String feature) { this(registry, product, new ConditionsFeatureFilter(feature).get()); } - public Conditions(Registry registry, LicensedProduct product) { + public Conditions(Registry registry, LicensedProduct product) { this(registry, product, Function.identity()); } - public Conditions(Registry registry, LicensedProduct product, + public Conditions(Registry registry, LicensedProduct product, Function>, ServiceInvocationResult>> filter) { Objects.requireNonNull(registry, "Conditions::registry"); //$NON-NLS-1$ Objects.requireNonNull(product, "Conditions::product"); //$NON-NLS-1$ diff --git a/bundles/org.eclipse.passage.lic.base/src/org/eclipse/passage/lic/internal/base/access/Cycle.java b/bundles/org.eclipse.passage.lic.base/src/org/eclipse/passage/lic/internal/base/access/Cycle.java index 783132943..5a271dab3 100644 --- a/bundles/org.eclipse.passage.lic.base/src/org/eclipse/passage/lic/internal/base/access/Cycle.java +++ b/bundles/org.eclipse.passage.lic.base/src/org/eclipse/passage/lic/internal/base/access/Cycle.java @@ -60,6 +60,10 @@ T apply() { return examine(this::requirements, this::permissions); } + protected Optional feature() { + return feature; + } + private T examine(Supplier>> requirements, // Supplier>> permissions) { ServiceInvocationResult> reqs = requirements.get(); diff --git a/bundles/org.eclipse.passage.lic.base/src/org/eclipse/passage/lic/internal/base/conditions/mining/BaseLicenseReadingService.java b/bundles/org.eclipse.passage.lic.base/src/org/eclipse/passage/lic/internal/base/conditions/mining/BaseLicenseReadingService.java index 4f0b34aec..7ff187354 100644 --- a/bundles/org.eclipse.passage.lic.base/src/org/eclipse/passage/lic/internal/base/conditions/mining/BaseLicenseReadingService.java +++ b/bundles/org.eclipse.passage.lic.base/src/org/eclipse/passage/lic/internal/base/conditions/mining/BaseLicenseReadingService.java @@ -19,10 +19,9 @@ import org.eclipse.passage.lic.internal.api.LicensedProduct; import org.eclipse.passage.lic.internal.api.ServiceInvocationResult; import org.eclipse.passage.lic.internal.api.conditions.ConditionPack; +import org.eclipse.passage.lic.internal.api.conditions.mining.ConditionMiningTarget; import org.eclipse.passage.lic.internal.api.conditions.mining.LicenseReadingService; -import org.eclipse.passage.lic.internal.api.registry.StringServiceId; -@SuppressWarnings("restriction") public final class BaseLicenseReadingService implements LicenseReadingService { private final LicensedProduct product; @@ -48,7 +47,7 @@ private static final class OnTheFlyConditions extends LocalConditions { private final Path license; private OnTheFlyConditions(Path license, MiningEquipment equipment) { - super(new StringServiceId("on-the-fly"), equipment); //$NON-NLS-1$ + super(new ConditionMiningTarget.Of("on-the-fly"), equipment); //$NON-NLS-1$ this.license = license; } diff --git a/bundles/org.eclipse.passage.lic.base/src/org/eclipse/passage/lic/internal/base/conditions/mining/LicensingContentType.java b/bundles/org.eclipse.passage.lic.base/src/org/eclipse/passage/lic/internal/base/conditions/mining/LicensingContentType.java index 926257e28..ab10c6d34 100644 --- a/bundles/org.eclipse.passage.lic.base/src/org/eclipse/passage/lic/internal/base/conditions/mining/LicensingContentType.java +++ b/bundles/org.eclipse.passage.lic.base/src/org/eclipse/passage/lic/internal/base/conditions/mining/LicensingContentType.java @@ -17,7 +17,6 @@ import org.eclipse.passage.lic.internal.api.conditions.mining.ContentType; import org.eclipse.passage.lic.internal.base.BaseNamedData; -@SuppressWarnings("restriction") public final class LicensingContentType extends BaseNamedData { public LicensingContentType(Function retrieve) { diff --git a/bundles/org.eclipse.passage.lic.base/src/org/eclipse/passage/lic/internal/base/conditions/mining/LocalConditions.java b/bundles/org.eclipse.passage.lic.base/src/org/eclipse/passage/lic/internal/base/conditions/mining/LocalConditions.java index 44575eac1..0d60e32cb 100644 --- a/bundles/org.eclipse.passage.lic.base/src/org/eclipse/passage/lic/internal/base/conditions/mining/LocalConditions.java +++ b/bundles/org.eclipse.passage.lic.base/src/org/eclipse/passage/lic/internal/base/conditions/mining/LocalConditions.java @@ -22,9 +22,9 @@ import org.eclipse.passage.lic.internal.api.ServiceInvocationResult; import org.eclipse.passage.lic.internal.api.conditions.Condition; import org.eclipse.passage.lic.internal.api.conditions.ConditionPack; +import org.eclipse.passage.lic.internal.api.conditions.mining.ConditionMiningTarget; import org.eclipse.passage.lic.internal.api.conditions.mining.MinedConditions; import org.eclipse.passage.lic.internal.api.diagnostic.Trouble; -import org.eclipse.passage.lic.internal.api.registry.StringServiceId; import org.eclipse.passage.lic.internal.base.BaseServiceInvocationResult; import org.eclipse.passage.lic.internal.base.diagnostic.code.ServiceFailedOnInfrastructureDenial; import org.eclipse.passage.lic.internal.base.i18n.ConditionMiningMessages; @@ -38,13 +38,12 @@ * declare. *

*/ -@SuppressWarnings("restriction") public abstract class LocalConditions implements MinedConditions { - private final StringServiceId id; + private final ConditionMiningTarget id; private final MiningEquipment equipment; - protected LocalConditions(StringServiceId id, MiningEquipment equipment) { + protected LocalConditions(ConditionMiningTarget id, MiningEquipment equipment) { Objects.requireNonNull(id, getClass().getSimpleName() + "::id"); //$NON-NLS-1$ Objects.requireNonNull(equipment, getClass().getSimpleName() + "::equipment"); //$NON-NLS-1$ this.id = id; @@ -52,7 +51,7 @@ protected LocalConditions(StringServiceId id, MiningEquipment equipment) { } @Override - public final StringServiceId id() { + public final ConditionMiningTarget id() { return id; } diff --git a/bundles/org.eclipse.passage.lic.base/src/org/eclipse/passage/lic/internal/base/conditions/mining/MiningEquipment.java b/bundles/org.eclipse.passage.lic.base/src/org/eclipse/passage/lic/internal/base/conditions/mining/MiningEquipment.java index aa2e05c66..1ada8cced 100644 --- a/bundles/org.eclipse.passage.lic.base/src/org/eclipse/passage/lic/internal/base/conditions/mining/MiningEquipment.java +++ b/bundles/org.eclipse.passage.lic.base/src/org/eclipse/passage/lic/internal/base/conditions/mining/MiningEquipment.java @@ -23,7 +23,6 @@ import org.eclipse.passage.lic.internal.api.io.StreamCodecRegistry; import org.eclipse.passage.lic.internal.base.i18n.BaseMessages; -@SuppressWarnings("restriction") public final class MiningEquipment { private final KeyKeeperRegistry keys; diff --git a/bundles/org.eclipse.passage.lic.base/src/org/eclipse/passage/lic/internal/base/conditions/mining/SecurityKeyAlgorithm.java b/bundles/org.eclipse.passage.lic.base/src/org/eclipse/passage/lic/internal/base/conditions/mining/SecurityKeyAlgorithm.java index 7b8e134df..9f8f4687d 100644 --- a/bundles/org.eclipse.passage.lic.base/src/org/eclipse/passage/lic/internal/base/conditions/mining/SecurityKeyAlgorithm.java +++ b/bundles/org.eclipse.passage.lic.base/src/org/eclipse/passage/lic/internal/base/conditions/mining/SecurityKeyAlgorithm.java @@ -19,7 +19,6 @@ import org.eclipse.passage.lic.internal.api.io.EncryptionAlgorithm; import org.eclipse.passage.lic.internal.base.BaseNamedData; -@SuppressWarnings("restriction") public final class SecurityKeyAlgorithm extends BaseNamedData { public SecurityKeyAlgorithm(Function retrieve) { diff --git a/bundles/org.eclipse.passage.lic.base/src/org/eclipse/passage/lic/internal/base/conditions/mining/SecurityKeySize.java b/bundles/org.eclipse.passage.lic.base/src/org/eclipse/passage/lic/internal/base/conditions/mining/SecurityKeySize.java index 1c95b7814..62c69f5e9 100644 --- a/bundles/org.eclipse.passage.lic.base/src/org/eclipse/passage/lic/internal/base/conditions/mining/SecurityKeySize.java +++ b/bundles/org.eclipse.passage.lic.base/src/org/eclipse/passage/lic/internal/base/conditions/mining/SecurityKeySize.java @@ -19,7 +19,6 @@ import org.eclipse.passage.lic.internal.api.io.EncryptionKeySize; import org.eclipse.passage.lic.internal.base.BaseNamedData; -@SuppressWarnings("restriction") public final class SecurityKeySize extends BaseNamedData { public SecurityKeySize(Function retrieve) { diff --git a/bundles/org.eclipse.passage.lic.base/src/org/eclipse/passage/lic/internal/base/conditions/mining/UserHomeResidentConditions.java b/bundles/org.eclipse.passage.lic.base/src/org/eclipse/passage/lic/internal/base/conditions/mining/UserHomeResidentConditions.java index a9b2c27e7..973712bd2 100644 --- a/bundles/org.eclipse.passage.lic.base/src/org/eclipse/passage/lic/internal/base/conditions/mining/UserHomeResidentConditions.java +++ b/bundles/org.eclipse.passage.lic.base/src/org/eclipse/passage/lic/internal/base/conditions/mining/UserHomeResidentConditions.java @@ -16,7 +16,7 @@ import java.util.function.Supplier; import org.eclipse.passage.lic.internal.api.LicensedProduct; -import org.eclipse.passage.lic.internal.api.registry.StringServiceId; +import org.eclipse.passage.lic.internal.api.conditions.mining.ConditionMiningTarget; import org.eclipse.passage.lic.internal.base.io.LicensingFolder; import org.eclipse.passage.lic.internal.base.io.PathFromLicensedProduct; import org.eclipse.passage.lic.internal.base.io.UserHomePath; @@ -28,7 +28,7 @@ public final class UserHomeResidentConditions extends LocalConditions { public UserHomeResidentConditions(MiningEquipment equipment) { - super(new StringServiceId("user-home-conditions"), equipment); //$NON-NLS-1$ + super(new ConditionMiningTarget.Local().child("user-home-conditions"), equipment); //$NON-NLS-1$ } @Override diff --git a/bundles/org.eclipse.passage.lic.base/src/org/eclipse/passage/lic/internal/base/io/BaseDigestExpectation.java b/bundles/org.eclipse.passage.lic.base/src/org/eclipse/passage/lic/internal/base/io/BaseDigestExpectation.java index ff12dfaab..1eff0c1fd 100644 --- a/bundles/org.eclipse.passage.lic.base/src/org/eclipse/passage/lic/internal/base/io/BaseDigestExpectation.java +++ b/bundles/org.eclipse.passage.lic.base/src/org/eclipse/passage/lic/internal/base/io/BaseDigestExpectation.java @@ -16,7 +16,6 @@ import org.eclipse.passage.lic.internal.api.io.DigestExpectation; -@SuppressWarnings("restriction") public final class BaseDigestExpectation implements DigestExpectation { private final byte[] digest; diff --git a/bundles/org.eclipse.passage.lic.equinox/src/org/eclipse/passage/lic/internal/equinox/conditions/ConfigurationResidentConditions.java b/bundles/org.eclipse.passage.lic.equinox/src/org/eclipse/passage/lic/internal/equinox/conditions/ConfigurationResidentConditions.java index 2379d89f3..e9412be27 100644 --- a/bundles/org.eclipse.passage.lic.equinox/src/org/eclipse/passage/lic/internal/equinox/conditions/ConfigurationResidentConditions.java +++ b/bundles/org.eclipse.passage.lic.equinox/src/org/eclipse/passage/lic/internal/equinox/conditions/ConfigurationResidentConditions.java @@ -16,7 +16,7 @@ import java.util.function.Supplier; import org.eclipse.passage.lic.internal.api.LicensedProduct; -import org.eclipse.passage.lic.internal.api.registry.StringServiceId; +import org.eclipse.passage.lic.internal.api.conditions.mining.ConditionMiningTarget; import org.eclipse.passage.lic.internal.base.conditions.mining.LocalConditions; import org.eclipse.passage.lic.internal.base.conditions.mining.MiningEquipment; import org.eclipse.passage.lic.internal.base.io.LicensingFolder; @@ -28,11 +28,10 @@ * settings folder located under the product {@code configuration} directory * (supplied by the eclipse platform). */ -@SuppressWarnings("restriction") public final class ConfigurationResidentConditions extends LocalConditions { public ConfigurationResidentConditions(MiningEquipment equipment) { - super(new StringServiceId("configuration-conditions"), equipment); //$NON-NLS-1$ + super(new ConditionMiningTarget.Local().child("configuration-conditions"), equipment); //$NON-NLS-1$ } @Override diff --git a/bundles/org.eclipse.passage.lic.equinox/src/org/eclipse/passage/lic/internal/equinox/conditions/InstallationResidentConditions.java b/bundles/org.eclipse.passage.lic.equinox/src/org/eclipse/passage/lic/internal/equinox/conditions/InstallationResidentConditions.java index b3273c5c7..14ce1a91e 100644 --- a/bundles/org.eclipse.passage.lic.equinox/src/org/eclipse/passage/lic/internal/equinox/conditions/InstallationResidentConditions.java +++ b/bundles/org.eclipse.passage.lic.equinox/src/org/eclipse/passage/lic/internal/equinox/conditions/InstallationResidentConditions.java @@ -16,7 +16,7 @@ import java.util.function.Supplier; import org.eclipse.passage.lic.internal.api.LicensedProduct; -import org.eclipse.passage.lic.internal.api.registry.StringServiceId; +import org.eclipse.passage.lic.internal.api.conditions.mining.ConditionMiningTarget; import org.eclipse.passage.lic.internal.base.conditions.mining.LocalConditions; import org.eclipse.passage.lic.internal.base.conditions.mining.MiningEquipment; import org.eclipse.passage.lic.internal.base.io.LicensingFolder; @@ -28,11 +28,10 @@ * settings folder located under the product installation directory (supplied by * the eclipse platform). */ -@SuppressWarnings("restriction") public final class InstallationResidentConditions extends LocalConditions { public InstallationResidentConditions(MiningEquipment equipment) { - super(new StringServiceId("installation-conditions"), equipment); //$NON-NLS-1$ + super(new ConditionMiningTarget.Local().child("installation-conditions"), equipment); //$NON-NLS-1$ } @Override diff --git a/bundles/org.eclipse.passage.lic.hc/src/org/eclipse/passage/lic/internal/hc/remote/impl/RemoteConditions.java b/bundles/org.eclipse.passage.lic.hc/src/org/eclipse/passage/lic/internal/hc/remote/impl/RemoteConditions.java index b27bdc6f3..f8f961013 100644 --- a/bundles/org.eclipse.passage.lic.hc/src/org/eclipse/passage/lic/internal/hc/remote/impl/RemoteConditions.java +++ b/bundles/org.eclipse.passage.lic.hc/src/org/eclipse/passage/lic/internal/hc/remote/impl/RemoteConditions.java @@ -20,6 +20,7 @@ import org.eclipse.passage.lic.internal.api.LicensingException; import org.eclipse.passage.lic.internal.api.ServiceInvocationResult; import org.eclipse.passage.lic.internal.api.conditions.ConditionPack; +import org.eclipse.passage.lic.internal.api.conditions.mining.ConditionMiningTarget; import org.eclipse.passage.lic.internal.api.conditions.mining.ConditionTransportRegistry; import org.eclipse.passage.lic.internal.api.conditions.mining.MinedConditions; import org.eclipse.passage.lic.internal.api.diagnostic.Trouble; @@ -27,7 +28,6 @@ import org.eclipse.passage.lic.internal.api.io.KeyKeeperRegistry; import org.eclipse.passage.lic.internal.api.io.StreamCodec; import org.eclipse.passage.lic.internal.api.io.StreamCodecRegistry; -import org.eclipse.passage.lic.internal.api.registry.StringServiceId; import org.eclipse.passage.lic.internal.base.BaseServiceInvocationResult; import org.eclipse.passage.lic.internal.base.SumOfCollections; import org.eclipse.passage.lic.internal.base.diagnostic.NoSevereErrors; @@ -39,7 +39,7 @@ public final class RemoteConditions implements MinedConditions { private final ConditionTransportRegistry transports; private final KeyKeeperRegistry keys; private final StreamCodecRegistry codecs; - private final StringServiceId id = new StringServiceId("remote"); //$NON-NLS-1$ + private final ConditionMiningTarget id = new ConditionMiningTarget.Remote(); // $NON-NLS-1$ public RemoteConditions(KeyKeeperRegistry keys, StreamCodecRegistry codecs, ConditionTransportRegistry transports) { this.keys = keys; @@ -48,7 +48,7 @@ public RemoteConditions(KeyKeeperRegistry keys, StreamCodecRegistry codecs, Cond } @Override - public StringServiceId id() { + public ConditionMiningTarget id() { return id; } diff --git a/bundles/org.eclipse.passage.seal.demo/src/org/eclipse/passage/seal/internal/demo/SealedAccessCycleConfiguration.java b/bundles/org.eclipse.passage.seal.demo/src/org/eclipse/passage/seal/internal/demo/SealedAccessCycleConfiguration.java index d001b2fc0..ea1888240 100644 --- a/bundles/org.eclipse.passage.seal.demo/src/org/eclipse/passage/seal/internal/demo/SealedAccessCycleConfiguration.java +++ b/bundles/org.eclipse.passage.seal.demo/src/org/eclipse/passage/seal/internal/demo/SealedAccessCycleConfiguration.java @@ -27,6 +27,7 @@ import org.eclipse.passage.lic.internal.api.conditions.evaluation.ExpressionTokenAssessorsRegistry; import org.eclipse.passage.lic.internal.api.conditions.evaluation.PermissionEmittersRegistry; import org.eclipse.passage.lic.internal.api.conditions.evaluation.PermissionEmittingService; +import org.eclipse.passage.lic.internal.api.conditions.mining.ConditionMiningTarget; import org.eclipse.passage.lic.internal.api.conditions.mining.ConditionTransport; import org.eclipse.passage.lic.internal.api.conditions.mining.ConditionTransportRegistry; import org.eclipse.passage.lic.internal.api.conditions.mining.ContentType; @@ -69,7 +70,7 @@ final class SealedAccessCycleConfiguration implements AccessCycleConfiguration { private final Registry requirements; - private final Registry conditions; + private final Registry conditions; private final Registry transports; private final Registry codecs; private final Registry keys; diff --git a/tests/org.eclipse.passage.lic.api.tests/src/org/eclipse/passage/lic/api/tests/fakes/conditions/mining/FakeMinedConditions.java b/tests/org.eclipse.passage.lic.api.tests/src/org/eclipse/passage/lic/api/tests/fakes/conditions/mining/FakeMinedConditions.java index 9370d29d9..b7339dc2b 100644 --- a/tests/org.eclipse.passage.lic.api.tests/src/org/eclipse/passage/lic/api/tests/fakes/conditions/mining/FakeMinedConditions.java +++ b/tests/org.eclipse.passage.lic.api.tests/src/org/eclipse/passage/lic/api/tests/fakes/conditions/mining/FakeMinedConditions.java @@ -17,15 +17,15 @@ import org.eclipse.passage.lic.internal.api.LicensedProduct; import org.eclipse.passage.lic.internal.api.ServiceInvocationResult; import org.eclipse.passage.lic.internal.api.conditions.ConditionPack; +import org.eclipse.passage.lic.internal.api.conditions.mining.ConditionMiningTarget; import org.eclipse.passage.lic.internal.api.conditions.mining.MinedConditions; -import org.eclipse.passage.lic.internal.api.registry.StringServiceId; @SuppressWarnings("restriction") public final class FakeMinedConditions implements MinedConditions { @Override - public StringServiceId id() { - return new StringServiceId("fake-mining-service"); //$NON-NLS-1$ + public ConditionMiningTarget id() { + return new ConditionMiningTarget.Of("fake-mining-service"); //$NON-NLS-1$ } @Override diff --git a/tests/org.eclipse.passage.lic.base.tests/src/org/eclipse/passage/lic/internal/base/tests/conditions/mining/TempFolderResidentConditions.java b/tests/org.eclipse.passage.lic.base.tests/src/org/eclipse/passage/lic/internal/base/tests/conditions/mining/TempFolderResidentConditions.java index 2d14c6ba1..6d0617241 100644 --- a/tests/org.eclipse.passage.lic.base.tests/src/org/eclipse/passage/lic/internal/base/tests/conditions/mining/TempFolderResidentConditions.java +++ b/tests/org.eclipse.passage.lic.base.tests/src/org/eclipse/passage/lic/internal/base/tests/conditions/mining/TempFolderResidentConditions.java @@ -16,18 +16,17 @@ import java.util.function.Supplier; import org.eclipse.passage.lic.internal.api.LicensedProduct; -import org.eclipse.passage.lic.internal.api.registry.StringServiceId; +import org.eclipse.passage.lic.internal.api.conditions.mining.ConditionMiningTarget; import org.eclipse.passage.lic.internal.base.conditions.mining.LocalConditions; import org.eclipse.passage.lic.internal.base.conditions.mining.MiningEquipment; import org.eclipse.passage.lic.internal.base.io.PathFromLicensedProduct; -@SuppressWarnings("restriction") final class TempFolderResidentConditions extends LocalConditions { private final Path root; TempFolderResidentConditions(Path root, MiningEquipment equipment) { - super(new StringServiceId("temp-folder-conditions"), equipment); //$NON-NLS-1$ + super(new ConditionMiningTarget.Of("temp-folder-conditions"), equipment); //$NON-NLS-1$ this.root = root; }