public class SSDPDiscoveryService extends ScheduledThreadPoolExecutor
ScheduledThreadPoolExecutor
implementation.
Name | Mode | Type | isHidden | isBound | isConstrained |
---|---|---|---|---|---|
activeCount | R | int | false | false | false |
bootId | R | int | false | false | false |
completedTaskCount | R | long | false | false | false |
continueExistingPeriodicTasksAfterShutdownPolicy | RW | boolean | false | false | false |
corePoolSize | RW | int | false | false | false |
executeExistingDelayedTasksAfterShutdownPolicy | RW | boolean | false | false | false |
largestPoolSize | R | int | false | false | false |
maximumPoolSize | RW | int | false | false | false |
nextBootId | R | int | false | false | false |
poolSize | R | int | false | false | false |
queue | R | BlockingQueue < Runnable > | false | false | false |
rejectedExecutionHandler | RW | RejectedExecutionHandler | false | false | false |
removeOnCancelPolicy | RW | boolean | false | false | false |
searchPort | R | int | false | false | false |
shutdown | R | boolean | false | false | false |
taskCount | R | long | false | false | false |
terminated | R | boolean | false | false | false |
terminating | R | boolean | false | false | false |
threadFactory | RW | ThreadFactory | false | false | false |
userAgent | R | String | false | false | false |
Modifier and Type | Class and Description |
---|---|
static interface |
SSDPDiscoveryService.Listener
SSDPDiscoveryService listener interface definition. |
static class |
SSDPDiscoveryService.RequestHandler
SSDPDiscoveryService SSDPRequest handler. |
static class |
SSDPDiscoveryService.ResponseHandler
SSDPDiscoveryService SSDPResponse handler. |
ThreadPoolExecutor.AbortPolicy, ThreadPoolExecutor.CallerRunsPolicy, ThreadPoolExecutor.DiscardOldestPolicy, ThreadPoolExecutor.DiscardPolicy
Constructor and Description |
---|
SSDPDiscoveryService(String product)
Sole constructor.
|
Modifier and Type | Method and Description |
---|---|
SSDPDiscoveryService |
addListener(SSDPDiscoveryService.Listener listener)
Method to add a
SSDPDiscoveryService.Listener . |
SSDPDiscoveryService |
advertise(RootDevice device,
int rate)
Method to add a
RootDevice to advertise. |
int |
getBootId()
BOOTID.UPNP.ORG |
int |
getNextBootId()
NEXTBOOTID.UPNP.ORG |
int |
getSearchPort()
SEARCHPORT.UPNP.ORG |
String |
getUserAgent()
SERVER and USER-AGENT |
void |
msearch(int mx,
URI st)
Send multicast
M-SEARCH messsage. |
void |
multicast(long delay,
SSDPMessage message)
Method to queue an
SSDPMessage for multicast with delay. |
void |
multicast(SSDPMessage message)
Method to queue an
SSDPMessage for multicast without delay. |
SSDPDiscoveryService |
removeListener(SSDPDiscoveryService.Listener listener)
Method to remove a
SSDPDiscoveryService.Listener . |
void |
send(int mx,
SocketAddress address,
List<? extends SSDPMessage> messages)
|
void |
send(long delay,
SocketAddress address,
SSDPMessage message)
Method to queue an
SSDPMessage for sending with delay. |
void |
send(SocketAddress address,
SSDPMessage message)
Method to queue an
SSDPMessage for sending without delay. |
void |
shutdown() |
decorateTask, decorateTask, execute, getContinueExistingPeriodicTasksAfterShutdownPolicy, getExecuteExistingDelayedTasksAfterShutdownPolicy, getQueue, getRemoveOnCancelPolicy, schedule, schedule, scheduleAtFixedRate, scheduleWithFixedDelay, setContinueExistingPeriodicTasksAfterShutdownPolicy, setExecuteExistingDelayedTasksAfterShutdownPolicy, setRemoveOnCancelPolicy, shutdownNow, submit, submit, submit
afterExecute, allowCoreThreadTimeOut, allowsCoreThreadTimeOut, awaitTermination, beforeExecute, finalize, getActiveCount, getCompletedTaskCount, getCorePoolSize, getKeepAliveTime, getLargestPoolSize, getMaximumPoolSize, getPoolSize, getRejectedExecutionHandler, getTaskCount, getThreadFactory, isShutdown, isTerminated, isTerminating, prestartAllCoreThreads, prestartCoreThread, purge, remove, setCorePoolSize, setKeepAliveTime, setMaximumPoolSize, setRejectedExecutionHandler, setThreadFactory, terminated, toString
invokeAll, invokeAll, invokeAny, invokeAny, newTaskFor, newTaskFor
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
awaitTermination, invokeAll, invokeAll, invokeAny, invokeAny, isShutdown, isTerminated
public SSDPDiscoveryService(String product) throws IOException
product
- The product/version
String
identifying this UPnP application.IOException
- If the underlying MulticastSocket
cannot be conditioned.public String getUserAgent()
SERVER
and USER-AGENT
SERVER
and USER-AGENT
public int getBootId()
BOOTID.UPNP.ORG
bootId
public int getNextBootId()
NEXTBOOTID.UPNP.ORG
nextBootId
public int getSearchPort()
SEARCHPORT.UPNP.ORG
public SSDPDiscoveryService addListener(SSDPDiscoveryService.Listener listener)
SSDPDiscoveryService.Listener
.listener
- The SSDPDiscoveryService.Listener
.this
public SSDPDiscoveryService removeListener(SSDPDiscoveryService.Listener listener)
SSDPDiscoveryService.Listener
.listener
- The SSDPDiscoveryService.Listener
.this
public SSDPDiscoveryService advertise(RootDevice device, int rate)
RootDevice
to advertise.device
- The RootDevice
to advertise.rate
- The rate (in seconds) to repeat
advertisements.this
public void msearch(int mx, URI st)
M-SEARCH
messsage.mx
- The MX
header value.st
- The ST
header value.public void multicast(SSDPMessage message)
SSDPMessage
for multicast without delay.message
- The SSDPMessage
to send.public void multicast(long delay, SSDPMessage message)
SSDPMessage
for multicast with delay.delay
- Time to delay (in milliseconds) before
sending.message
- The SSDPMessage
to send.public void send(SocketAddress address, SSDPMessage message)
SSDPMessage
for sending without delay.address
- The destination SocketAddress
.message
- The SSDPMessage
to send.public void send(long delay, SocketAddress address, SSDPMessage message)
SSDPMessage
for sending with delay.delay
- Time to delay (in milliseconds) before
sending.address
- The destination SocketAddress
.message
- The SSDPMessage
to send.public void send(int mx, SocketAddress address, List<? extends SSDPMessage> messages)
List
of SSDPMessage
s for sending
with a MX
parameter. Messages are sent in list order with
random delays none greater that MX
seconds.mx
- Maximum delay (in seconds) before sending.address
- The destination SocketAddress
.messages
- The List
of SSDPMessage
s to
send.public void shutdown()
shutdown
in interface ExecutorService
shutdown
in class ScheduledThreadPoolExecutor
Copyright © 2015–2021. All rights reserved.