Skip to content

Commit

Permalink
547295 Provide javadoc for org.eclipse.passage.lic.api.restrictions p…
Browse files Browse the repository at this point in the history
…ackage

Signed-off-by: Elena Parovyshnaia <elena.parovyshnaya@gmail.com>
  • Loading branch information
eparovyshnaya committed Nov 8, 2019
1 parent ac8860a commit 58f420c
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 6 deletions.
Expand Up @@ -15,17 +15,32 @@
import org.eclipse.passage.lic.api.LicensingResult;

/**
*
* Implement the {@link RestrictionVerdict}(s) for the licensed feature:
* <li>early exit from command line tools with notice</li>
* <li>blocking dialogs for UI application</li>
* <li>filtering out the UI</li>
* <li>blocking of bundles using OSGi level</li>
*
* The service implementing the <i>restrictions execution</i> phase
* of <i> access cycle</i>.
* @since 0.4.0
* @see org.eclipse.passage.lic.api
*/
public interface RestrictionExecutor {

/**
* <p>Applies the given {@link RestrictionVerdict}s for feature under licencing
* to the current runtime of the program.</p>
*
* <p>Is capable to affect the program runtime environment the following ways:</p>
* <ol>
* <li>early exit from command line tools with notice</li>
* <li>block dialogs for UI application</li>
* <li>filter out the UI</li>
* <li>block of bundles using OSGi level</li>
* </ol>
*
* @param verdicts restriction instructions gained at the pagse of <i>permission examining</i> phase of <i>access cycle</i>
* @return the final result summary of the current <i>access cycle</i>
*
* @since 0.4.0
*/
LicensingResult execute(Iterable<RestrictionVerdict> verdicts);

}
Expand Up @@ -20,12 +20,24 @@
*/
public interface RestrictionExecutorRegistry {

/**
* @since 0.4.0
*/
String getDefaultRestrictionLevelIdentifier();

/**
* @since 0.4.0
*/
Iterable<String> getRestrictionLevelIdentifiers();

/**
* @since 0.4.0
*/
RestrictionLevelDescriptor getRestrictionLevel(String identifier);

/**
* @since 0.4.0
*/
Iterable<? extends RestrictionLevelDescriptor> getRestrictionLevels();

}
Expand Up @@ -5,10 +5,19 @@
*/
public interface RestrictionLevelDescriptor {

/**
* @since 0.4.0
*/
String getIdentifier();

/**
* @since 0.4.0
*/
String getName();

/**
* @since 0.4.0
*/
String getDescription();

}
Expand Up @@ -21,12 +21,15 @@
* The data required to execute the restriction, produced by
* {@link PermissionExaminer} and consumed by {@link RestrictionExecutor}
*
* @see RestrictionExecutor
* @since 0.4.0
*/
public interface RestrictionVerdict {

/**
* General configuration
*
* @since 0.4.0
*/
LicensingConfiguration getLicensingConfiguration();

Expand All @@ -37,14 +40,22 @@ public interface RestrictionVerdict {
* @see LicensingRequirement
* @see org.eclipse.passage.lic.api.access.FeaturePermission
* @see org.eclipse.passage.lic.api.access.PermissionExaminer
* @since 0.4.0
*/
LicensingRequirement getLicensingRequirement();

/**
* Level of restriction severity, described freely, like "warn" or "fatal"
*
* @since 0.4.0
*/
String getRestrictionLevel();

/**
* Encoded reason of restriction, required for {@link RestrictionExecutor}
*
* @since 0.4.0
*/
int getRestrictionCode();

}

0 comments on commit 58f420c

Please sign in to comment.