@Override
    public InstanceInfo getInstanceByAppAndId(String appName, String id, boolean includeRemoteRegions) {
        Map<String, Lease<InstanceInfo>> leaseMap = registry.get(appName);
        Lease<InstanceInfo> lease = null;
        if (leaseMap != null) {
            lease = leaseMap.get(id);
        }
        if (lease != null
                && (!isLeaseExpirationEnabled() || !lease.isExpired())) {
            return decorateInstanceInfo(lease);
        } else if (includeRemoteRegions) {
            for (RemoteRegionRegistry remoteRegistry : this.regionNameVSRemoteRegistry.values()) {
                Application application = remoteRegistry.getApplication(appName);
                if (application != null) {
                    return application.getByInstanceId(id);
                }
            }
        }
        return null;
    }
@ Override public InstanceInfo getInstanceByAppAndId ( String appName , String id , boolean includeRemoteRegions ) { Map < String , Lease < InstanceInfo > > leaseMap = registry . get ( appName ) ; Lease < InstanceInfo > lease = null ; if ( leaseMap != null ) { lease = leaseMap . get ( id ) ; } if ( lease != null && ( ! isLeaseExpirationEnabled ( ) || ! lease . isExpired ( ) ) ) { return decorateInstanceInfo ( lease ) ; } else if ( includeRemoteRegions ) { for ( RemoteRegionRegistry remoteRegistry : this . regionNameVSRemoteRegistry . values ( ) ) { Application application = remoteRegistry . getApplication ( appName ) ; if ( application != null ) { return application . getByInstanceId ( id ) ; } } } return null ; }
Gets the {@link InstanceInfo} information.

@param appName the application name for which the information is requested.
@param id the unique identifier of the instance.
@param includeRemoteRegions true, if we need to include applications from remote regions
as indicated by the region {@link URL} by this property
{@link EurekaServerConfig#getRemoteRegionUrls()}, false otherwise
@return the information about the instance.