com.universaldevices.upnp
Class SSDPClient

java.lang.Object
  extended by java.lang.Thread
      extended by com.universaldevices.upnp.SSDPClient
All Implemented Interfaces:
java.lang.Runnable

public class SSDPClient
extends java.lang.Thread

The SSDPClient class handles UPnP events.

UPnP Events are the following broadcasted on the network such as: Notify - when a device/service is alive (is repeated) ByeBye - when a device/service is shutting down (best effort) Search - when a search request is being issued

Author:
UD Architect

Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
static java.lang.String srb
          Search request begin
static java.lang.String sre
          Search request end
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
SSDPClient()
          Constructor
 
Method Summary
 void interrupt()
           
 void registerSSDPListener(SSDPListener sl)
          Register a SSDPListener to handle SSDP events
 void run()
          Starts the SSDPClient thread
 boolean search(java.lang.String uuid)
          Performs a UD (proprietary) broadcast search which, in all cases, is much
more reliable and efficient than UPnP Search.
If UPnPSearch is desired, use UPnPSearch(String)
 void UPnPSearch(java.lang.String uuid)
          Starts a UPnP search
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

srb

public static java.lang.String srb
Search request begin


sre

public static java.lang.String sre
Search request end

Constructor Detail

SSDPClient

public SSDPClient()
Constructor

Method Detail

search

public boolean search(java.lang.String uuid)
Performs a UD (proprietary) broadcast search which, in all cases, is much
more reliable and efficient than UPnP Search.
If UPnPSearch is desired, use UPnPSearch(String)

Parameters:
uuid -
Returns:
- true if a UD device was found (the first one), false otherwise

UPnPSearch

public void UPnPSearch(java.lang.String uuid)
Starts a UPnP search

Parameters:
uuid - - the uuid of the device to search for

registerSSDPListener

public void registerSSDPListener(SSDPListener sl)
Register a SSDPListener to handle SSDP events

Parameters:
sl - - a SSDPListener to receive the events
See Also:
SSDPListener

run

public void run()
Starts the SSDPClient thread

Specified by:
run in interface java.lang.Runnable
Overrides:
run in class java.lang.Thread

interrupt

public void interrupt()
Overrides:
interrupt in class java.lang.Thread