Bug 561248 - [Passage] design client API entry point
Summary: [Passage] design client API entry point
Status: RESOLVED FIXED
Alias: None
Product: Passage
Classification: Technology
Component: API (show other bugs)
Version: 0.8.0   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 0.9.0   Edit
Assignee: Elena Parovyshnaia CLA
QA Contact:
URL:
Whiteboard:
Keywords: api
Depends on:
Blocks: 561380
  Show dependency tree
 
Reported: 2020-03-19 05:42 EDT by Alexander Fedorov CLA
Modified: 2020-03-23 12:08 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Fedorov CLA 2020-03-19 05:42:25 EDT
We need developer-friendly entry points for to call our functionality, it should be as simple as:

1) `RestrictionVerdict verdict = new Passage().ask(identifier)` - to understand the restriction verdict without actual feature usage, a kind of  "what-if". This is synchronous `query` method, we should think about supporting `bulk` queries for multiple feature identifiers.


2) `new Passage().use(identifier)` - to start using the feature with all the AccessManager cycle applied. This is synchronous `command` method that can potentially pause or even block the execution of the current scenario according to the RestrictionVerdict. We should also think about supporting `bulk` commands for multiple feature identifiers and additional hints like "prefer UI".

These new methods should be carefully evaluated to replace all the other approaches we supporting at the moment like `org.eclipse.passage.lic.jface.actions.LicensedAction` and `org.eclipse.passage.lic.internal.e4.ui.restrictions.WorkbenchRestrictionExecutor`.
Comment 1 Elena Parovyshnaia CLA 2020-03-23 10:57:13 EDT
PR: https://github.com/eclipse-passage/passage/pull/171