/** * Determines the address of a host given it's host name. The name can be a NetBIOS name like * "freto" or an IP address like "192.168.1.15". It cannot be a DNS name; * the analygous {@link jcifs.UniAddress} or {@link java.net.InetAddress} * <code>getByName</code> methods can be used for that. * * @param host hostname to resolve * @throws java.net.UnknownHostException if there is an error resolving the name */ public static NbtAddress getByName( String host ) throws UnknownHostException { return getByName( host, 0x00, null ); }
/** * Determines the address of a host given it's host name. The name can be a NetBIOS name like * "freto" or an IP address like "192.168.1.15". It cannot be a DNS name; * the analygous {@link jcifs.UniAddress} or {@link java.net.InetAddress} * <code>getByName</code> methods can be used for that. * * @param host hostname to resolve * @throws java.net.UnknownHostException if there is an error resolving the name */ public static NbtAddress getByName( String host ) throws UnknownHostException { return getByName( host, 0x00, null ); }
/** * Determines the address of a host given it's host name. The name can be a NetBIOS name like * "freto" or an IP address like "192.168.1.15". It cannot be a DNS name; * the analygous {@link jcifs.UniAddress} or {@link java.net.InetAddress} * <code>getByName</code> methods can be used for that. * * @param host hostname to resolve * @throws java.net.UnknownHostException if there is an error resolving the name */ public static NbtAddress getByName( String host ) throws UnknownHostException { return getByName( host, 0x00, null ); }
/** * Determines the address of a host given it's host name. The name can be a NetBIOS name like * "freto" or an IP address like "192.168.1.15". It cannot be a DNS name; * the analygous {@link jcifs.UniAddress} or {@link java.net.InetAddress} * <code>getByName</code> methods can be used for that. * * @param host hostname to resolve * @throws java.net.UnknownHostException if there is an error resolving the name */ public static NbtAddress getByName( String host ) throws UnknownHostException { return getByName( host, 0x00, null ); }
/** * Determines the address of a host given it's host name. NetBIOS * names also have a <code>type</code>. Types(aka Hex Codes) * are used to distiquish the various services on a host. <a * href="../../../nbtcodes.html">Here</a> is * a fairly complete list of NetBIOS hex codes. Scope is not used but is * still functional in other NetBIOS products and so for completeness it has been * implemented. A <code>scope</code> of <code>null</code> or <code>""</code> * signifies no scope. * * @param host the name to resolve * @param type the hex code of the name * @param scope the scope of the name * @throws java.net.UnknownHostException if there is an error resolving the name */ public static NbtAddress getByName( String host, int type, String scope ) throws UnknownHostException { return getByName( host, type, scope, null ); }
/** * Determines the address of a host given it's host name. NetBIOS * names also have a <code>type</code>. Types(aka Hex Codes) * are used to distiquish the various services on a host. <a * href="../../../nbtcodes.html">Here</a> is * a fairly complete list of NetBIOS hex codes. Scope is not used but is * still functional in other NetBIOS products and so for completeness it has been * implemented. A <code>scope</code> of <code>null</code> or <code>""</code> * signifies no scope. * * @param host the name to resolve * @param type the hex code of the name * @param scope the scope of the name * @throws java.net.UnknownHostException if there is an error resolving the name */ public static NbtAddress getByName( String host, int type, String scope ) throws UnknownHostException { return getByName( host, type, scope, null ); }
/** * Determines the address of a host given it's host name. NetBIOS * names also have a <code>type</code>. Types(aka Hex Codes) * are used to distiquish the various services on a host. <a * href="../../../nbtcodes.html">Here</a> is * a fairly complete list of NetBIOS hex codes. Scope is not used but is * still functional in other NetBIOS products and so for completeness it has been * implemented. A <code>scope</code> of <code>null</code> or <code>""</code> * signifies no scope. * * @param host the name to resolve * @param type the hex code of the name * @param scope the scope of the name * @throws java.net.UnknownHostException if there is an error resolving the name */ public static NbtAddress getByName( String host, int type, String scope ) throws UnknownHostException { return getByName( host, type, scope, null ); }
public void run() { try { ans = NbtAddress.getByName( host, type, scope, svr ); } catch( UnknownHostException uhe ) { this.uhe = uhe; } catch( Exception ex ) { this.uhe = new UnknownHostException( ex.getMessage() ); } finally { synchronized( sem ) { sem.count--; sem.notify(); } } } }
public void run() { try { ans = NbtAddress.getByName( host, type, scope, svr ); } catch( UnknownHostException uhe ) { this.uhe = uhe; } catch( Exception ex ) { this.uhe = new UnknownHostException( ex.getMessage() ); } finally { synchronized( sem ) { sem.count--; sem.notify(); } } } }
public void run() { try { ans = NbtAddress.getByName( host, type, scope, svr ); } catch( UnknownHostException uhe ) { this.uhe = uhe; } catch( Exception ex ) { this.uhe = new UnknownHostException( ex.getMessage() ); } finally { synchronized( sem ) { sem.count--; sem.notify(); } } } }
public void run() { try { ans = NbtAddress.getByName( host, type, scope, svr ); } catch( UnknownHostException uhe ) { this.uhe = uhe; } catch( Exception ex ) { this.uhe = new UnknownHostException( ex.getMessage() ); } finally { synchronized( sem ) { sem.count--; sem.notify(); } } } }
/** * Retrieve all addresses of a host by it's address. NetBIOS hosts can * have many names for a given IP address. The name and IP address make the * NetBIOS address. This provides a way to retrieve the other names for a * host with the same IP address. * * @param host hostname to lookup all addresses for * @throws java.net.UnknownHostException if there is an error resolving the name */ public static NbtAddress[] getAllByAddress( String host ) throws UnknownHostException { return getAllByAddress( getByName( host, 0x00, null )); }
/** * Retrieve all addresses of a host by it's address. NetBIOS hosts can * have many names for a given IP address. The name and IP address make the * NetBIOS address. This provides a way to retrieve the other names for a * host with the same IP address. * * @param host hostname to lookup all addresses for * @throws java.net.UnknownHostException if there is an error resolving the name */ public static NbtAddress[] getAllByAddress( String host ) throws UnknownHostException { return getAllByAddress( getByName( host, 0x00, null )); }
/** {@inheritDoc} */ @Override public void connect(InetAddress address, int port, int timeout) throws IOException, Exception { m_address = InetAddressUtils.str(address); m_nbtAddress = NbtAddress.getByName(m_address); }
/** * Retrieve all addresses of a host by it's address. NetBIOS hosts can * have many names for a given IP address. The name and IP address make the * NetBIOS address. This provides a way to retrieve the other names for a * host with the same IP address. * * @param host hostname to lookup all addresses for * @throws java.net.UnknownHostException if there is an error resolving the name */ public static NbtAddress[] getAllByAddress( String host ) throws UnknownHostException { return getAllByAddress( getByName( host, 0x00, null )); }
/** * Retrieve all addresses of a host by it's address. NetBIOS hosts can * have many names for a given IP address. The name and IP address make the * NetBIOS address. This provides a way to retrieve the other names for a * host with the same IP address. * * @param host hostname to lookup all addresses for * @throws java.net.UnknownHostException if there is an error resolving the name */ public static NbtAddress[] getAllByAddress( String host ) throws UnknownHostException { return getAllByAddress( getByName( host, 0x00, null )); }
/** * Retrieve all addresses of a host by it's address. NetBIOS hosts can * have many names for a given IP address. The name and IP address make * the NetBIOS address. This provides a way to retrieve the other names * for a host with the same IP address. See {@link #getByName} * for a description of <code>type</code> * and <code>scope</code>. * * @param host hostname to lookup all addresses for * @param type the hexcode of the name * @param scope the scope of the name * @throws java.net.UnknownHostException if there is an error resolving the name */ public static NbtAddress[] getAllByAddress( String host, int type, String scope ) throws UnknownHostException { return getAllByAddress( getByName( host, type, scope )); }
/** * Retrieve all addresses of a host by it's address. NetBIOS hosts can * have many names for a given IP address. The name and IP address make * the NetBIOS address. This provides a way to retrieve the other names * for a host with the same IP address. See {@link #getByName} * for a description of <code>type</code> * and <code>scope</code>. * * @param host hostname to lookup all addresses for * @param type the hexcode of the name * @param scope the scope of the name * @throws java.net.UnknownHostException if there is an error resolving the name */ public static NbtAddress[] getAllByAddress( String host, int type, String scope ) throws UnknownHostException { return getAllByAddress( getByName( host, type, scope )); }
/** * Retrieve all addresses of a host by it's address. NetBIOS hosts can * have many names for a given IP address. The name and IP address make * the NetBIOS address. This provides a way to retrieve the other names * for a host with the same IP address. See {@link #getByName} * for a description of <code>type</code> * and <code>scope</code>. * * @param host hostname to lookup all addresses for * @param type the hexcode of the name * @param scope the scope of the name * @throws java.net.UnknownHostException if there is an error resolving the name */ public static NbtAddress[] getAllByAddress( String host, int type, String scope ) throws UnknownHostException { return getAllByAddress( getByName( host, type, scope )); }
@SneakyThrows private UniAddress getUniAddress() { if (this.loadBalance) { if (StringUtils.isNotBlank(this.includePattern)) { val dcs = NbtAddress.getAllByName(this.domainController, NBT_ADDRESS_TYPE, null, null); return Arrays.stream(dcs) .filter(dc2 -> dc2.getHostAddress().matches(this.includePattern)) .findFirst() .map(UniAddress::new) .orElse(null); } return new UniAddress(NbtAddress.getByName(this.domainController, NBT_ADDRESS_TYPE, null)); } return UniAddress.getByName(this.domainController, true); }