Interface NetworkBuilder
@API(status=STABLE,
since="2.0.0-milestone.1.0")
public interface NetworkBuilder
Manages the network state of a
NetworkNode
.
Performs merge, split and remove operations as necessary.-
Method Summary
Modifier and TypeMethodDescriptionboolean
initialize
(NetworkNodeContainer container, ConnectionProvider connectionProvider) Initializes a not yet connected network node container.void
remove
(NetworkNodeContainer container, ConnectionProvider connectionProvider) Removes a container from its network.void
update
(NetworkNodeContainer container, ConnectionProvider connectionProvider) Updates the network associated with the given container.
-
Method Details
-
initialize
Initializes a not yet connected network node container. If the network node already has an associatedNetwork
, calling this will do nothing. This will perform a merge operation.- Parameters:
container
- the containerconnectionProvider
- the connection provider- Returns:
- true if the container has no network yet, and the initialization succeeded, false otherwise
-
remove
Removes a container from its network. Will remove the network if the container is the last container in the network, or otherwise it performs a split operation.- Parameters:
container
- the containerconnectionProvider
- the connection provider
-
update
Updates the network associated with the given container. Makes the network state adapt to connection changes of an already connected container. Will perform a split and/or a merge operation.- Parameters:
container
- the containerconnectionProvider
- the connection provider
-