org.livetribe.slp.api.ua
Class StandardUserAgent

java.lang.Object
  extended by org.livetribe.slp.api.StandardAgent
      extended by org.livetribe.slp.api.ua.StandardUserAgent
All Implemented Interfaces:
Agent, UserAgent

public class StandardUserAgent
extends StandardAgent
implements UserAgent

Version:
$Rev: 200 $ $Date: 2006-08-09 14:17:10 +0200 (Wed, 09 Aug 2006) $

Field Summary
 
Fields inherited from class org.livetribe.slp.api.StandardAgent
logger
 
Constructor Summary
StandardUserAgent()
           
 
Method Summary
 void addMessageRegistrationListener(MessageRegistrationListener listener)
           
protected  void configureUserAgentManager(UserAgentManager uaManager)
           
protected  edu.emory.mathcs.backport.java.util.concurrent.ScheduledExecutorService createScheduledExecutorService()
          Creates and returns the default ScheduledExecutorService, configured to use one daemon thread.
protected  UserAgentManager createUserAgentManager()
           
protected  List discoverDirectoryAgents(Scopes scopes, String filter)
           
protected  void doStart()
           
protected  void doStop()
           
 List findDirectoryAgents(Scopes scopes, String filter)
           
 List findServiceAgents(Scopes scopes, String filter)
           
 List findServices(ServiceType serviceType, Scopes scopes, String filter, String language)
          Returns a list of ServiceInfo that are available on the network, and that match the given arguments.
protected  List getCachedDirectoryAgents(Scopes scopes, String filter)
           
 int getDiscoveryInitialWaitBound()
           
 long getDiscoveryPeriod()
          Returns the period, in seconds, between discovery of DirectoryAgents
protected  void handleMulticastDAAdvert(DAAdvert message, InetSocketAddress address)
           
protected  void handleMulticastSrvDeReg(SrvDeReg message)
           
protected  void handleMulticastSrvReg(SrvReg message)
           
 boolean isPeriodicDiscoveryEnabled()
          Returns whether this UserAgent should periodically discover DirectoryAgents
 void removeMessageRegistrationListener(MessageRegistrationListener listener)
           
 void setDiscoveryInitialWaitBound(int discoveryInitialWaitBound)
          Sets the bound (in seconds) to the initial random delay this UserAgent waits before attempting to discover DirectoryAgents
 void setDiscoveryPeriod(long discoveryPeriod)
          Sets the period, in seconds, between discovery of DirectoryAgents
 void setPeriodicDiscoveryEnabled(boolean periodicDiscoveryEnabled)
          Sets whether this UserAgent should periodically discover DirectoryAgents
 void setScheduledExecutorService(edu.emory.mathcs.backport.java.util.concurrent.ScheduledExecutorService scheduledExecutorService)
          Sets the ScheduledExecutorService used to perform periodic tasks such as discovery of DirectoryAgents.
 void setUserAgentManager(UserAgentManager manager)
           
 
Methods inherited from class org.livetribe.slp.api.StandardAgent
getPort, getScopes, isRunning, setPort, setScopes, start, stop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.livetribe.slp.api.Agent
isRunning, setScopes, start, stop
 

Constructor Detail

StandardUserAgent

public StandardUserAgent()
Method Detail

setUserAgentManager

public void setUserAgentManager(UserAgentManager manager)
Specified by:
setUserAgentManager in interface UserAgent

setScheduledExecutorService

public void setScheduledExecutorService(edu.emory.mathcs.backport.java.util.concurrent.ScheduledExecutorService scheduledExecutorService)
Sets the ScheduledExecutorService used to perform periodic tasks such as discovery of DirectoryAgents.

See Also:
createScheduledExecutorService()

isPeriodicDiscoveryEnabled

public boolean isPeriodicDiscoveryEnabled()
Returns whether this UserAgent should periodically discover DirectoryAgents

See Also:
setPeriodicDiscoveryEnabled(boolean), getDiscoveryPeriod()

setPeriodicDiscoveryEnabled

public void setPeriodicDiscoveryEnabled(boolean periodicDiscoveryEnabled)
Sets whether this UserAgent should periodically discover DirectoryAgents

See Also:
isPeriodicDiscoveryEnabled(), getDiscoveryPeriod()

getDiscoveryPeriod

public long getDiscoveryPeriod()
Returns the period, in seconds, between discovery of DirectoryAgents

See Also:
setDiscoveryPeriod(long), isPeriodicDiscoveryEnabled()

setDiscoveryPeriod

public void setDiscoveryPeriod(long discoveryPeriod)
Sets the period, in seconds, between discovery of DirectoryAgents

See Also:
getDiscoveryPeriod(), isPeriodicDiscoveryEnabled()

getDiscoveryInitialWaitBound

public int getDiscoveryInitialWaitBound()

setDiscoveryInitialWaitBound

public void setDiscoveryInitialWaitBound(int discoveryInitialWaitBound)
Sets the bound (in seconds) to the initial random delay this UserAgent waits before attempting to discover DirectoryAgents


doStart

protected void doStart()
                throws IOException
Specified by:
doStart in class StandardAgent
Throws:
IOException

createUserAgentManager

protected UserAgentManager createUserAgentManager()

configureUserAgentManager

protected void configureUserAgentManager(UserAgentManager uaManager)

createScheduledExecutorService

protected edu.emory.mathcs.backport.java.util.concurrent.ScheduledExecutorService createScheduledExecutorService()
Creates and returns the default ScheduledExecutorService, configured to use one daemon thread.


doStop

protected void doStop()
               throws IOException
Specified by:
doStop in class StandardAgent
Throws:
IOException

addMessageRegistrationListener

public void addMessageRegistrationListener(MessageRegistrationListener listener)
Specified by:
addMessageRegistrationListener in interface UserAgent

removeMessageRegistrationListener

public void removeMessageRegistrationListener(MessageRegistrationListener listener)
Specified by:
removeMessageRegistrationListener in interface UserAgent

findServices

public List findServices(ServiceType serviceType,
                         Scopes scopes,
                         String filter,
                         String language)
                  throws IOException,
                         ServiceLocationException
Returns a list of ServiceInfo that are available on the network, and that match the given arguments.

Specified by:
findServices in interface UserAgent
Parameters:
serviceType - The ServiceType of the services to find
scopes - The scopes of the services to find
filter - An LDAPv3 filter expression for the attributes of the services to find
language - The language of the services to find
Throws:
IOException
ServiceLocationException

findDirectoryAgents

public List findDirectoryAgents(Scopes scopes,
                                String filter)
                         throws IOException,
                                ServiceLocationException
Throws:
IOException
ServiceLocationException

getCachedDirectoryAgents

protected List getCachedDirectoryAgents(Scopes scopes,
                                        String filter)

discoverDirectoryAgents

protected List discoverDirectoryAgents(Scopes scopes,
                                       String filter)
                                throws IOException
Throws:
IOException

findServiceAgents

public List findServiceAgents(Scopes scopes,
                              String filter)
                       throws IOException,
                              ServiceLocationException
Throws:
IOException
ServiceLocationException

handleMulticastDAAdvert

protected void handleMulticastDAAdvert(DAAdvert message,
                                       InetSocketAddress address)

handleMulticastSrvReg

protected void handleMulticastSrvReg(SrvReg message)

handleMulticastSrvDeReg

protected void handleMulticastSrvDeReg(SrvDeReg message)


Copyright © 2006-2012 LiveTribe. All Rights Reserved.