Swordfish Documentation: Architecture: Policy Trading Plugin
Description (under construction)
The ServiceResolver retrieves policies in a two-step way very similar to the retrieval of endpoints.
- In a first step, a PolicyDocumentProvider is queried for raw policy documents corresponding to consumer and provider of the present service invocation. The PolicyDocumentProvider may get the policy documents from local storage or querying a remote registry.
- The second step is the extraction of the policy from the policy document for which purpose the ServiceResolver invokes a suitable PolicyExtractor.
- After retrieval of the consumer policy and all provider policies assigned to the desired provider, it invokes the PolicyProcessor for policy trading, which either returns an agreed policy for the first matching policy pair (consumer policy with first matching provider policy) or null if no policy matches.
- The PolicyProcessor delegates the work to a policy intersector component which deals with the platform policies, while outside the PolicyProcessor Policy and related objects are wrapped as Swordfish objects in order to reduce dependencies from the platform used for policy handling.
- The platform policy intersector is extensible allowing registration of handlers for custom policy assertions and listeners of the policy matching process.