Class ExternalSystemProvider


  • @ApplicationScoped
    public class ExternalSystemProvider
    extends Object
    Provides instances used to communicate with different external systems and that are kept in an in memory cache to favor its reuse. Note that for a given configuration it always retrieves the same instance.
    • Constructor Detail

      • ExternalSystemProvider

        public ExternalSystemProvider()
    • Method Detail

      • getExternalSystem

        public Optional<ExternalSystem> getExternalSystem​(String externalSystemDataId)
        Retrieves the ExternalSystem instance configured with the ExternalSystemData whose ID is received as parameter
        Parameters:
        externalSystemDataId - The ID of the ExternalSystemData that contains the configuration data
        Returns:
        an Optional with the external system instance or an empty Optional in case it is not possible to create it for example due to a configuration problem or because an external system configuration with the provided ID cannot be found or is not active
      • getExternalSystemBySearchKey

        public Optional<ExternalSystem> getExternalSystemBySearchKey​(String searchKey)
        Retrieves the ExternalSystem instance configured with the ExternalSystemData whose search key is received as parameter
        Parameters:
        searchKey - The search key of the ExternalSystemData that contains the configuration data
        Returns:
        an Optional with the external system instance or an empty Optional in case it is not possible to create it for example due to a configuration problem or because an external system configuration with the provided search key cannot be found or is not active
      • getExternalSystem

        public Optional<ExternalSystem> getExternalSystem​(ExternalSystemData externalSystemData)
        Retrieves an ExternalSystem instance configured with the data included in the provided ExternalSystemData
        Parameters:
        externalSystemData - The ExternalSystemData instance that contains the configuration data
        Returns:
        an Optional with the external system instance or an empty Optional in case it is not possible to create it for example due to a configuration problem or because the provided configuration cannot be found or is not active
      • invalidateExternalSystem

        public void invalidateExternalSystem​(String externalSystemId)
        Removes from the provider the cached ExternalSystem instance that is configured with the ExternalSystemData whose ID is received as parameter
        Parameters:
        externalSystemId - The ID of the ExternalSystemData