Class RegionConnectorConnectorElementProvider

java.lang.Object
energy.eddie.spring.regionconnector.extensions.RegionConnectorConnectorElementProvider

@RestController public class RegionConnectorConnectorElementProvider extends Object
The RegionConnectorConnectorElementProvider creates an HTTP GET mapping for the connector element javascript file for each individual region connector.
  • Constructor Details

    • RegionConnectorConnectorElementProvider

      public RegionConnectorConnectorElementProvider(@Qualifier("regionConnectorName") String regionConnectorName) throws FileNotFoundException
      RestController that serves the connector element javascript file. It requires a bean named RegionConnectorNameExtension.REGION_CONNECTOR_NAME_BEAN_NAME and determines the path of the connector element using this name.

      The connector element is expected to be at the classpath under the following path: /public/{RC-COMMON-PATH}/{regionConnectorName}/ce.js

      Whereas RC-COMMON-PATH is "region-connectors" and regionConnectorName is the parameter.

      Parameters:
      regionConnectorName - String bean containing the name of the region connector.
      Throws:
      FileNotFoundException - Thrown if the ce.js file cannot be found on the classpath.
  • Method Details

    • javascriptConnectorElement

      @GetMapping(value="/ce.js", produces="text/javascript") public String javascriptConnectorElement()