public abstract class HostAnnouncer
extends java.lang.Thread
The host announcer class 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 |
SHUTDOWN_COUNT |
static int |
SHUTDOWN_WAIT |
static long |
STARTING_INTERVAL |
| Constructor and Description |
|---|
HostAnnouncer()
HostAnnouncer constructor.
|
HostAnnouncer(java.lang.String name,
java.lang.String domain,
int intval)
Create a host announcer.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addHostName(java.lang.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
|
java.lang.String |
getComment()
Return the server comment string.
|
java.lang.String |
getDomain()
Return the domain name that the host announcement is directed to.
|
java.lang.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(java.lang.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(java.lang.String hostName,
byte[] buf,
int offset,
int len)
Send an announcement broadcast.
|
void |
setComment(java.lang.String comment)
Set the server comment string.
|
void |
setDebug(boolean dbg)
Enable/disable debug output
|
void |
setDomain(java.lang.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, yieldpublic static final int SHUTDOWN_WAIT
public static final int SHUTDOWN_COUNT
public static final long STARTING_INTERVAL
public HostAnnouncer()
public HostAnnouncer(java.lang.String name,
java.lang.String domain,
int intval)
name - Host name to announcedomain - Domain name to announce tointval - Announcement interval, in minutespublic final java.lang.String getComment()
public final java.lang.String getDomain()
public final int numberOfNames()
public final java.lang.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(java.lang.String name)
name - Stringpublic final void startAnnouncer()
public void run()
run in interface java.lang.Runnablerun in class java.lang.Threadprotected abstract void initialize()
throws java.lang.Exception
java.lang.Exceptionpublic abstract boolean isNetworkEnabled()
protected abstract void sendAnnouncement(java.lang.String hostName,
byte[] buf,
int offset,
int len)
throws java.lang.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.java.lang.Exceptionpublic final void setComment(java.lang.String comment)
comment - java.lang.Stringpublic final void setDomain(java.lang.String name)
name - java.lang.Stringpublic final void addHostName(java.lang.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 - 2010 Alfresco Software, Inc. All Rights Reserved.