2009-10-01 1.2.0

org.eclipse.soda.dk.epcglobal.llrp.helper.task
Class AbstractLLRPTask

java.lang.Object
  extended by EscObject
      extended by org.eclipse.soda.dk.epcglobal.llrp.helper.taskmanager.AbstractTask
          extended by org.eclipse.soda.dk.epcglobal.llrp.helper.task.AbstractLLRPTask
All Implemented Interfaces:
ITask
Direct Known Subclasses:
AbstractSimpleTask, Task_GET_ACCESSSPECS, Task_GET_GPIConfig, Task_GET_GPOConfig, Task_GET_READER_CAPABILITIES, Task_GET_ROSPECS

public abstract class AbstractLLRPTask
extends AbstractTask

Since:
1.0
Version:
1.2.0

Field Summary
 
Fields inherited from class org.eclipse.soda.dk.epcglobal.llrp.helper.taskmanager.AbstractTask
EMPTY_RESULT, listenerLock, timerLock
 
Fields inherited from interface org.eclipse.soda.dk.epcglobal.llrp.helper.taskmanager.ITask
ABORT, ERROR, REPORT, STATE_RUNNING, STATE_STANDBY, SUCCESS, TIMEOUT
 
Constructor Summary
protected AbstractLLRPTask(CommandService command, java.util.Map parameters, SignalService signal)
          Constructs an instance of this class from the specified command, parameters and signal parameters.
protected AbstractLLRPTask(CommandService command, java.util.Map parameters, SignalService signal, long timeoutValue)
          Constructs an instance of this class from the specified command, parameters and signal parameters.
 
Method Summary
 CommandService getCommand()
          Gets the command (CommandService) value.
 int getErrorCode()
          Gets the error code (int) value.
 java.util.Map getErrorFields()
          Gets the error fields (Map) value.
 java.util.Map getParameters()
          Gets the parameters (Map) value.
 SignalService getSignal()
          Gets the signal (SignalService) value.
 boolean isResponseExpected(SignalService source, java.lang.Object timestamp, java.lang.Object data)
          Is response expected with the specified source, timestamp and data parameters and return the boolean result.
protected abstract  boolean isSameTaskType(ITask task)
          Is same task type with the specified task parameter and return the boolean result.
 boolean launchTask()
          Launch task and return the boolean result.
protected  boolean matchResponse(java.lang.Object data)
          Match response with the specified data parameter and return the boolean result.
 void setCommand(CommandService command)
          Sets the command value.
 void setParameters(java.util.Map parameters)
          Sets the parameters value.
 void setSignal(SignalService signal)
          Sets the signal value.
protected  boolean successInLLRPStatus(java.util.Map data)
          Success in llrpstatus with the specified data parameter and return the boolean result.
 
Methods inherited from class org.eclipse.soda.dk.epcglobal.llrp.helper.taskmanager.AbstractTask
abort, addTaskListener, getState, getTaskListeners, getTaskManager, getTaskOwner, isRemoveListenerRequired, notifyListener, preNotifyListener, removeTaskListener, removeTaskListenerNoThread, reset, setState, setTaskListeners, setTaskManager, setTaskOwner, start, start, startTimer, stopTimer, timeOutOccurred
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.eclipse.soda.dk.epcglobal.llrp.helper.taskmanager.ITask
duplicateTask, getTaskName, handleResponse
 

Constructor Detail

AbstractLLRPTask

protected AbstractLLRPTask(CommandService command,
                           java.util.Map parameters,
                           SignalService signal)
Constructs an instance of this class from the specified command, parameters and signal parameters.

Parameters:
command - The command (CommandService) parameter.
parameters - The parameters (Map) parameter.
signal - The signal (SignalService) parameter.
See Also:
AbstractLLRPTask(CommandService,Map,SignalService,long)

AbstractLLRPTask

protected AbstractLLRPTask(CommandService command,
                           java.util.Map parameters,
                           SignalService signal,
                           long timeoutValue)
Constructs an instance of this class from the specified command, parameters and signal parameters.

Parameters:
command - The command (CommandService) parameter.
parameters - The parameters (Map) parameter.
signal - The signal (SignalService) parameter.
timeoutValue - The timeout value (long) parameter.
See Also:
AbstractLLRPTask(CommandService,Map,SignalService)
Method Detail

getCommand

public CommandService getCommand()
Gets the command (CommandService) value.

Returns:
The command (CommandService) value.
See Also:
setCommand(CommandService)

getErrorCode

public int getErrorCode()
Gets the error code (int) value.

Returns:
The error code (int) value.

getErrorFields

public java.util.Map getErrorFields()
Gets the error fields (Map) value.

Returns:
The error fields (Map) value.

getParameters

public java.util.Map getParameters()
Gets the parameters (Map) value.

Returns:
The parameters (Map) value.
See Also:
setParameters(Map)

getSignal

public SignalService getSignal()
Gets the signal (SignalService) value.

Returns:
The signal (SignalService) value.
See Also:
setSignal(SignalService)

isResponseExpected

public boolean isResponseExpected(SignalService source,
                                  java.lang.Object timestamp,
                                  java.lang.Object data)
Is response expected with the specified source, timestamp and data parameters and return the boolean result.

Specified by:
isResponseExpected in interface ITask
Overrides:
isResponseExpected in class AbstractTask
Parameters:
source - The source (SignalService) parameter.
timestamp - The time stamp (Object) parameter.
data - The data (Object) parameter.
Returns:
Results of the is response expected (boolean) value.

isSameTaskType

protected abstract boolean isSameTaskType(ITask task)
Is same task type with the specified task parameter and return the boolean result.

Parameters:
task - The task (ITask) parameter.
Returns:
Results of the is same task type (boolean) value.

launchTask

public boolean launchTask()
Launch task and return the boolean result.

Returns:
Results of the launch task (boolean) value.
See Also:
AbstractLLRPTask(CommandService,Map,SignalService), AbstractLLRPTask(CommandService,Map,SignalService,long)

matchResponse

protected boolean matchResponse(java.lang.Object data)
Match response with the specified data parameter and return the boolean result.

Parameters:
data - The data (Object) parameter.
Returns:
Results of the match response (boolean) value.

setCommand

public void setCommand(CommandService command)
Sets the command value.

Parameters:
command - The command (CommandService) parameter.
See Also:
getCommand()

setParameters

public void setParameters(java.util.Map parameters)
Sets the parameters value.

Parameters:
parameters - The parameters (Map) parameter.
See Also:
getParameters()

setSignal

public void setSignal(SignalService signal)
Sets the signal value.

Parameters:
signal - The signal (SignalService) parameter.
See Also:
getSignal()

successInLLRPStatus

protected boolean successInLLRPStatus(java.util.Map data)
Success in llrpstatus with the specified data parameter and return the boolean result.

Parameters:
data - The data (Map) parameter.
Returns:
Results of the success in llrpstatus (boolean) value.

2009-10-01 1.2.0

Copyright (c) 2009 IBM. See license in Legal section.