org.fosstrak.ale.server.readers.rp
Class RPAdaptor

java.lang.Object
  extended by java.util.Observable
      extended by org.fosstrak.ale.server.readers.LogicalReader
          extended by org.fosstrak.ale.server.readers.BaseReader
              extended by org.fosstrak.ale.server.readers.rp.RPAdaptor

public class RPAdaptor
extends BaseReader

represents an adaptor to the RP reader.

Author:
sawielan

Field Summary
static int DEFAULT_READTIME_INTERVALL
          default readTimeInterval.
 
Fields inherited from class org.fosstrak.ale.server.readers.BaseReader
connected
 
Fields inherited from class org.fosstrak.ale.server.readers.LogicalReader
logicalReaderProperties, logicalReaderSpec, properties, readerName, started
 
Constructor Summary
RPAdaptor()
          constructor for the RP adaptor.
 
Method Summary
 void addTag(Tag tag)
          whenever a new Tag is read a notification is sent to the observers.
 void addTags(java.util.List<Tag> tags)
          whenever new Tags are read a notification is sent to the observers.
 void connectReader()
          sets up a reader. if the adaptor can be connected to the rp-proxy the adaptor will be set to connected.
 void disconnectReader()
          destroys a reader.
 java.lang.String getCommandChannelHost()
          returns the commandChannelHost of the rp-proxy.
 int getCommandChannelPort()
          returns the commandChannelPort of the rp-proxy.
 java.lang.String getNotificationChannelHost()
          returns the notificationChannelHost of the rp-proxy.
 int getNotificationChannelPort()
          returns the notificationChannelPort of the rp-proxy.
 int getReadTimeInterval()
          returns the readTimeInterval.
 java.util.Set<java.lang.String> getSources()
          returns the sources from where the reader reads tags.
 org.fosstrak.hal.Observation[] identify(java.lang.String[] readPointNames)
          Triggers the identification of all tags that are currently available on the reader. this method is used when the IdentifyThread is used to poll the adaptor.
 void initialize(java.lang.String name, org.fosstrak.ale.xsd.ale.epcglobal.LRSpec spec)
          initializes a RPAdaptor. this method must be called befor the Adaptor can be used.
 void start()
          starts a base reader to read tags. if the reader is not yet connected this command will connect the reader immediately and then start it.
 void stop()
          stops a reader from reading tags.
 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.BaseReader
cleanup, isConnected, setConnected, setDisconnected
 
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

DEFAULT_READTIME_INTERVALL

public static final int DEFAULT_READTIME_INTERVALL
default readTimeInterval.

See Also:
Constant Field Values
Constructor Detail

RPAdaptor

public RPAdaptor()
constructor for the RP adaptor.

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

Overrides:
initialize in class BaseReader
Parameters:
name - the name for the reader encapsulated by this adaptor.
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

connectReader

public void connectReader()
                   throws org.fosstrak.ale.wsdl.ale.epcglobal.ImplementationExceptionResponse
sets up a reader. if the adaptor can be connected to the rp-proxy the adaptor will be set to connected.

Specified by:
connectReader in class BaseReader
Throws:
org.fosstrak.ale.wsdl.ale.epcglobal.ImplementationException - whenever an internal error occured
org.fosstrak.ale.wsdl.ale.epcglobal.ImplementationExceptionResponse

disconnectReader

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

Specified by:
disconnectReader in class BaseReader
Throws:
org.fosstrak.ale.wsdl.ale.epcglobal.ImplementationException - whenever an internal error occured
org.fosstrak.ale.wsdl.ale.epcglobal.ImplementationExceptionResponse

addTag

public void addTag(Tag tag)
whenever a new Tag is read a notification is sent to the observers.

Specified by:
addTag in class BaseReader
Parameters:
tag - a tag read on the reader

addTags

public void addTags(java.util.List<Tag> tags)
whenever new Tags are read a notification is sent to the observers.

Specified by:
addTags in class BaseReader
Parameters:
tags - a list of tags to be added to the reader

start

public void start()
starts a base reader to read tags. if the reader is not yet connected this command will connect the reader immediately and then start it. If the reader cannot be connected then the reader is not started as well.

Specified by:
start in class BaseReader

stop

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

Specified by:
stop in class BaseReader

update

public 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 BaseReader
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 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. this method is used when the IdentifyThread is used to poll the adaptor.

Specified by:
identify in class BaseReader
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...)

getCommandChannelHost

public java.lang.String getCommandChannelHost()
returns the commandChannelHost of the rp-proxy.

Returns:
the commandChannelHost.

getCommandChannelPort

public int getCommandChannelPort()
returns the commandChannelPort of the rp-proxy.

Returns:
the commandChannelPort.

getNotificationChannelHost

public java.lang.String getNotificationChannelHost()
returns the notificationChannelHost of the rp-proxy.

Returns:
the notificationChannelHost

getNotificationChannelPort

public int getNotificationChannelPort()
returns the notificationChannelPort of the rp-proxy.

Returns:
the notificationChannelPort.

getReadTimeInterval

public int getReadTimeInterval()
returns the readTimeInterval.

Returns:
the readTimeInterval

getSources

public java.util.Set<java.lang.String> getSources()
returns the sources from where the reader reads tags.

Returns:
the sources from where the reader reads tags.


Copyright © 2009. All Rights Reserved.