org.fosstrak.ale.server.readers
Class LogicalReader

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

public abstract class LogicalReader
extends java.util.Observable

Represents the abstract interface for a reader. a reader can be either a composite of different readers or a basereader

Author:
sawielan

Field Summary
protected  java.util.Map<java.lang.String,java.lang.String> logicalReaderProperties
          property value pair for the reader configuration.
protected  org.fosstrak.ale.xsd.ale.epcglobal.LRSpec logicalReaderSpec
          LRSpec for the reader.
protected  java.util.List<org.fosstrak.ale.xsd.ale.epcglobal.LRProperty> properties
          LRpoperties for the reader.
protected  java.lang.String readerName
          name of the reader.
protected  boolean started
          indicates whether the reader is started or not.
 
Constructor Summary
LogicalReader()
          constructor for the logical reader.
 
Method Summary
static LogicalReader createReader(java.lang.String name, org.fosstrak.ale.xsd.ale.epcglobal.LRSpec spec)
          factory method to create a new reader. this can be a CompositeReader or a BaseReader.
 org.fosstrak.ale.xsd.ale.epcglobal.LRSpec getLRSpec()
          This method returns the spec.
 java.lang.String getName()
          This method returns the name of the logical reader.
 java.util.List<org.fosstrak.ale.xsd.ale.epcglobal.LRProperty> getProperties()
          This method returns the properties.
 void initialize(java.lang.String name, org.fosstrak.ale.xsd.ale.epcglobal.LRSpec spec)
          initializes a Logical Reader. this method must be called befor the Reader can be used.
protected  boolean isStarted()
          tells whether the reader is started or not.
 void setLRSpec(org.fosstrak.ale.xsd.ale.epcglobal.LRSpec spec)
          This method sets the LRSpec.
 void setName(java.lang.String name)
          This method sets the name of the logical reader.
 void setProperties(java.lang.String name, org.fosstrak.ale.xsd.ale.epcglobal.LRProperty property)
          This method sets the LRProperty property to the logical reader named name.
protected  void setStarted()
          flags the reader as started.
protected  void setStopped()
          flags the reader as stopped.
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 the specification of a logical reader.
 
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

readerName

protected java.lang.String readerName
name of the reader.


logicalReaderProperties

protected java.util.Map<java.lang.String,java.lang.String> logicalReaderProperties
property value pair for the reader configuration.


logicalReaderSpec

protected org.fosstrak.ale.xsd.ale.epcglobal.LRSpec logicalReaderSpec
LRSpec for the reader.


properties

protected java.util.List<org.fosstrak.ale.xsd.ale.epcglobal.LRProperty> properties
LRpoperties for the reader.


started

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

Constructor Detail

LogicalReader

public LogicalReader()
constructor for the logical reader.

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 Logical Reader. this method must be called befor the Reader can be used.

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

setLRSpec

public void setLRSpec(org.fosstrak.ale.xsd.ale.epcglobal.LRSpec spec)
This method sets the LRSpec.

Parameters:
spec - The spec.

getLRSpec

public org.fosstrak.ale.xsd.ale.epcglobal.LRSpec getLRSpec()
This method returns the spec.

Returns:
This is the spec of the logical reader.

setProperties

public void setProperties(java.lang.String name,
                          org.fosstrak.ale.xsd.ale.epcglobal.LRProperty property)
This method sets the LRProperty property to the logical reader named name.

Parameters:
name - name of the property
property - The property.

getProperties

public java.util.List<org.fosstrak.ale.xsd.ale.epcglobal.LRProperty> getProperties()
This method returns the properties.

Returns:
returns a list of LRProperty

setStarted

protected void setStarted()
flags the reader as started.


setStopped

protected void setStopped()
flags the reader as stopped.


isStarted

protected boolean isStarted()
tells whether the reader is started or not.

Returns:
boolean true or false

createReader

public static LogicalReader createReader(java.lang.String name,
                                         org.fosstrak.ale.xsd.ale.epcglobal.LRSpec spec)
                                  throws org.fosstrak.ale.wsdl.ale.epcglobal.ImplementationExceptionResponse
factory method to create a new reader. this can be a CompositeReader or a BaseReader.

Parameters:
name - name of the reader
spec - the specificationFile for a Reader
Returns:
a logical reader
Throws:
org.fosstrak.ale.wsdl.ale.epcglobal.ImplementationException - when the LogicalReader could not be built by reflection
org.fosstrak.ale.wsdl.ale.epcglobal.ImplementationExceptionResponse

getName

public java.lang.String getName()
This method returns the name of the logical reader.

Returns:
name of this logical reader

setName

public void setName(java.lang.String name)
This method sets the name of the logical reader.

Parameters:
name - name of this logical reader

update

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

Parameters:
spec - an LRSpec containing the changes of the reader
Throws:
org.fosstrak.ale.wsdl.ale.epcglobal.ImplementationException - whenever an internal error occurs
org.fosstrak.ale.wsdl.ale.epcglobal.ImplementationExceptionResponse

stop

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


start

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



Copyright © 2009. All Rights Reserved.