Details
-
Bug
-
Resolution: Done
-
Major
-
7.0.0.Alpha1
-
None
Description
The default interface used for socket bindings comes from an attribute on the socket-binding-group element. The XML parser tracks the value and then adds it to the operation to create a socket-binding if the <socket-binding> element doesn't declare an interface.
This parser-based approach isn't sufficient as it only works for the parsing use case. Applying it elsewhere forces operations on child model resources (socket-bindings) to find out information stored in parent resources, which we want to avoid.
Better IMO is to make the "interface" field on the model representation of a socket binding nullable; the parser should just pass through what the XML says. The SocketBindingManagerService should store the default interface, like it currently stores the port offset. SocketBinding.getAddress() can then ask for the default address from SocketBindingManagerService if its own networkInterface field is null.