Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 8 Next »

Background

Some of the policy rules are country-specific which means that the logic must be contained in a class supplied by the Participating Nation (PN).  This page describes how the "Assertion Validator" component uses Java ServiceLoader is used to fetch a local "Policy Manager" implementation.

This task will be implemented in Release x.x.x. of assertion-validator.  Here is the JIRA:

JIRA AA-11 "Use Service Loader for Policy Rules (Policy Mgr) Implement restructure off assertion validation code"

Design

The diagram shows how the AssertionAttributeValidator uses the ServiceLoader to load the National implementation of PolicyManager.

It does not matter what the fully qualified name of the class is.  The ServiceLoader requires only that the class must implement PolicyManagerInterface and that there is a provider-configuration file in the resource directory META-INF/services.

If the AssertionAttributeValidator fails to load a National implementation then it will fallback to instanciating the DefaultPolicyManagerImpl.  This is useful for testing purposes and as an example of how to build the implementation.

We use the same approach for the Integration between Protocol Teminators and the National Connector. Please refer to that page for more information about the ServiceLoader.

Packaging

It is the responsibility of the PN to develop scripts to package the National implementation.  The recommended approach is to package the class (and any supporting classes) into a jar file.  This jar file must be bundled into the lib directory in the epsos-server.war.  The Swedish team have Maven scripts which fetch the war from joinup, extract, add the National jars and then create a new war.

  • No labels