- All Known Implementing Classes:
NameServiceClientImpl
public interface NameServiceClient
This is an internal API for resolving names
- Author:
- mbechler
-
Method Summary
Modifier and TypeMethodDescriptionAddress[]getAllByName(String hostname, boolean possibleNTDomainOrWorkgroup) Lookup addresses for the givenhostname.Determines the address of a host given it's host name.Lookuphostnameand return it'sUniAddress.Gets the local host NetBIOS address.Gets the local host NetBIOS name.getNbtAllByAddress(String host) Retrieve all addresses of a host by it's address.getNbtAllByAddress(String host, int type, String scope) Retrieve all addresses of a host by it's address.Retrieve all addresses of a host by it's address.getNbtAllByName(String host, int type, String scope, InetAddress svr) Retrieve all addresses of a host by it's name.getNbtByName(String host) Determines the address of a host given it's host name.getNbtByName(String host, int type, String scope) Determines the address of a host given it's host name.getNbtByName(String host, int type, String scope, InetAddress svr) Determines the address of a host given it's host name.getNodeStatus(NetbiosAddress nbtAddress) Retrieves the node status information for the specified NetBIOS address.Gets the unknown NetBIOS name instance.
-
Method Details
-
getLocalHost
NetbiosAddress getLocalHost()Gets the local host NetBIOS address.- Returns:
- local host address
-
getLocalName
NetbiosName getLocalName()Gets the local host NetBIOS name.- Returns:
- the local host name
-
getUnknownName
NetbiosName getUnknownName()Gets the unknown NetBIOS name instance.- Returns:
- the unknown name
-
getNbtAllByAddress
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.- Parameters:
addr- the address to query- Returns:
- resolved addresses
- Throws:
UnknownHostException- if address cannot be resolved
-
getNbtAllByAddress
NetbiosAddress[] getNbtAllByAddress(String host, int type, String scope) throws UnknownHostException 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. SeegetByName(java.lang.String, boolean)for a description oftypeandscope.- Parameters:
host- hostname to lookup all addresses fortype- the hexcode of the namescope- the scope of the name- Returns:
- resolved addresses
- Throws:
UnknownHostException- if there is an error resolving the name
-
getNbtAllByAddress
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.- Parameters:
host- hostname to lookup all addresses for- Returns:
- resolved addresses
- Throws:
UnknownHostException- if there is an error resolving the name
-
getNbtAllByName
NetbiosAddress[] getNbtAllByName(String host, int type, String scope, InetAddress svr) throws UnknownHostException Retrieve all addresses of a host by it's name.- Parameters:
host- hostname to lookup all addresses fortype- the hexcode of the namescope- the scope of the namesvr- server to query- Returns:
- the resolved addresses
- Throws:
UnknownHostException- if the host cannot be resolved
-
getNbtByName
NetbiosAddress getNbtByName(String host, int type, String scope, InetAddress svr) throws UnknownHostException Determines the address of a host given it's host name. NetBIOS names also have atype. Types(aka Hex Codes) are used to distinguish the various services on a host. Here 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. Ascopeofnullor""signifies no scope. The additionalsvrparameter specifies the address to query. This might be the address of a specific host, a name server, or a broadcast address.- Parameters:
host- the name to resolvetype- the hex code of the namescope- the scope of the namesvr- server to query- Returns:
- the resolved address
- Throws:
UnknownHostException- if there is an error resolving the name
-
getNbtByName
Determines the address of a host given it's host name. NetBIOS names also have atype. Types(aka Hex Codes) are used to distinguish the various services on a host. Here 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. Ascopeofnullor""signifies no scope.- Parameters:
host- the name to resolvetype- the hex code of the namescope- the scope of the name- Returns:
- the resolved address
- Throws:
UnknownHostException- if there is an error resolving the name
-
getNbtByName
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 analygousUniAddressorInetAddressgetByNamemethods can be used for that.- Parameters:
host- hostname to resolve- Returns:
- the resolved address
- Throws:
UnknownHostException- if there is an error resolving the name
-
getNodeStatus
Retrieves the node status information for the specified NetBIOS address.- Parameters:
nbtAddress- the NetBIOS address to query- Returns:
- the node status responses
- Throws:
UnknownHostException- if the node status cannot be retrieved
-
getAllByName
Address[] getAllByName(String hostname, boolean possibleNTDomainOrWorkgroup) throws UnknownHostException Lookup addresses for the givenhostname.- Parameters:
hostname- the hostname to resolvepossibleNTDomainOrWorkgroup- if true, perform additional master browser lookup- Returns:
- found addresses
- Throws:
UnknownHostException- if the hostname cannot be resolved
-
getByName
Lookuphostnameand return it'sUniAddress. If thepossibleNTDomainOrWorkgroupparameter istruean additional name query will be performed to locate a master browser.- Parameters:
hostname- the hostname to resolvepossibleNTDomainOrWorkgroup- if true, perform additional master browser lookup- Returns:
- the first resolved address
- Throws:
UnknownHostException- if the hostname cannot be resolved
-
getByName
Determines the address of a host given it's host name. The name can be a machine name like "jcifs.samba.org", or an IP address like "192.168.1.15".- Parameters:
hostname- NetBIOS or DNS hostname to resolve- Returns:
- the found address
- Throws:
UnknownHostException- if there is an error resolving the name
-