/* (non-Javadoc)
@see net.roboconf.target.api.TargetHandler
#retrievePublicIpAddress(net.roboconf.target.api.TargetHandlerParameters, java.lang.String)
186834
@Override
	public String retrievePublicIpAddress( TargetHandlerParameters parameters, String machineId )
	throws TargetException {

		NovaApi novaApi = novaApi( parameters.getTargetProperties());
		String zoneName = findZoneName( novaApi, parameters.getTargetProperties());

		String result = null;
		Server server = novaApi.getServerApiForZone( zoneName ).get( machineId );
		if( server != null ) {
			result = server.getAccessIPv4();

			// Nothing found? Check floating IPs
			if( result == null ) {
				FloatingIPApi floatingIPApi = novaApi.getFloatingIPExtensionForZone( zoneName ).get();
				List<FloatingIP> ips = floatingIPApi.list().filter( new InstancePredicate( machineId )).toList();
				if( ips.size() > 0 )
					result = ips.get( 0 ).getIp();
			}
		}

		return result;
	}
435487
public static InetAddress getAddress() {
    	
        try {
        	return InetAddress.getByAddress(new byte[] {0,0,0,0});
            /*for (Enumeration e = NetworkInterface.getNetworkInterfaces();
                    e.hasMoreElements();) {

                NetworkInterface ni = (NetworkInterface) e.nextElement();
                System.out.println("NetworkInterface = " + ni.getName());
                if (!ni.getName().contains("lo")) {
                    for (Enumeration ee = ni.getInetAddresses(); ee.hasMoreElements();) {
                        InetAddress ip = (InetAddress) ee.nextElement();
                        if (ip instanceof Inet4Address && ip.getAddress() != null) {
                            return ip;
                        }
                        //System.out.println("Ip's: " + ip.getHostAddress());
                    }
                }
            }
            NetworkInterface lo = NetworkInterface.getByName("lo");
            if (lo != null) {
                for (Enumeration ee = lo.getInetAddresses(); ee.hasMoreElements();) {
                    InetAddress ip = (InetAddress) ee.nextElement();
                    if (ip instanceof Inet4Address && ip.getAddress() != null) {
                        return ip;
                    }
                }
            }
            
            NetworkInterface lo0 = NetworkInterface.getByName("lo0");
            if (lo0 != null) {
                for (Enumeration ee = lo0.getInetAddresses(); ee.hasMoreElements();) {
                    InetAddress ip = (InetAddress) ee.nextElement();
                    if (ip instanceof Inet4Address && ip.getAddress() != null) {
                        return ip;
                    }
                }
            }*/
        } catch (Exception e) {
            System.err.println("Error");
        }
        return null;
    }
1234151
@Override
    public Map<String, String[]> getPublicParameterMap() {
        // Only re-use render parameters on a render request
        if (this.portalRequestInfo.getUrlType() == UrlType.RENDER) {
            return this.portletWindow.getPublicRenderParameters();
        }

        return Collections.emptyMap();
    }
1065608
public static SubjectPublicKeyInfo getSubjectPublicKeyInfo(PublicKeyParameters publicKey)
    {
        try {
            if (publicKey instanceof BcPublicKeyParameters) {
                return ((BcPublicKeyParameters) publicKey).getSubjectPublicKeyInfo();
            } else {
                return SubjectPublicKeyInfoFactory.createSubjectPublicKeyInfo(getAsymmetricKeyParameter(publicKey));
            }
        } catch (IOException e) {
            // Very unlikely
            throw new IllegalArgumentException("Invalid public key, unable to get subject info.");
        }
    }
1305318
@Override
    public PublicKey getPublicKey() throws SocialLoginException {
        if (this.sslRefInfo == null) {
            SocialLoginService service = socialLoginServiceRef.getService();
            if (service == null) {
                if (tc.isDebugEnabled()) {
                    Tr.debug(tc, "Social login service is not available");
                }
                return null;
            }
            sslRefInfo = createSslRefInfoImpl(service);
        }
        return sslRefInfo.getPublicKey();
    }
259510
static public String getExternalIpAddress(){
		String ip = null;
		URL url = null;
		BufferedReader in = null;
		
		for (int i = 0; !isIPv4Address(ip) && i < CHECK_IP_ENDPOINTS.length; i ++, url = null, in = null){
			try{
				url = new URL(CHECK_IP_ENDPOINTS[i]);
				in = new BufferedReader(new InputStreamReader(url.openStream()));
				ip = in.readLine(); //you get the IP as a String
			}catch(Exception e){
				System.err.println("Unable to find out external IP address through end point '" + CHECK_IP_ENDPOINTS[i] + "': " + e.getMessage());
				if (in != null){
					try{
						in.close();
					}catch(Exception e2){
						// ignore
					}
				}
			}
		}
		return ip;
		
	}
273161
func (s *AddressService) GetPublicIpAddressByID(id string, opts ...OptionFunc) (*PublicIpAddress, int, error) {
	p := &ListPublicIpAddressesParams{}
	p.p = make(map[string]interface{})

	p.p["id"] = id

	for _, fn := range append(s.cs.options, opts...) {
		if err := fn(s.cs, p); err != nil {
			return nil, -1, err
		}
	}

	l, err := s.ListPublicIpAddresses(p)
	if err != nil {
		if strings.Contains(err.Error(), fmt.Sprintf(
			"Invalid parameter id value=%s due to incorrect long value format, "+
				"or entity does not exist", id)) {
			return nil, 0, fmt.Errorf("No match found for %s: %+v", id, l)
		}
		return nil, -1, err
	}

	if l.Count == 0 {
		return nil, l.Count, fmt.Errorf("No match found for %s: %+v", id, l)
	}

	if l.Count == 1 {
		return l.PublicIpAddresses[0], l.Count, nil
	}
	return nil, l.Count, fmt.Errorf("There is more then one result for PublicIpAddress UUID: %s!", id)
}
1276352
public PublicIpMetadata getPublicIp(Server serverRef, String publicIp) {
        return this.getPublicIp(idByRef(serverRef), publicIp);
    }
1236763
public java.util.List<InstancePrivateIpAddress> getPrivateIpAddresses() {
        if (privateIpAddresses == null) {
            privateIpAddresses = new com.amazonaws.internal.SdkInternalList<InstancePrivateIpAddress>();
        }
        return privateIpAddresses;
    }
705052
public String getPublicKey() {
        RSAPublicKey key = InstanceIdentityProvider.RSA.getPublicKey();
        if (key == null) {
            return null;
        }
        byte[] encoded = Base64.encodeBase64(key.getEncoded());
        int index = 0;
        StringBuilder buf = new StringBuilder(encoded.length + 20);
        while (index < encoded.length) {
            int len = Math.min(64, encoded.length - index);
            if (index > 0) {
                buf.append("\n");
            }
            buf.append(new String(encoded, index, len, Charsets.UTF_8));
            index += len;
        }
        return String.format("-----BEGIN PUBLIC KEY-----%n%s%n-----END PUBLIC KEY-----%n", buf.toString());
    }
637634
protected String getRemoteAddress() {
        String ipAddress = this.response.getRequest().getHeader("x-forwarded-for");
        if (ipAddress == null) {
            ipAddress = this.response.getRequest().getHeader("X_FORWARDED_FOR");
            if (ipAddress == null){
                ipAddress = this.response.getRequest().getRemoteAddr();
            }
        }
        return this.response.getRequest().getScheme() + "://" + ipAddress;
    }
79561
private ModelNode parseAddress(final String profileName, final String inputAddress) {
        final ModelNode result = new ModelNode();
        if (profileName != null) {
            result.add(ServerOperations.PROFILE, profileName);
        }
        String[] parts = inputAddress.split(",");
        for (String part : parts) {
            String[] address = part.split("=");
            if (address.length != 2) {
                throw new RuntimeException(part + " is not a valid address segment");
            }
            result.add(address[0], address[1]);
        }
        return result;
    }
1039581
public byte[] getPublic() {
        keyNotNull(pair.getPublic());
        Key key = pair.getPublic();
        return getKeyBytes(key);
    }
1045471
public com.google.api.ads.adwords.axis.v201809.cm.Address getAddress() {
        return address;
    }
668288
def address(self) -> str:
        ''''''

        return str(self._public_key.to_address(
                   net_query(self.network))
                   )
1115390
public CommandAndIPAddress getCommandAndIPAddress()
    {
        CommandAndIPAddress command = null;
        synchronized(this)
        {
            if (commandQueue.size() > 0)
            {
                command = commandQueue.remove(0);
            }
        }
        return command;
    }
564550
public static String getAddressForUrl(String address, boolean resolveForIp) {
        if (address == null) {
            return null;
        }

        // drop schema
        int pos = address.indexOf("://");
        if (pos > 0) {
            address = address.substring(pos + 3);
        }

        // drop user authentication information
        pos = address.indexOf('@');
        if (pos > 0) {
            address = address.substring(pos + 1);
        }

        // drop trailing parts: port number, query parameters, path, fragment
        for (int i = 0; i < address.length(); ++i) {
            char c = address.charAt(i);
            if ((c == ':') || (c == '?') || (c == '/') || (c == '#')) {
                return address.substring(0, i);
            }
        }
        return address;
    }