public static class SynchronousCommunication.Builder extends Object
| Constructor and Description |
|---|
Builder(@NonNull CommunicationSocket communicationSocket)
Builder
|
| Modifier and Type | Method and Description |
|---|---|
SynchronousCommunication |
build()
Build
SynchronousCommunication |
SynchronousCommunication.Builder |
withErrorChecker(SynchronousCommunication.CheckResultInterface errorCheckerFunction)
Errors caught on the message layer, be sure to catch the whole error message to
empty the input buffers.
|
SynchronousCommunication.Builder |
withReceiveDelimiter(@NonNull String receiveDelimiter) |
SynchronousCommunication.Builder |
withSendDelimiter(@NonNull String sendDelimiter) |
SynchronousCommunication.Builder |
withStartupMessageFlusher(@NonNull WelcomeFlusherFunction startupFunction)
Some connections send startup messages that need to be flushed, so this will assign a runnable
to the startupFunction.
|
public Builder(@NonNull
@NonNull CommunicationSocket communicationSocket)
communicationSocket - Communication Socket that will be handled by this classpublic SynchronousCommunication.Builder withSendDelimiter(@NonNull @NonNull String sendDelimiter)
sendDelimiter - Delimiter used to mark end of sent messagespublic SynchronousCommunication.Builder withReceiveDelimiter(@NonNull @NonNull String receiveDelimiter)
receiveDelimiter - Delimiter used to mark end of received messagespublic SynchronousCommunication.Builder withStartupMessageFlusher(@NonNull @NonNull WelcomeFlusherFunction startupFunction)
startupFunction - Start function that is triggered on every reconnectionpublic SynchronousCommunication.Builder withErrorChecker(SynchronousCommunication.CheckResultInterface errorCheckerFunction)
errorCheckerFunction - Function that throws IOException or derivative on detected error.public SynchronousCommunication build()
SynchronousCommunicationSynchronousCommunication instanceCopyright © 2024 SiLA Java Developers. All rights reserved.