|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--jcifs.netbios.NbtAddress
This class represents a netbios over TCP/IP address.
Applications should use the methods getLocalHost
,
getByName
, getAllByName
,
getAllByAddress
to create a new NbtAddress instance. This
class is symmetric with InetAddress
. A netbios
host can(and does) have many names associated with it. See NbtNameServiceClient
for details.
InetAddress
Field Summary | |
static String |
ALL_HOSTS_NAME
This is a special name that means all hosts. |
static int |
B_NODE
Broadcast queries only. |
static int |
H_NODE
A Hybrid node tries to resolve a name using the nameserver first. |
static int |
M_NODE
Try Broadcast queries first, then try to resolve the name using the nameserver. |
static String |
MASTER_BROWSER_NAME
This is a special name for querying the master browser that serves the list of hosts found in "Network Neighborhood". |
static int |
P_NODE
A Point-to-Point node unicasts queries only. |
Method Summary | |
boolean |
equals(NbtAddress nbAddr)
Determines if this address is equal two another. |
byte[] |
getAddress()
Returns the raw IP address of this NbtAddress. |
static NbtAddress[] |
getAllByAddress(NbtAddress addr)
Retrieve all addresses of a host by it's address. |
static NbtAddress[] |
getAllByAddress(String host)
Retrieve all addresses of a host by it's address. |
static NbtAddress[] |
getAllByAddress(String host,
int type,
String scope)
Retrieve all addresses of a host by it's address. |
static NbtAddress[] |
getAllByName(String host)
Resloves the addresses of all hosts given a name(presumably a workgroup name). |
static NbtAddress[] |
getAllByName(String host,
int type,
String scope)
Resloves the addresses of all hosts given a hostname(presumably a workgroup name). |
static NbtAddress |
getByName(String host)
Determines the address of a host given it's host name. |
static NbtAddress |
getByName(String host,
int type,
String scope)
Determines the address of a host given it's host name. |
String |
getHostAddress()
Returns this IP adress as a String in the form "%d.%d.%d.%d". |
String |
getHostName()
The hostname of this address. |
InetAddress |
getInetAddress()
To convert this address to an InetAddress . |
static NbtAddress |
getLocalHost()
Retrieves the local host address. |
byte[] |
getMacAddress()
Retrieves the MAC address of the nodes network interface. |
int |
getNodeType()
Checks the node type of this address. |
int |
hashCode()
Returns a hashcode for this IP address. |
boolean |
isActive()
Determines if this address is active. |
boolean |
isBeingDeleted()
Determines if this address in the process of being deleted. |
boolean |
isGroupAddress()
Determines if the address is a group address. |
boolean |
isInConflict()
Determines if this address in conflict with another address. |
boolean |
isPermanent()
Determines if this address is set to be permanent. |
String |
toString()
Returns the String representaion of this address. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
notify,
notifyAll,
wait,
wait,
wait |
Field Detail |
public static final int B_NODE
public static final int P_NODE
public static final int M_NODE
public static final int H_NODE
public static final String MASTER_BROWSER_NAME
public static final String ALL_HOSTS_NAME
Method Detail |
public boolean isGroupAddress() throws UnknownNbtHostException
public int getNodeType() throws UnknownNbtHostException
B_NODE
, P_NODE
, M_NODE
, H_NODE
public boolean isBeingDeleted() throws UnknownNbtHostException
public boolean isInConflict() throws UnknownNbtHostException
public boolean isActive() throws UnknownNbtHostException
public boolean isPermanent() throws UnknownNbtHostException
public byte[] getMacAddress() throws UnknownNbtHostException
public String getHostName()
public byte[] getAddress()
public InetAddress getInetAddress() throws UnknownHostException
InetAddress
.InetAddress
representation of this address.public String getHostAddress()
String
in the form "%d.%d.%d.%d".public int hashCode()
public boolean equals(NbtAddress nbAddr)
hashCode()
method, the comparison
is based on the integer IP address and not the string representation.public String toString()
String
representaion of this address.public static NbtAddress getLocalHost() throws UnknownNbtHostException
InetAddress
should be availablepublic static NbtAddress getByName(String host) throws UnknownNbtHostException
host
- hostname to resolvepublic static NbtAddress getByName(String host, int type, String scope) throws UnknownNbtHostException
type
. Types(aka Hex Codes)
are used to distiquish 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. A scope
of null
or ""
signifies no scope.host
- the name to resolvetype
- the hex code of the namescope
- the scope of the namepublic static NbtAddress[] getAllByName(String host) throws UnknownNbtHostException
host
- groupname to lookuppublic static NbtAddress[] getAllByName(String host, int type, String scope) throws UnknownNbtHostException
getByName(java.lang.String)
for a description of type
and scope
.host
- group name to lookuptype
- the hexcode of the namepublic static NbtAddress[] getAllByAddress(String host) throws UnknownNbtHostException
host
- hostname to lookup all addresses forpublic static NbtAddress[] getAllByAddress(String host, int type, String scope) throws UnknownNbtHostException
getByName(java.lang.String)
for a description of type
and scope
.host
- hostname to lookup all addresses fortype
- the hexcode of the namescope
- the scope of the namepublic static NbtAddress[] getAllByAddress(NbtAddress addr) throws UnknownNbtHostException
addr
- the address to query
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |