-
Notifications
You must be signed in to change notification settings - Fork 314
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(web2): Replace NetAdmin with ConfigurationService in GwtNetworkConfigurationService #3964
Conversation
@@ -66,7 +66,10 @@ public List<? extends NetInterfaceConfig<? extends NetInterfaceAddressConfig>> g | |||
* @param mtu | |||
* - required MTU for the interface, -1 to keep the automatic default | |||
* @throws KuraException | |||
* | |||
* @deprecated Since 2.4 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we suggest the use of other APIs in replacement of these?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It doesn't exist a 1-to-1 replacement of this API. We can suggest to use directly the ConfigurationService.
nat.append(entry.getInInterface()).append(","); | ||
nat.append(entry.getOutInterface()).append(","); | ||
nat.append(entry.getProtocol()).append(","); | ||
if (entry.getSourceNetwork() == null || entry.getSourceNetwork().equals(UNKNOWN_NETWORK)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe better using Objects.isNull()?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or comparing using UNKNOWN_NETWORK.equals(entry.getSourceNetwork())?
firewallPortForwardConfigIP.setPermittedNetwork(new NetworkPair<>( | ||
(IP4Address) IPAddress.parseHostAddress(network), Short.parseShort(prefix))); | ||
nat.append(","); | ||
if (entry.getDestinationNetwork() == null || entry.getDestinationNetwork().equals(UNKNOWN_NETWORK)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here
I have tested in a device with ppp connection and even if the device was able to set the IP, no dns servers are set living an empty value and preventing from connecting to the cloud. |
|
25685e7
to
258d267
Compare
@pierantoniomerlino is the PR ready for review? Please also give a check on sonar |
I'm running some tests for the dhcp feature. I'll take a look at sonar too. |
private void fillDhcpServerProperties(GwtNetInterfaceConfig config, Map<String, Object> properties, | ||
String basePropName) throws UnknownHostException { | ||
StringBuilder dhcpServer4PropName = new StringBuilder(basePropName).append("dhcpServer4."); | ||
properties.put(dhcpServer4PropName.toString() + ENABLED, true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
StringBuilder.toString()
allocates a new string at each invocation. As an enhancement we could refactor the code to avoid calling this method multiple times to produce the same string.
} | ||
try { | ||
for (GwtFirewallOpenPortEntry entry : entries) { | ||
openPorts.append(entry.getPortRange()).append(","); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If entry.getPortRange()
returns null
, this will probably add the null
string in the configuration. Is this ok? This probably applies also to other fields.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mhh... the null
value is not allowed here. I mean, the web UI forces to set a value in the port range property.
Signed-off-by: Merlino <[email protected]>
Signed-off-by: Merlino <[email protected]>
Signed-off-by: Merlino <[email protected]>
Signed-off-by: Merlino <[email protected]>
Signed-off-by: Merlino <[email protected]>
Signed-off-by: Merlino <[email protected]>
Signed-off-by: Merlino <[email protected]>
Signed-off-by: Merlino <[email protected]>
Signed-off-by: Merlino <[email protected]>
Signed-off-by: Merlino <[email protected]>
Signed-off-by: Merlino <[email protected]>
Signed-off-by: Merlino <[email protected]>
Signed-off-by: Merlino <[email protected]>
Signed-off-by: Merlino <[email protected]>
Signed-off-by: Merlino <[email protected]>
Signed-off-by: Merlino <[email protected]>
Signed-off-by: Merlino <[email protected]>
0c1aced
to
489a2fe
Compare
This PR replaces the NetAdminService with the ConfigurationService for updating the network and firewall configuration from the webUI.