From c6129f4b821ad829ce6295ed3aff447a6e3f9db8 Mon Sep 17 00:00:00 2001 From: "elena.parovyshnaya" Date: Fri, 8 Nov 2019 16:57:10 +0300 Subject: [PATCH] 547292 [Passage] Provide javadoc for org.eclipse.passage.lic.api.inspector package Signed-off-by: Elena Parovyshnaia --- .../lic/api/inspector/FeatureCase.java | 24 ++++ .../lic/api/inspector/FeatureInspector.java | 27 ++++- .../lic/api/inspector/HardwareInspector.java | 107 +++++++++++++++++- 3 files changed, 155 insertions(+), 3 deletions(-) diff --git a/bundles/org.eclipse.passage.lic.api/src/org/eclipse/passage/lic/api/inspector/FeatureCase.java b/bundles/org.eclipse.passage.lic.api/src/org/eclipse/passage/lic/api/inspector/FeatureCase.java index d0567becb..7425d6dc1 100644 --- a/bundles/org.eclipse.passage.lic.api/src/org/eclipse/passage/lic/api/inspector/FeatureCase.java +++ b/bundles/org.eclipse.passage.lic.api/src/org/eclipse/passage/lic/api/inspector/FeatureCase.java @@ -16,16 +16,40 @@ import org.eclipse.passage.lic.api.restrictions.RestrictionVerdict; /** + * Pre-evaluated license coverage for a particular features subset (affected, say, by one user scenario), + * managed by {@code FeatureInspector} + * + * @see FeatureInspector * @since 0.4.0 */ public interface FeatureCase extends AutoCloseable { + /** + * Identifiers of the features under inspection. + * + * @since 0.4.0 + */ Iterable getFeatureIdentifiers(); + /** + * {@code Requirement}s resolved during the inspection + * + * @since 0.4.0 + */ Iterable getRequirements(); + /** + * {@code Restriction}s evaluated as the result of the inspection + * + * @since 0.4.0 + */ Iterable getRestrictions(); + /** + * The case is auto-closable + * + * @since 0.4.0 + */ @Override void close(); diff --git a/bundles/org.eclipse.passage.lic.api/src/org/eclipse/passage/lic/api/inspector/FeatureInspector.java b/bundles/org.eclipse.passage.lic.api/src/org/eclipse/passage/lic/api/inspector/FeatureInspector.java index af2ea4250..d50d09a7e 100644 --- a/bundles/org.eclipse.passage.lic.api/src/org/eclipse/passage/lic/api/inspector/FeatureInspector.java +++ b/bundles/org.eclipse.passage.lic.api/src/org/eclipse/passage/lic/api/inspector/FeatureInspector.java @@ -3,14 +3,37 @@ import org.eclipse.passage.lic.api.LicensingConfiguration; /** + *

+ * There are use cases, where all but the last step of access cycle are required. + * For those cases {@code FeatureInspector} contract implements a subset of those steps, + * called inspection cycle, in order to preliminary evaluate license coverage for a whole running product + * or for a particular user scenario (that affects potentially several features under licensing). + *

+ * * @since 0.4.0 */ public interface FeatureInspector { - + + /** + * General configuration of a running product + * + * @since 0.4.0 + */ LicensingConfiguration getLicensingConfiguration(); - + + /** + * Convenience method + * + * @see #inspectFeatures(Iterable) + * @since 0.4.0 + */ FeatureCase inspectFeatures(String... identifiers); + /** + * Pre-evaluates license coverage for specified features. + * + * @since 0.4.0 + */ FeatureCase inspectFeatures(Iterable identifiers); } diff --git a/bundles/org.eclipse.passage.lic.api/src/org/eclipse/passage/lic/api/inspector/HardwareInspector.java b/bundles/org.eclipse.passage.lic.api/src/org/eclipse/passage/lic/api/inspector/HardwareInspector.java index af547abab..2163ef64f 100644 --- a/bundles/org.eclipse.passage.lic.api/src/org/eclipse/passage/lic/api/inspector/HardwareInspector.java +++ b/bundles/org.eclipse.passage.lic.api/src/org/eclipse/passage/lic/api/inspector/HardwareInspector.java @@ -12,49 +12,154 @@ *******************************************************************************/ package org.eclipse.passage.lic.api.inspector; +import org.eclipse.passage.lic.api.conditions.LicensingCondition; +import org.eclipse.passage.lic.api.access.PermissionEmitter; + import java.io.IOException; import java.io.OutputStream; /** + *

Contract for a service capable to uncover and enlist current hardware details, sufficient for licensing.

+ * + *

Used, for example, by {@code PermissionEmitter} on analysis of a {@code LicensingCondition}, + * which has hardware {@code conditionType}. This one is expected to enlist all hardware information encoded in it's {@code conditionExpression}. + * Thus the {@code emitter} can check is encoded hardware information fits to the one gathered by this service.

+ * + * @see PermissionEmitter + * @see LicensingCondition#getConditionType + * @see LicensingCondition#getConditionExpression * @since 0.4.0 */ public interface HardwareInspector { - + /** + * @since 0.4.0 + */ String PROPERTY_OS_FAMILY = "os.family"; //$NON-NLS-1$ + /** + * @since 0.4.0 + */ String PROPERTY_OS_MANUFACTURER = "os.manufacturer"; //$NON-NLS-1$ + /** + * @since 0.4.0 + */ String PROPERTY_OS_VERSION = "os.version"; //$NON-NLS-1$ + /** + * @since 0.4.0 + */ String PROPERTY_OS_BUILDNUMBER = "os.buildnumber"; //$NON-NLS-1$ + /** + * @since 0.4.0 + */ String PROPERTY_SYSTEM_MANUFACTURER = "system.manufacturer"; //$NON-NLS-1$ + /** + * @since 0.4.0 + */ String PROPERTY_SYSTEM_MODEL = "system.model"; //$NON-NLS-1$ + /** + * @since 0.4.0 + */ String PROPERTY_SYSTEM_SERIALNUMBER = "system.serialnumber"; //$NON-NLS-1$ + /** + * @since 0.4.0 + */ String PROPERTY_BASEBOARD_MANUFACTURER = "baseboard.manufacturer"; //$NON-NLS-1$ + /** + * @since 0.4.0 + */ String PROPERTY_BASEBOARD_MODEL = "baseboard.model"; //$NON-NLS-1$ + /** + * @since 0.4.0 + */ String PROPERTY_BASEBOARD_VERSION = "baseboard.version"; //$NON-NLS-1$ + /** + * @since 0.4.0 + */ String PROPERTY_BASEBOARD_SERIALNUMBER = "baseboard.serialnumber"; //$NON-NLS-1$ + /** + * @since 0.4.0 + */ + /** + * @since 0.4.0 + */ String PROPERTY_FIRMWARE_MANUFACTURER = "firmware.manufacturer"; //$NON-NLS-1$ + /** + * @since 0.4.0 + */ String PROPERTY_FIRMWARE_VERSION = "firmware.version"; //$NON-NLS-1$ + /** + * @since 0.4.0 + */ String PROPERTY_FIRMWARE_RELEASEDATE = "firmware.releasedate"; //$NON-NLS-1$ + /** + * @since 0.4.0 + */ String PROPERTY_FIRMWARE_NAME = "firmware.name"; //$NON-NLS-1$ + /** + * @since 0.4.0 + */ String PROPERTY_FIRMWARE_DESCRIPTION = "firmware.description"; //$NON-NLS-1$ + /** + * @since 0.4.0 + */ String PROPERTY_CPU_VENDOR = "cpu.vendor"; //$NON-NLS-1$ ; + /** + * @since 0.4.0 + */ String PROPERTY_CPU_FAMILY = "cpu.family"; //$NON-NLS-1$ + /** + * @since 0.4.0 + */ String PROPERTY_CPU_MODEL = "cpu.model"; //$NON-NLS-1$ + /** + * @since 0.4.0 + */ String PROPERTY_CPU_NAME = "cpu.name"; //$NON-NLS-1$ + /** + * @since 0.4.0 + */ String PROPERTY_CPU_IDENTIFIER = "cpu.identifier"; //$NON-NLS-1$ + /** + * @since 0.4.0 + */ String PROPERTY_CPU_PROCESSORID = "cpu.processorid"; //$NON-NLS-1$ + /** + * @since 0.4.0 + */ String PROPERTY_HWDISK_MODEL = "hwdisk.model"; //$NON-NLS-1$ ; + /** + * @since 0.4.0 + */ String PROPERTY_HWDISK_NAME = "hwdisk.name"; //$NON-NLS-1$ + /** + * @since 0.4.0 + */ String PROPERTY_HWDISK_SERIAL = "hwdisk.serial"; //$NON-NLS-1$ + /** + * Discovers hardware information and writes it to the {@code output} + * + * @param output target stream. Stays {@code opened}, closure is on the caller's side. + * @since 0.4.0 + */ void dumpHardwareInfo(OutputStream output) throws IOException; + /** + * Enlist names for all uncovered hardware properties. + * + * @since 0.4.0 + */ Iterable getKnownProperties(); + /** + * Get a value for a named hardware information. + * + * @since 0.4.0 + */ String inspectProperty(String name); }