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.
Modifier and Type | Field and Description |
---|---|
static int |
INTERVAL |
static int |
PORT |
SHUTDOWN_COUNT, SHUTDOWN_WAIT, STARTING_INTERVAL
Constructor and Description |
---|
TcpipNetBIOSHostAnnouncer()
Default constructor.
|
TcpipNetBIOSHostAnnouncer(java.lang.String name,
java.lang.String domain,
int intval,
int port)
Create a host announcer.
|
Modifier and Type | Method and Description |
---|---|
java.net.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(java.lang.String hostName,
byte[] buf,
int offset,
int len)
Send an announcement broadcast.
|
void |
setBindAddress(java.net.InetAddress addr)
Set the local address to bind to.
|
void |
setBroadcastAddress(java.lang.String addr)
Set the broadcast address
|
void |
setBroadcastAddress(java.lang.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 TcpipNetBIOSHostAnnouncer(java.lang.String name, java.lang.String domain, int intval, int port)
name
- Host name to announcedomain
- Domain name to announce tointval
- Announcement interval, in minutesport
- Port to usepublic final java.net.InetAddress getBindAddress()
public final int getPort()
public final boolean hasBindAddress()
public final void setBroadcastAddress(java.lang.String addr) throws java.net.UnknownHostException
addr
- Stringjava.net.UnknownHostException
public final void setBroadcastAddress(java.lang.String addr, int port) throws java.net.UnknownHostException
addr
- Stringport
- intjava.net.UnknownHostException
protected void initialize() throws java.lang.Exception
initialize
in class HostAnnouncer
java.lang.Exception
public boolean isNetworkEnabled()
isNetworkEnabled
in class HostAnnouncer
protected void sendAnnouncement(java.lang.String hostName, byte[] buf, int offset, int len) throws java.lang.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.java.lang.Exception
public final void setBindAddress(java.net.InetAddress addr)
addr
- java.net.InetAddresspublic final void setPort(int port)
port
- intCopyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.