org.robokind.api.speechrec.messaging
Class RemoteSpeechRecServiceClient<Conf>

java.lang.Object
  extended by org.robokind.api.common.playable.AbstractPlayable
      extended by org.robokind.api.messaging.services.DefaultServiceClient<Conf>
          extended by org.robokind.api.speechrec.messaging.RemoteSpeechRecServiceClient<Conf>
All Implemented Interfaces:
org.robokind.api.common.playable.Playable, org.robokind.api.messaging.services.RemoteServiceClient<Conf>, SpeechRecService

public class RemoteSpeechRecServiceClient<Conf>
extends org.robokind.api.messaging.services.DefaultServiceClient<Conf>
implements SpeechRecService

Connects to a remote SpeechRecService through Messaging components.

Author:
Jason G. Pallack

Field Summary
 
Fields inherited from class org.robokind.api.common.playable.AbstractPlayable
myElapsedPauseTime, myPauseTime, myPlayableListeners, myPlayState, myResumeTime, myStartTime, myStopTime
 
Fields inherited from interface org.robokind.api.speechrec.SpeechRecService
PROP_ID
 
Constructor Summary
RemoteSpeechRecServiceClient(Class<Conf> configClass, String speechRecServiceId, String remoteId, org.robokind.api.messaging.MessageSender<org.robokind.api.messaging.services.ServiceCommand> commandSender, org.robokind.api.messaging.MessageSender<Conf> configSender, org.robokind.api.messaging.MessageAsyncReceiver<org.robokind.api.messaging.services.ServiceError> errorReceiver, org.robokind.api.messaging.services.ServiceCommandFactory commandFactory, org.robokind.api.messaging.MessageAsyncReceiver<SpeechRecEventList> speechRecReceiver)
          Creates a new RemoteSpeechRecServiceClients.
 
Method Summary
 void addSpeechRecListener(org.jflux.api.core.Listener<SpeechRecEventList> listener)
          Adds a Listener to be notified when an image is received.
 String getSpeechRecServiceId()
          Returns the ImageService Id.
 boolean onComplete(long time)
           
 boolean onPause(long time)
           
 boolean onResume(long time)
           
 boolean onStart(long time)
           
 boolean onStop(long time)
           
 void removeSpeechRecListener(org.jflux.api.core.Listener<SpeechRecEventList> listener)
          Removes a Listener from being notified when an image is received.
 void setSpeechRecReceiver(org.robokind.api.messaging.MessageAsyncReceiver<SpeechRecEventList> receiver)
           
 void start()
          Starts the ImageService.
 void stop()
          Stops the ImageService.
 
Methods inherited from class org.robokind.api.messaging.services.DefaultServiceClient
getClientId, getHostId, initialize, send, setCommandFactory, setCommandSender, setConfigSender, setErrorReceiver
 
Methods inherited from class org.robokind.api.common.playable.AbstractPlayable
addPlayableListener, afterComplete, complete, firePlayStateChanged, getElapsedPauseTime, getElapsedPlayTime, getPauseTime, getPlayState, getResumeTime, getStartTime, getStopTime, pause, removePlayableListener, resume, 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.robokind.api.common.playable.Playable
addPlayableListener, complete, getElapsedPauseTime, getElapsedPlayTime, getPauseTime, getPlayState, getResumeTime, getStartTime, getStopTime, pause, removePlayableListener, resume, start, stop
 

Constructor Detail

RemoteSpeechRecServiceClient

public RemoteSpeechRecServiceClient(Class<Conf> configClass,
                                    String speechRecServiceId,
                                    String remoteId,
                                    org.robokind.api.messaging.MessageSender<org.robokind.api.messaging.services.ServiceCommand> commandSender,
                                    org.robokind.api.messaging.MessageSender<Conf> configSender,
                                    org.robokind.api.messaging.MessageAsyncReceiver<org.robokind.api.messaging.services.ServiceError> errorReceiver,
                                    org.robokind.api.messaging.services.ServiceCommandFactory commandFactory,
                                    org.robokind.api.messaging.MessageAsyncReceiver<SpeechRecEventList> speechRecReceiver)
Creates a new RemoteSpeechRecServiceClients. Call start() to start the service.

Parameters:
configClass -
speechRecServiceId -
remoteId -
commandSender -
configSender -
errorReceiver -
commandFactory -
speechRecReceiver -
Method Detail

getSpeechRecServiceId

public String getSpeechRecServiceId()
Description copied from interface: SpeechRecService
Returns the ImageService Id.

Specified by:
getSpeechRecServiceId in interface SpeechRecService
Returns:
ImageService Id

start

public void start()
Description copied from interface: SpeechRecService
Starts the ImageService.

Specified by:
start in interface SpeechRecService

stop

public void stop()
Description copied from interface: SpeechRecService
Stops the ImageService.

Specified by:
stop in interface SpeechRecService

onComplete

public boolean onComplete(long time)
Overrides:
onComplete in class org.robokind.api.messaging.services.DefaultServiceClient<Conf>

onPause

public boolean onPause(long time)
Overrides:
onPause in class org.robokind.api.messaging.services.DefaultServiceClient<Conf>

onResume

public boolean onResume(long time)
Overrides:
onResume in class org.robokind.api.messaging.services.DefaultServiceClient<Conf>

onStart

public boolean onStart(long time)
Overrides:
onStart in class org.robokind.api.messaging.services.DefaultServiceClient<Conf>

onStop

public boolean onStop(long time)
Overrides:
onStop in class org.robokind.api.messaging.services.DefaultServiceClient<Conf>

setSpeechRecReceiver

public void setSpeechRecReceiver(org.robokind.api.messaging.MessageAsyncReceiver<SpeechRecEventList> receiver)

addSpeechRecListener

public void addSpeechRecListener(org.jflux.api.core.Listener<SpeechRecEventList> listener)
Description copied from interface: SpeechRecService
Adds a Listener to be notified when an image is received.

Specified by:
addSpeechRecListener in interface SpeechRecService
Parameters:
listener - the Listener to be notified

removeSpeechRecListener

public void removeSpeechRecListener(org.jflux.api.core.Listener<SpeechRecEventList> listener)
Description copied from interface: SpeechRecService
Removes a Listener from being notified when an image is received.

Specified by:
removeSpeechRecListener in interface SpeechRecService
Parameters:
listener - the Listener to remove


Copyright © 2011-2013. All Rights Reserved.