Skip to content

Commit

Permalink
Merge pull request #663 from eclipse-passage/571190-1
Browse files Browse the repository at this point in the history
Bug 571190 build the solution on Framework services host
  • Loading branch information
eparovyshnaya authored Feb 16, 2021
2 parents 5577bc8 + efe83f0 commit e9dd779
Show file tree
Hide file tree
Showing 5 changed files with 73 additions and 55 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,12 @@
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.eclipse.passage.lbc.internal.base.api.RawRequest;
import org.eclipse.passage.lic.floating.FloatingFileExtensions;
import org.eclipse.passage.lic.internal.api.LicensedProduct;
import org.eclipse.passage.lic.internal.api.PassageAction;
import org.eclipse.passage.lic.internal.api.ServiceInvocationResult;
import org.eclipse.passage.lic.internal.api.conditions.ConditionMiningTarget;
import org.eclipse.passage.lic.internal.api.conditions.ConditionPack;
import org.eclipse.passage.lic.internal.base.conditions.mining.LocalConditions;
import org.eclipse.passage.lic.internal.base.diagnostic.DiagnosticExplained;
import org.eclipse.passage.lic.internal.base.diagnostic.NoErrors;
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;
import org.eclipse.passage.lic.internal.net.api.handle.NetResponse;
import org.eclipse.passage.lic.internal.net.handle.EObjectTransfer;
Expand All @@ -57,7 +52,7 @@ public Conditions(ProductUserRequest<RawRequest> data) {
public NetResponse get() {
log.debug(String.format("Mining conditions for product %s", data.product().get())); //$NON-NLS-1$
ServiceInvocationResult<Collection<ConditionPack>> conditions = //
new Miner(source, data.user().get())//
new FloatingConditions(source, data.user().get())//
.all(data.product().get());
if (!conditions.data().isPresent()) {
return new Failure.OperationFailed(//
Expand All @@ -80,23 +75,4 @@ private LicensePack pack(Collection<ConditionPack> conditions) {
).get();
}

private final class Miner extends LocalConditions {

private final Supplier<Path> base;

Miner(Supplier<Path> base, String user) {
super(//
new ConditionMiningTarget.Local().child("floating-server"), //$NON-NLS-1$
new ReassemblingMiningEquipment(user, base), //
new FloatingFileExtensions.FloatingLicenseEncrypted());
this.base = base;
}

@Override
protected Supplier<Path> base(LicensedProduct product) {
return new PathFromLicensedProduct(base, product);
}

}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/*******************************************************************************
* 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.lbc.internal.base.mine;

import java.nio.file.Path;
import java.util.function.Supplier;

import org.eclipse.passage.lic.floating.FloatingFileExtensions;
import org.eclipse.passage.lic.internal.api.LicensedProduct;
import org.eclipse.passage.lic.internal.api.conditions.ConditionMiningTarget;
import org.eclipse.passage.lic.internal.base.conditions.mining.LocalConditions;
import org.eclipse.passage.lic.internal.base.io.PathFromLicensedProduct;

final class FloatingConditions extends LocalConditions {

private final Supplier<Path> base;

FloatingConditions(Supplier<Path> base, String user) {
super(//
new ConditionMiningTarget.Local().child("floating-server"), //$NON-NLS-1$
new ReassemblingMiningEquipment(user, base), //
new FloatingFileExtensions.FloatingLicenseEncrypted());
this.base = base;
}

@Override
protected Supplier<Path> base(LicensedProduct product) {
return new PathFromLicensedProduct(base, product);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import org.eclipse.passage.lic.internal.api.conditions.mining.MiningEquipment;
import org.eclipse.passage.lic.internal.api.conditions.mining.MiningTool;

final class ReassemblingMiningEquipment implements MiningEquipment {
public final class ReassemblingMiningEquipment implements MiningEquipment {

private final String user;
private final Supplier<Path> base;
Expand Down
47 changes: 24 additions & 23 deletions bundles/org.eclipse.passage.lic.api/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -8,37 +8,38 @@ Bundle-Vendor: %Bundle-Vendor
Bundle-Copyright: %Bundle-Copyright
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Export-Package: org.eclipse.passage.lic.internal.api;
x-friends:="org.eclipse.passage.lbc.api,
x-friends:="org.eclipse.passage.lac,
org.eclipse.passage.lbc.api,
org.eclipse.passage.lbc.base,
org.eclipse.passage.loc.workbench,
org.eclipse.passage.loc.dashboard.ui,
org.eclipse.passage.loc.features.ui,
org.eclipse.passage.loc.licenses.ui,
org.eclipse.passage.loc.products.ui,
org.eclipse.passage.loc.users.ui,
org.eclipse.passage.loc.api,
org.eclipse.passage.lbc.base.tests,
org.eclipse.passage.lbc.seal,
org.eclipse.passage.lic.api.tests,
org.eclipse.passage.lic.base,
org.eclipse.passage.lic.jface,
org.eclipse.passage.lic.hc,
org.eclipse.passage.lic.equinox,
org.eclipse.passage.lic.equinox.tests,
org.eclipse.passage.lic.base.tests,
org.eclipse.passage.lic.api.tests,
org.eclipse.passage.lbc.base.tests,
org.eclipse.passage.loc.licenses.core,
org.eclipse.passage.lic.net,
org.eclipse.passage.lic.emf,
org.eclipse.passage.seal.demo.tests,
org.eclipse.passage.lic.hc.tests,
org.eclipse.passage.seal.demo,
org.eclipse.passage.lic.bc,
org.eclipse.passage.lic.e4.ui,
org.eclipse.passage.lic.emf,
org.eclipse.passage.lic.equinox,
org.eclipse.passage.lic.equinox.tests,
org.eclipse.passage.lic.hc,
org.eclipse.passage.lic.hc.tests,
org.eclipse.passage.lic.jface,
org.eclipse.passage.lic.json,
org.eclipse.passage.lic.licenses.migration,
org.eclipse.passage.lic.net,
org.eclipse.passage.lic.oshi,
org.eclipse.passage.loc.api,
org.eclipse.passage.loc.dashboard.ui,
org.eclipse.passage.loc.features.ui,
org.eclipse.passage.loc.licenses.core,
org.eclipse.passage.loc.licenses.ui,
org.eclipse.passage.loc.products.core,
org.eclipse.passage.lac,
org.eclipse.passage.lic.licenses.migration,
org.eclipse.passage.lac.seal",
org.eclipse.passage.loc.products.ui,
org.eclipse.passage.loc.users.ui,
org.eclipse.passage.loc.workbench,
org.eclipse.passage.seal.demo,
org.eclipse.passage.seal.demo.tests,
org.eclipse.passage.lac.gear",
org.eclipse.passage.lic.internal.api.access;
x-friends:="org.eclipse.passage.lic.base,
org.eclipse.passage.lic.e4.ui,
Expand Down
12 changes: 6 additions & 6 deletions bundles/org.eclipse.passage.lic.net/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,21 @@ Export-Package: org.eclipse.passage.lic.internal.net;
org.eclipse.passage.lbc.jetty,
org.eclipse.passage.lbc.base.tests,
org.eclipse.passage.lac",
org.eclipse.passage.lic.internal.net.api;x-friends:="org.eclipse.passage.lac.seal",
org.eclipse.passage.lic.internal.net.api;x-friends:="org.eclipse.passage.lac.gear",
org.eclipse.passage.lic.internal.net.api.handle;
x-friends:="org.eclipse.passage.lac,
org.eclipse.passage.lac.gear,
org.eclipse.passage.lac.jetty,
org.eclipse.passage.lbc.base,
org.eclipse.passage.lbc.base.tests,
org.eclipse.passage.lbc.jetty,
org.eclipse.passage.lic.jetty,
org.eclipse.passage.lac.seal",
org.eclipse.passage.lic.jetty",
org.eclipse.passage.lic.internal.net.connect,
org.eclipse.passage.lic.internal.net.handle;
x-friends:="org.eclipse.passage.lac,
org.eclipse.passage.lac.gear,
org.eclipse.passage.lbc.base,
org.eclipse.passage.lic.jetty,
org.eclipse.passage.lbc.jetty,
org.eclipse.passage.lbc.base.tests,
org.eclipse.passage.lac.seal"
org.eclipse.passage.lbc.jetty,
org.eclipse.passage.lic.jetty"
Bundle-ActivationPolicy: lazy

0 comments on commit e9dd779

Please sign in to comment.