Github user markap14 commented on a diff in the pull request:

    https://github.com/apache/nifi/pull/1550#discussion_r103784862
  
    --- Diff: 
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/remote/StandardRemoteProcessGroup.java
 ---
    @@ -856,10 +864,75 @@ public void refreshFlowContents() throws 
CommunicationsException {
             }
         }
     
    +    @Override
    +    public String getNetworkInterface() {
    +        readLock.lock();
    +        try {
    +            return networkInterfaceName;
    +        } finally {
    +            readLock.unlock();
    +        }
    +    }
    +
    +    @Override
    +    public void setNetworkInterface(final String interfaceName) {
    +        writeLock.lock();
    +        try {
    +            this.networkInterfaceName = interfaceName;
    +
    +            try {
    +                final Enumeration<InetAddress> inetAddresses = 
NetworkInterface.getByName(interfaceName).getInetAddresses();
    +
    +                if (inetAddresses.hasMoreElements()) {
    +                    this.localAddress = inetAddresses.nextElement();
    --- End diff --
    
    @phrocker you are right - the user is selecting a name that could 
potentially map to multiple IP's. I'm not sure what the right approach to this 
is. This seemed like a reasonable option to me. The only other option that I 
could think of would be to require that both a network interface and a 
hostname/IP be provided. But for a clustered environment, that won't work. So 
picking the first one seemed the best option to me. Any other suggestion?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to