org.robokind.api.messaging.services
Class DefaultServiceClient<Conf>

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

public class DefaultServiceClient<Conf>
extends org.robokind.api.common.playable.AbstractPlayable
implements RemoteServiceClient<Conf>

Author:
Matthew Stevenson

Field Summary
 
Fields inherited from class org.robokind.api.common.playable.AbstractPlayable
myElapsedPauseTime, myPauseTime, myPlayableListeners, myPlayState, myResumeTime, myStartTime, myStopTime
 
Constructor Summary
DefaultServiceClient(String localId, String remoteId, MessageSender<ServiceCommand> commandSender, MessageSender<Conf> configSender, MessageAsyncReceiver<ServiceError> errorReceiver, ServiceCommandFactory commandFactory)
           
 
Method Summary
 String getClientId()
           
 String getHostId()
           
 void initialize(Conf config)
          Initializes the Service with the given config.
 boolean onComplete(long time)
           
 boolean onPause(long time)
           
 boolean onResume(long time)
           
 boolean onStart(long time)
           
 boolean onStop(long time)
           
protected  void send(String commandStr)
           
 void setCommandFactory(ServiceCommandFactory factory)
           
 void setCommandSender(MessageSender<ServiceCommand> sender)
           
 void setConfigSender(MessageSender<Conf> sender)
           
 void setErrorReceiver(MessageAsyncReceiver<ServiceError> receiver)
           
 
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

DefaultServiceClient

public DefaultServiceClient(String localId,
                            String remoteId,
                            MessageSender<ServiceCommand> commandSender,
                            MessageSender<Conf> configSender,
                            MessageAsyncReceiver<ServiceError> errorReceiver,
                            ServiceCommandFactory commandFactory)
Method Detail

initialize

public void initialize(Conf config)
Description copied from interface: RemoteServiceClient
Initializes the Service with the given config.

Specified by:
initialize in interface RemoteServiceClient<Conf>
Parameters:
config - the configuration object used to initialize the Service

onStart

public boolean onStart(long time)
Specified by:
onStart in class org.robokind.api.common.playable.AbstractPlayable

onPause

public boolean onPause(long time)
Specified by:
onPause in class org.robokind.api.common.playable.AbstractPlayable

onResume

public boolean onResume(long time)
Specified by:
onResume in class org.robokind.api.common.playable.AbstractPlayable

onComplete

public boolean onComplete(long time)
Specified by:
onComplete in class org.robokind.api.common.playable.AbstractPlayable

onStop

public boolean onStop(long time)
Specified by:
onStop in class org.robokind.api.common.playable.AbstractPlayable

send

protected void send(String commandStr)

setCommandSender

public void setCommandSender(MessageSender<ServiceCommand> sender)
Specified by:
setCommandSender in interface RemoteServiceClient<Conf>

setConfigSender

public void setConfigSender(MessageSender<Conf> sender)
Specified by:
setConfigSender in interface RemoteServiceClient<Conf>

setErrorReceiver

public void setErrorReceiver(MessageAsyncReceiver<ServiceError> receiver)
Specified by:
setErrorReceiver in interface RemoteServiceClient<Conf>

setCommandFactory

public void setCommandFactory(ServiceCommandFactory factory)
Specified by:
setCommandFactory in interface RemoteServiceClient<Conf>

getClientId

public String getClientId()
Specified by:
getClientId in interface RemoteServiceClient<Conf>

getHostId

public String getHostId()
Specified by:
getHostId in interface RemoteServiceClient<Conf>


Copyright © 2011-2013. All Rights Reserved.