public abstract class HostAnnouncer extends Thread
The host announcer class 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 |
SHUTDOWN_COUNT |
static int |
SHUTDOWN_WAIT |
static long |
STARTING_INTERVAL |
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
Constructor and Description |
---|
HostAnnouncer()
HostAnnouncer constructor.
|
HostAnnouncer(String name,
String domain,
int intval)
Create a host announcer.
|
Modifier and Type | Method and Description |
---|---|
void |
addHostName(String name)
Add a host name to the list of names to announce
|
void |
addHostNames(StringList names)
Add a list of names to the announcement list
|
String |
getComment()
Return the server comment string.
|
String |
getDomain()
Return the domain name that the host announcement is directed to.
|
String |
getHostName(int idx)
Return the specified host name being announced.
|
int |
getInterval()
Return the announcement interval, in minutes.
|
int |
getServerType()
Return the server type flags.
|
boolean |
hasDebug()
Determine if debug output is enabled
|
protected void |
initHostAnnounceSMB(String name)
Initialize the host announcement SMB.
|
protected abstract void |
initialize()
Initialize the host announcer.
|
abstract boolean |
isNetworkEnabled()
Determine if the network connection used for the host announcement is valid
|
int |
numberOfNames()
Return the number of names being announced
|
void |
run()
Start the host announcer thread.
|
protected abstract void |
sendAnnouncement(String hostName,
byte[] buf,
int offset,
int len)
Send an announcement broadcast.
|
void |
setComment(String comment)
Set the server comment string.
|
void |
setDebug(boolean dbg)
Enable/disable debug output
|
void |
setDomain(String name)
Set the domain name that the host announcement are directed to.
|
void |
setInterval(int intval)
Set the announcement interval, in minutes.
|
void |
setServerType(int typ)
Set the server type flags.
|
void |
shutdownAnnouncer()
Shutdown the host announcer and remove the announced name from Network Neighborhood.
|
void |
startAnnouncer()
Start the host announcer
|
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 SHUTDOWN_WAIT
public static final int SHUTDOWN_COUNT
public static final long STARTING_INTERVAL
public final String getComment()
public final String getDomain()
public final int numberOfNames()
public final String getHostName(int idx)
idx
- intpublic final int getInterval()
public final int getServerType()
public final boolean hasDebug()
public final void setDebug(boolean dbg)
dbg
- true or falseprotected final void initHostAnnounceSMB(String name)
name
- Stringpublic final void startAnnouncer()
public void run()
protected abstract void initialize() throws Exception
Exception
public abstract boolean isNetworkEnabled()
protected abstract void sendAnnouncement(String hostName, byte[] buf, int offset, int len) throws Exception
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 setComment(String comment)
comment
- java.lang.Stringpublic final void setDomain(String name)
name
- java.lang.Stringpublic final void addHostName(String name)
name
- java.lang.Stringpublic final void addHostNames(StringList names)
names
- StringListpublic final void setInterval(int intval)
intval
- intpublic final void setServerType(int typ)
typ
- intpublic final void shutdownAnnouncer()
Copyright © 2005–2017 Alfresco Software. All rights reserved.