org.fosstrak.ale.server.readers
Class BaseReader

java.lang.Object
  extended by java.util.Observable
      extended by org.fosstrak.ale.server.readers.LogicalReader
          extended by org.fosstrak.ale.server.readers.BaseReader
Direct Known Subclasses:
HALAdaptor, LLRPAdaptor, RPAdaptor, TestAdaptor

public abstract class BaseReader
extends LogicalReader

represents an abstract superclass for basereaders.

Author:
sawielan

Field Summary
protected  boolean connected
          indicates whether the reader is connected or not.
 
Fields inherited from class org.fosstrak.ale.server.readers.LogicalReader
logicalReaderProperties, logicalReaderSpec, properties, readerName, started
 
Constructor Summary
BaseReader()
          constructor for a BaseReader.
 
Method Summary
abstract  void addTag(Tag tag)
          add a tag to a reader.
abstract  void addTags(java.util.List<Tag> tags)
          add a List of tags to a reader.
 void cleanup()
          this method is called whenever a reader is undefined. a basereader can override this method with its own cleanup routine.
abstract  void connectReader()
          sets up a reader.
abstract  void disconnectReader()
          destroys a reader.
abstract  org.fosstrak.hal.Observation[] identify(java.lang.String[] readPointNames)
          Triggers the identification of all tags that are currently available on the reader.
 void initialize(java.lang.String name, org.fosstrak.ale.xsd.ale.epcglobal.LRSpec spec)
          initializes a BaseReader. this method must be called befor the Reader can be used.
protected  boolean isConnected()
          tells whether the reader is connected or not.
protected  void setConnected()
          flags the reader as connected.
protected  void setDisconnected()
          flags the reader as disconnected.
abstract  void start()
          starts a basereader to read tags.
abstract  void stop()
          stops a reader from reading tags.
abstract  void update(org.fosstrak.ale.xsd.ale.epcglobal.LRSpec spec)
          updates a reader according the specified LRSpec.
 
Methods inherited from class org.fosstrak.ale.server.readers.LogicalReader
createReader, getLRSpec, getName, getProperties, isStarted, setLRSpec, setName, setProperties, setStarted, setStopped
 
Methods inherited from class java.util.Observable
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

connected

protected boolean connected
indicates whether the reader is connected or not.

Constructor Detail

BaseReader

public BaseReader()
constructor for a BaseReader.

Method Detail

initialize

public void initialize(java.lang.String name,
                       org.fosstrak.ale.xsd.ale.epcglobal.LRSpec spec)
                throws org.fosstrak.ale.wsdl.ale.epcglobal.ImplementationExceptionResponse
initializes a BaseReader. this method must be called befor the Reader can be used.

Overrides:
initialize in class LogicalReader
Parameters:
name - the name for the reader encapsulated by this reader.
spec - the specification that describes the current reader.
Throws:
org.fosstrak.ale.wsdl.ale.epcglobal.ImplementationException - whenever an internal error occurs.
org.fosstrak.ale.wsdl.ale.epcglobal.ImplementationExceptionResponse

addTag

public abstract void addTag(Tag tag)
add a tag to a reader.

Parameters:
tag - tag to be added to the reader

addTags

public abstract void addTags(java.util.List<Tag> tags)
add a List of tags to a reader.

Parameters:
tags - a list of tags to be added to the reader

start

public abstract void start()
starts a basereader to read tags.

Specified by:
start in class LogicalReader

stop

public abstract void stop()
stops a reader from reading tags.

Specified by:
stop in class LogicalReader

connectReader

public abstract void connectReader()
                            throws org.fosstrak.ale.wsdl.ale.epcglobal.ImplementationExceptionResponse
sets up a reader.

Throws:
org.fosstrak.ale.wsdl.ale.epcglobal.ImplementationException - whenever an internal error occured
org.fosstrak.ale.wsdl.ale.epcglobal.ImplementationExceptionResponse

disconnectReader

public abstract void disconnectReader()
                               throws org.fosstrak.ale.wsdl.ale.epcglobal.ImplementationExceptionResponse
destroys a reader.

Throws:
org.fosstrak.ale.wsdl.ale.epcglobal.ImplementationException - whenever an internal error occured
org.fosstrak.ale.wsdl.ale.epcglobal.ImplementationExceptionResponse

update

public abstract void update(org.fosstrak.ale.xsd.ale.epcglobal.LRSpec spec)
                     throws org.fosstrak.ale.wsdl.ale.epcglobal.ImplementationExceptionResponse
updates a reader according the specified LRSpec.

Specified by:
update in class LogicalReader
Parameters:
spec - LRSpec for the reader
Throws:
org.fosstrak.ale.wsdl.ale.epcglobal.ImplementationException - whenever an internal error occurs
org.fosstrak.ale.wsdl.ale.epcglobal.ImplementationExceptionResponse

identify

public abstract org.fosstrak.hal.Observation[] identify(java.lang.String[] readPointNames)
                                                 throws org.fosstrak.hal.HardwareException
Triggers the identification of all tags that are currently available on the reader.

Parameters:
readPointNames - the readers/sources that have to be polled
Returns:
a set of Observations
Throws:
org.fosstrak.hal.HardwareException - whenever an internal hardware error occurs (as reader not available...)

setConnected

protected void setConnected()
flags the reader as connected.


setDisconnected

protected void setDisconnected()
flags the reader as disconnected.


isConnected

protected boolean isConnected()
tells whether the reader is connected or not.

Returns:
boolean true or false

cleanup

public void cleanup()
this method is called whenever a reader is undefined. a basereader can override this method with its own cleanup routine.



Copyright © 2009. All Rights Reserved.