Class ExternalSystemProvider
- java.lang.Object
-
- org.openbravo.service.externalsystem.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 Summary
Constructors Constructor Description ExternalSystemProvider()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Optional<ExternalSystem>
getExternalSystem(String externalSystemDataId)
Retrieves theExternalSystem
instance configured with theExternalSystemData
whose ID is received as parameterOptional<ExternalSystem>
getExternalSystem(ExternalSystemData externalSystemData)
Retrieves anExternalSystem
instance configured with the data included in the providedExternalSystemData
Optional<ExternalSystem>
getExternalSystemBySearchKey(String searchKey)
Retrieves theExternalSystem
instance configured with theExternalSystemData
whose search key is received as parametervoid
invalidateExternalSystem(String externalSystemId)
Removes from the provider the cachedExternalSystem
instance that is configured with theExternalSystemData
whose ID is received as parameter
-
-
-
Method Detail
-
getExternalSystem
public Optional<ExternalSystem> getExternalSystem(String externalSystemDataId)
Retrieves theExternalSystem
instance configured with theExternalSystemData
whose ID is received as parameter- Parameters:
externalSystemDataId
- The ID of theExternalSystemData
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 theExternalSystem
instance configured with theExternalSystemData
whose search key is received as parameter- Parameters:
searchKey
- The search key of theExternalSystemData
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 anExternalSystem
instance configured with the data included in the providedExternalSystemData
- Parameters:
externalSystemData
- TheExternalSystemData
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 cachedExternalSystem
instance that is configured with theExternalSystemData
whose ID is received as parameter- Parameters:
externalSystemId
- The ID of theExternalSystemData
-
-