Class ExternalSystem
- java.lang.Object
-
- org.openbravo.service.externalsystem.ExternalSystem
-
- Direct Known Subclasses:
HttpExternalSystem
public abstract class ExternalSystem extends Object
Used to define the communication with an external system. Classes extending this class must be annotated withProtocol
to declare the communication protocol it uses. The class must be used to retrieve instances of this class.
-
-
Constructor Summary
Constructors Constructor Description ExternalSystem()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected void
configure(ExternalSystemData configuration)
Configures the external system instance with the provided configuration.protected String
getName()
abstract CompletableFuture<ExternalSystemResponse>
send(Supplier<? extends InputStream> inputStreamSupplier)
Sends information to the external system
-
-
-
Method Detail
-
send
public abstract CompletableFuture<ExternalSystemResponse> send(Supplier<? extends InputStream> inputStreamSupplier)
Sends information to the external system- Parameters:
inputStreamSupplier
- A supplier of the input stream with the data to be sent- Returns:
- a CompletableFuture
containing the response data coming from the external system
-
configure
protected void configure(ExternalSystemData configuration)
Configures the external system instance with the provided configuration. The extensions of this class must use this method to initialize their own configuration fields.- Parameters:
configuration
- Provides the configuration data of the external system- Throws:
ExternalSystemConfigurationError
- in case the external system cannot be properly configured
-
getName
protected String getName()
- Returns:
- the name of the external system
-
-