Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[#1404] FLS: evolve to reduce maintenance cost #1409

Merged
merged 1 commit into from
Jul 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ Require-Bundle: org.eclipse.core.runtime;bundle-version="0.0.0",
org.eclipse.passage.lic.base;bundle-version="0.0.0",
org.eclipse.passage.lic.bc;bundle-version="0.0.0",
org.eclipse.passage.lic.equinox;bundle-version="0.0.0",
org.eclipse.passage.lic.hc;bundle-version="0.0.0",
org.eclipse.passage.lic.licenses;bundle-version="0.0.0",
org.eclipse.passage.lic.licenses.model;bundle-version="0.0.0",
org.eclipse.passage.lic.oshi;bundle-version="0.0.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
*
* @since 2.1
*/
@SuppressWarnings("restriction")
public final class ConfigurationResidentConditions extends LocalConditions {

public ConfigurationResidentConditions(MiningEquipment equipment) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

@SuppressWarnings("restriction")
public final class DefaultFramework extends BaseFramework {

private final Logger log;
Expand All @@ -37,7 +38,7 @@ public DefaultFramework(Supplier<Bundle> bundle) {
configureLogging();
this.log = LoggerFactory.getLogger(getClass());
logConfiguration();
this.configuration = new FocusedAccessCycleConfiguration.Wide(this::product, bundle);
this.configuration = new FocusedAccessCycleConfiguration.Personal(this::product, bundle);
}

@Override
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2020, 2021 ArSysOp
* Copyright (c) 2020, 2024 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 @@ -8,7 +8,7 @@
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* ArSysOp - initial API and implementation
* ArSysOp - initial API, implementation, support
*******************************************************************************/
package org.eclipse.passage.lic.execute;

Expand Down Expand Up @@ -49,30 +49,4 @@ public Personal(Supplier<LicensedProduct> product, Supplier<Bundle> bundle) {

}

/**
* Focuses Access Cycle Configuration on remote license mining
*/
public static final class Floating extends FocusedAccessCycleConfiguration {

public Floating(Supplier<LicensedProduct> product, Supplier<Bundle> bundle) {
super(product, bundle);
this.delegate = new FloatingLicensing(super.keyKeepers(), super.codecs(), super.transports());
}

}

/**
* Adapts Access Cycle Configuration to both local and remote license mining
*/
public static final class Wide extends FocusedAccessCycleConfiguration {

public Wide(Supplier<LicensedProduct> product, Supplier<Bundle> bundle) {
super(product, bundle);
this.delegate = new LicensingDirection.Joint(//
new PersonalLicensing(super::miningEquipment), //
new FloatingLicensing(super.keyKeepers(), super.codecs(), super.transports()));
}

}

}
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
*
* @since 2.1
*/
@SuppressWarnings("restriction")
public final class InstallationResidentConditions extends LocalConditions {

public InstallationResidentConditions(MiningEquipment equipment) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ public final class NamespaceConfiguraton implements AccessCycleConfiguration {
private final BundleRequirementsForNamespace requirements;

public NamespaceConfiguraton(String namespace, Supplier<LicensedProduct> product, Supplier<Bundle> bundle) {
this(new FocusedAccessCycleConfiguration.Wide(product, bundle), new BundleRequirementsForNamespace(namespace));
this(new FocusedAccessCycleConfiguration.Personal(product, bundle),
new BundleRequirementsForNamespace(namespace));
}

public NamespaceConfiguraton(String namespace, AccessCycleConfiguration delegate) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,13 @@
import org.eclipse.passage.lic.equinox.acquire.ConfigurationLicenseAcquisitionService;
import org.eclipse.passage.lic.equinox.acquire.InstallationLicenseAcquisitionService;

final class PersonalLicensing implements LicensingDirection {
@SuppressWarnings("restriction")
public final class PersonalLicensing implements LicensingDirection {

private final Registry<ConditionMiningTarget, MinedConditions> conditions;
private final Registry<ConditionMiningTarget, LicenseAcquisitionService> acquirers;

PersonalLicensing(Supplier<MiningEquipment> equipment) {
public PersonalLicensing(Supplier<MiningEquipment> equipment) {
this.conditions = new ReadOnlyRegistry<>(Arrays.asList(//
new UserHomeResidentConditions(equipment.get()), //
new InstallationResidentConditions(equipment.get()), //
Expand Down
Loading