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
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