Class HttpExternalSystem
- java.lang.Object
-
- org.openbravo.service.externalsystem.ExternalSystem
-
- org.openbravo.service.externalsystem.http.HttpExternalSystem
-
public class HttpExternalSystem extends ExternalSystem
Allows to communicate with an external system through HTTP requests
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.openbravo.service.externalsystem.ExternalSystem
ExternalSystem.Operation
-
-
Field Summary
Fields Modifier and Type Field Description static int
MAX_TIMEOUT
-
Constructor Summary
Constructors Constructor Description HttpExternalSystem()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
configure(ExternalSystemData configuration)
Configures the external system instance with the provided configuration.protected ExternalSystem.Operation
getDefaultOperation()
String
getURL()
CompletableFuture<ExternalSystemResponse>
send(ExternalSystem.Operation operation, Supplier<? extends InputStream> payloadSupplier, String path, Map<String,Object> configuration)
Sends information to the external system
-
-
-
Field Detail
-
MAX_TIMEOUT
public static final int MAX_TIMEOUT
- See Also:
- Constant Field Values
-
-
Method Detail
-
configure
public void configure(ExternalSystemData configuration)
Description copied from class:ExternalSystem
Configures the external system instance with the provided configuration. The extensions of this class must use this method to initialize their own configuration fields.- Overrides:
configure
in classExternalSystem
- Parameters:
configuration
- Provides the configuration data of the external system
-
getDefaultOperation
protected ExternalSystem.Operation getDefaultOperation()
- Overrides:
getDefaultOperation
in classExternalSystem
- Returns:
- the operation used by default when invoking the
ExternalSystem.send(Supplier)
method
-
send
public CompletableFuture<ExternalSystemResponse> send(ExternalSystem.Operation operation, Supplier<? extends InputStream> payloadSupplier, String path, Map<String,Object> configuration)
Description copied from class:ExternalSystem
Sends information to the external system- Specified by:
send
in classExternalSystem
- Parameters:
operation
- The operation to be applied in the external system with the sent informationpayloadSupplier
- A supplier of the input stream with the data to be sentpath
- An optional sequence of segments separated by a slash (/) that be appended to the base external system URI where the information will be eventually sent. It can be null if not needed.configuration
- Additional information used to configure the send operation- Returns:
- a CompletableFuture
containing the response data coming from the external system
-
getURL
public String getURL()
- Returns:
- the URL that this HTTP external system communicates with
-
-