Class DefaultS7MessageProcessor
java.lang.Object
org.apache.plc4x.java.s7.readwrite.optimizer.DefaultS7MessageProcessor
- All Implemented Interfaces:
S7MessageProcessor
While a SetupCommunication message is no problem, when reading or writing data,
situations could arise that have to be handled. The following situations have to
be handled:
- The number of request items is so big, that the resulting PDU would exceed the
agreed upon PDU size: The request has to be split up into multiple requests.
- If large blocks of data are requested by request items the result of a request
could exceed the PDU size: The requests has to be split up into multiple requests
where each requests response doesn't exceed the PDU size.
The following optimizations should be implemented:
- If blocks are read which are in near proximity to each other it could be better
to replace multiple requests by one that includes multiple blocks.
- Rearranging the order of request items could reduce the number of needed PDUs.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final intstatic final int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprocessRequest(S7MessageRequest request, int pduSize) processResponse(S7MessageRequest originalRequest, Map<S7MessageRequest, io.vavr.control.Either<S7MessageResponseData, Throwable>> result)
-
Field Details
-
EMPTY_READ_REQUEST_SIZE
public static final int EMPTY_READ_REQUEST_SIZE -
EMPTY_READ_RESPONSE_SIZE
public static final int EMPTY_READ_RESPONSE_SIZE -
EMPTY_WRITE_REQUEST_SIZE
public static final int EMPTY_WRITE_REQUEST_SIZE -
EMPTY_WRITE_RESPONSE_SIZE
public static final int EMPTY_WRITE_RESPONSE_SIZE
-
-
Constructor Details
-
DefaultS7MessageProcessor
-
-
Method Details
-
processRequest
public Collection<S7MessageRequest> processRequest(S7MessageRequest request, int pduSize) throws PlcException - Specified by:
processRequestin interfaceS7MessageProcessor- Throws:
PlcException
-
processResponse
public S7MessageResponseData processResponse(S7MessageRequest originalRequest, Map<S7MessageRequest, io.vavr.control.Either<S7MessageResponseData, Throwable>> result) - Specified by:
processResponsein interfaceS7MessageProcessor
-