public class SocketControllerBuilder extends Object
| Constructor | Description |
|---|---|
SocketControllerBuilder() |
| Modifier and Type | Method | Description |
|---|---|---|
RemoteMenuController |
build() |
Once the above methods have been called to fill in the blanks, then call build to get
the actual instance.
|
SocketControllerBuilder |
withAddress(String address) |
Mandatory, the address on which this socket is to bind to receive and send datagrams.
|
SocketControllerBuilder |
withClock(java.time.Clock clock) |
Optional, defaults to system clock but can be overriden
|
SocketControllerBuilder |
withExecutor(ScheduledExecutorService executor) |
Optional, defaults to creating a suitable executor for single connectivity
|
SocketControllerBuilder |
withHeartbeatFrequency(int frequency) |
Optional, defaults to 10 seconds between heartbeats.
|
SocketControllerBuilder |
withLocalName(String name) |
Optional, Set the name of this connection, defaults to NoName
|
SocketControllerBuilder |
withMenuTree(MenuTree tree) |
Mandatory, the menuTree instance to store the menu items retrieved from the remote side.
|
SocketControllerBuilder |
withPort(int port) |
Mandatory, the port locally on which to bind for multicast packets.
|
SocketControllerBuilder |
withProtocol(MenuCommandProtocol protocol) |
Optional, defaults to the standard protocol.
|
public SocketControllerBuilder withClock(java.time.Clock clock)
clock - the clock to usepublic SocketControllerBuilder withExecutor(ScheduledExecutorService executor)
executor - the executor which must implement ScheduledExecutorServicepublic SocketControllerBuilder withHeartbeatFrequency(int frequency)
frequency - the frequency, must align with remote device.public SocketControllerBuilder withMenuTree(MenuTree tree)
tree - the menu tree to be populated (only use a menu tree with one remote)public SocketControllerBuilder withProtocol(MenuCommandProtocol protocol)
protocol - a protocol object.public SocketControllerBuilder withLocalName(String name)
name - the name the remote will see.public SocketControllerBuilder withAddress(String address)
address - address on which to send and receive.public SocketControllerBuilder withPort(int port)
port - the bind portpublic RemoteMenuController build() throws IOException
IOExceptionCopyright © 2018. All rights reserved.