RequestT
- The type of the request to execute.RequestResultT
- The type of the result to return.public class SoapTransaction<RequestT extends AbstractRemoteFunctionRequest<RequestT,RequestResultT>,RequestResultT extends AbstractRemoteFunctionRequestResult<RequestT,RequestResultT>> extends Object implements Transaction<RequestT,RequestResultT>
Transaction
interface to be used for SOAP queries.Constructor and Description |
---|
SoapTransaction(RequestSerializer<RequestT,RequestResultT> requestSerializer,
ErpHttpRequestExecutor<RequestT,RequestResultT> requestExecutorLogic,
ErpHttpRequestExecutor<BapiRequest,BapiRequestResult> bapiRequestExecutorLogic) |
Modifier and Type | Method and Description |
---|---|
void |
after()
This method gets called *in any case* after the transactional calls are done.
|
void |
before(Destination destination,
RequestT request)
This method gets called before anything else gets called in the
RemoteFunctionRequestExecutor . |
void |
commit(Destination destination,
RequestT request)
If
Transaction.execute(Destination, AbstractRemoteFunctionRequest) succeeded, this method is called to actually
commit the changes. |
RequestResultT |
execute(Destination destination,
RequestT request)
The actual logic to be executed.
|
void |
rollback(Destination destination,
RequestT request)
If there was a problem with
Transaction.execute(Destination, AbstractRemoteFunctionRequest) or
Transaction.commit(Destination, AbstractRemoteFunctionRequest) this method will get called to rollback any unwanted
changes. |
public SoapTransaction(RequestSerializer<RequestT,RequestResultT> requestSerializer, ErpHttpRequestExecutor<RequestT,RequestResultT> requestExecutorLogic, ErpHttpRequestExecutor<BapiRequest,BapiRequestResult> bapiRequestExecutorLogic)
public void before(@Nonnull Destination destination, @Nonnull RequestT request)
Transaction
RemoteFunctionRequestExecutor
.before
in interface Transaction<RequestT extends AbstractRemoteFunctionRequest<RequestT,RequestResultT>,RequestResultT extends AbstractRemoteFunctionRequestResult<RequestT,RequestResultT>>
destination
- The Destination
of this call.request
- The AbstractRemoteFunctionRequest
going to be executed.@Nonnull public RequestResultT execute(@Nonnull Destination destination, @Nonnull RequestT request) throws RequestExecutionException
Transaction
execute
in interface Transaction<RequestT extends AbstractRemoteFunctionRequest<RequestT,RequestResultT>,RequestResultT extends AbstractRemoteFunctionRequestResult<RequestT,RequestResultT>>
destination
- The Destination
of this call.request
- The AbstractRemoteFunctionRequest
going to execute.AbstractRemoteFunctionRequestResult
created by the request.RequestExecutionException
- if an exception occurred during the execute
implementation.public void commit(@Nonnull Destination destination, @Nonnull RequestT request) throws RequestSerializationException, RequestExecutionException
Transaction
Transaction.execute(Destination, AbstractRemoteFunctionRequest)
succeeded, this method is called to actually
commit the changes.commit
in interface Transaction<RequestT extends AbstractRemoteFunctionRequest<RequestT,RequestResultT>,RequestResultT extends AbstractRemoteFunctionRequestResult<RequestT,RequestResultT>>
destination
- The Destination
of this call.request
- The AbstractRemoteFunctionRequest
that was executed.RequestExecutionException
- If an exception occurred during the commit
implementation.RequestSerializationException
public void rollback(@Nonnull Destination destination, @Nonnull RequestT request) throws RequestSerializationException, RequestExecutionException
Transaction
Transaction.execute(Destination, AbstractRemoteFunctionRequest)
or
Transaction.commit(Destination, AbstractRemoteFunctionRequest)
this method will get called to rollback any unwanted
changes.rollback
in interface Transaction<RequestT extends AbstractRemoteFunctionRequest<RequestT,RequestResultT>,RequestResultT extends AbstractRemoteFunctionRequestResult<RequestT,RequestResultT>>
destination
- The Destination
of this call.request
- The AbstractRemoteFunctionRequest
that was executed.RequestExecutionException
- If an exception occurred during the rollback
implementation.RequestSerializationException
public void after()
Transaction
after
in interface Transaction<RequestT extends AbstractRemoteFunctionRequest<RequestT,RequestResultT>,RequestResultT extends AbstractRemoteFunctionRequestResult<RequestT,RequestResultT>>
Copyright © 2019 SAP SE. All rights reserved.