public class TcpipNetBIOSHostAnnouncer extends HostAnnouncer
TCP/IP NetBIOS host announcer implementation. Periodically broadcasts a host announcement datagram to inform other Windows networking hosts of the local hosts existence and capabilities.
Thread.State, Thread.UncaughtExceptionHandler
Modifier and Type | Field and Description |
---|---|
static int |
INTERVAL |
static int |
PORT |
SHUTDOWN_COUNT, SHUTDOWN_WAIT, STARTING_INTERVAL
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
Constructor and Description |
---|
TcpipNetBIOSHostAnnouncer()
Default constructor.
|
TcpipNetBIOSHostAnnouncer(String name,
String domain,
int intval,
int port)
Create a host announcer.
|
Modifier and Type | Method and Description |
---|---|
InetAddress |
getBindAddress()
Get the local address that the announcer should bind to.
|
int |
getPort()
Return the socket/port number that the announcer is using.
|
boolean |
hasBindAddress()
Check if the announcer should bind to a particular local address, or all
local addresses.
|
protected void |
initialize()
Initialize the host announcer.
|
boolean |
isNetworkEnabled()
Determine if the network connection used for the host announcement is valid
|
protected void |
sendAnnouncement(String hostName,
byte[] buf,
int offset,
int len)
Send an announcement broadcast.
|
void |
setBindAddress(InetAddress addr)
Set the local address to bind to.
|
void |
setBroadcastAddress(String addr)
Set the broadcast address
|
void |
setBroadcastAddress(String addr,
int port)
Set the broadcast address and port
|
void |
setPort(int port)
Set the socket/port number to use.
|
addHostName, addHostNames, getComment, getDomain, getHostName, getInterval, getServerType, hasDebug, initHostAnnounceSMB, numberOfNames, run, setComment, setDebug, setDomain, setInterval, setServerType, shutdownAnnouncer, startAnnouncer
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
public static final int PORT
public static final int INTERVAL
public TcpipNetBIOSHostAnnouncer()
public final InetAddress getBindAddress()
public final int getPort()
public final boolean hasBindAddress()
public final void setBroadcastAddress(String addr) throws UnknownHostException
addr
- StringUnknownHostException
public final void setBroadcastAddress(String addr, int port) throws UnknownHostException
addr
- Stringport
- intUnknownHostException
protected void initialize() throws Exception
initialize
in class HostAnnouncer
Exception
public boolean isNetworkEnabled()
isNetworkEnabled
in class HostAnnouncer
protected void sendAnnouncement(String hostName, byte[] buf, int offset, int len) throws Exception
sendAnnouncement
in class HostAnnouncer
hostName
- Host name being announcedbuf
- Buffer containing the host announcement mailslot message.offset
- Offset to the start of the host announcement message.len
- Host announcement message length.Exception
public final void setBindAddress(InetAddress addr)
addr
- java.net.InetAddresspublic final void setPort(int port)
port
- intCopyright © 2005–2017 Alfresco Software. All rights reserved.