jcifs.netbios
Class NbtConfig

java.lang.Object
  |
  +--jcifs.netbios.NbtConfig

public final class NbtConfig
extends Object

This class is a wrapper for setting all properties of the jcifs netbios client.

Since:
jcifs-0.1
Author:
Michael B. Allen

Method Summary
static void setBroadcastAddress(InetAddress bCastAddress)
          Sets the broadcast address the name service should use to resovle addresses.
static void setCachePolicy(int cachePolicy)
          Sets the address caching policy.
static void setLocalAddress(InetAddress laddr)
          Sets the local interface that the client should bind to.
static void setLocalHostName(String name, String scope)
          Set's the local hostname the client presents when connecting to hosts.
static void setNameServer(InetAddress nameserver)
          Sets the nameserver(Samba, WINS, ...) the client should use to resolve addresses.
static void setNodeType(int nodeType)
          Sets the clients node type.
static void setPort(int port)
          Sets the port the client should run on.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

setNameServer

public static void setNameServer(InetAddress nameserver)
Sets the nameserver(Samba, WINS, ...) the client should use to resolve addresses.
Parameters:
nameserver - the nameserver

setBroadcastAddress

public static void setBroadcastAddress(InetAddress bCastAddress)
Sets the broadcast address the name service should use to resovle addresses. If unspecified, the name service will guess the broadcast address by making the low byte 255.
Parameters:
bCastAddress - the broadcast address

setNodeType

public static void setNodeType(int nodeType)
Sets the clients node type. This controls it's behavior when doing queries.
Parameters:
nodeType - can be NbtAddress.B_NODE, NbtAddress.P_NODE, NbtAddress.M_NODE, NbtAddress.H_NODE

setCachePolicy

public static void setCachePolicy(int cachePolicy)
Sets the address caching policy.
Parameters:
cachePolicy - is the number of seconds before a name should expire, 0 for no caching, or -1 for forever

setLocalHostName

public static void setLocalHostName(String name,
                                    String scope)
Set's the local hostname the client presents when connecting to hosts.
Parameters:
name - the name the client should masquarade as
scope - 99.9% chance you don't need scope but if you do you will need to set this

setPort

public static void setPort(int port)
Sets the port the client should run on. This might be usefull for Windows 95 clients who only reply to name querys to port 137.
Parameters:
port - the port to run on

setLocalAddress

public static void setLocalAddress(InetAddress laddr)
Sets the local interface that the client should bind to.
Parameters:
laddr - the local address of the interface
See Also:
DatagramSocket