org.fosstrak.llrp.adaptor
Interface Reader

All Superinterfaces:
java.rmi.Remote
All Known Implementing Classes:
ReaderImpl

public interface Reader
extends java.rmi.Remote

This class models a logical entity of a physical reader. it maintains the connectivity to the physical reader.

Author:
sawielan

Method Summary
 void connect(boolean clientInitiatedConnection)
          connects this reader to the real physical llrp reader.
 void deregisterFromAsynchronous(AsynchronousNotifiable receiver)
          deregister from the asynchronous messages. the receiver will no more receive asynchronous llrp messages.
 void disconnect()
          disconnect the reader stub from the physical reader.
 int getKeepAlivePeriod()
          returns the keepalive period set for this reader.
 ReaderMetaData getMetaData()
          the reader meta-data contains information about the reader, the settings, etc.
 int getPort()
          return the port of this reader.
 java.lang.String getReaderAddress()
          return the ip address of this reader.
 java.lang.String getReaderName()
          return the name of this reader.
 boolean isClientInitiated()
          tell if this reader maintains a client initiated connection or if the reader accepts a connection from a llrp reader.
 boolean isConnected()
          tells if the reader is connected or not.
 boolean isConnectImmediate()
          tells whether this reader connects immediately after creation.
 boolean isReportKeepAlive()
           
 void reconnect()
          try to reconnect the reader.
 void registerForAsynchronous(AsynchronousNotifiable receiver)
          register for asynchronous messages from the physical reader.
 void send(byte[] message)
          send a message to the llrp reader.
 void setClientInitiated(boolean clientInitiated)
          sets the connect behavior to the specified value.
 void setConnectImmediate(boolean value)
          tells whether this reader connects immediately after creation.
 void setKeepAlivePeriod(int keepAlivePeriod, int times, boolean report, boolean throwException)
          sets the connection timeout period for the reader. if the times * keepAlivePeriod has passed by without a notification from the reader the reader gets disconnected.
 void setReportKeepAlive(boolean report)
          if set to true, the reader will report all the keep-alive messages exchanged between the reader and the driver stub.
 

Method Detail

connect

void connect(boolean clientInitiatedConnection)
             throws LLRPRuntimeException,
                    java.rmi.RemoteException
connects this reader to the real physical llrp reader.

Parameters:
clientInitiatedConnection - if the connection is initiated by the client then you should pass true. if the physical reader initiates the connection then provide false.
Throws:
LLRPRuntimeException - whenever an error occurs.
java.rmi.RemoteException - whenever there is an rmi error.

disconnect

void disconnect()
                throws java.rmi.RemoteException
disconnect the reader stub from the physical reader.

Throws:
java.rmi.RemoteException - whenever there is an rmi error.

reconnect

void reconnect()
               throws LLRPRuntimeException,
                      java.rmi.RemoteException
try to reconnect the reader.

Throws:
java.rmi.RemoteException - whenever there is an rmi error.
LLRPRuntimeException - whenever there is a exception during connection setup.

send

void send(byte[] message)
          throws java.rmi.RemoteException
send a message to the llrp reader.

Parameters:
message - the message to be sent.
Throws:
java.rmi.RemoteException - whenever there is an rmi error.

isConnected

boolean isConnected()
                    throws java.rmi.RemoteException
tells if the reader is connected or not.

Returns:
true if the reader is connected.
Throws:
java.rmi.RemoteException - whenever there is an rmi error.

getReaderAddress

java.lang.String getReaderAddress()
                                  throws java.rmi.RemoteException
return the ip address of this reader.

Returns:
the ip address of this reader.
Throws:
java.rmi.RemoteException - whenever there is an rmi error.

getReaderName

java.lang.String getReaderName()
                               throws java.rmi.RemoteException
return the name of this reader.

Returns:
the name of this reader.
Throws:
java.rmi.RemoteException - whenever there is an rmi error.

getPort

int getPort()
            throws java.rmi.RemoteException
return the port of this reader.

Returns:
the port of this reader.
Throws:
java.rmi.RemoteException - whenever there is an rmi error.

isClientInitiated

boolean isClientInitiated()
                          throws java.rmi.RemoteException
tell if this reader maintains a client initiated connection or if the reader accepts a connection from a llrp reader.

Returns:
  • true if client initiated connection
  • false if llrp reader initiated connection
Throws:
java.rmi.RemoteException - whenever there is an rmi error.

setClientInitiated

void setClientInitiated(boolean clientInitiated)
                        throws java.rmi.RemoteException
sets the connect behavior to the specified value.

Parameters:
clientInitiated - if true then the client issues the connect.
Throws:
java.rmi.RemoteException - whever there is an RMI error.

isConnectImmediate

boolean isConnectImmediate()
                           throws java.rmi.RemoteException
tells whether this reader connects immediately after creation.

Returns:
whether this reader connects immediately after creation.
Throws:
java.rmi.RemoteException - whenever there is an RMI error.

setConnectImmediate

void setConnectImmediate(boolean value)
                         throws java.rmi.RemoteException
tells whether this reader connects immediately after creation.

Parameters:
value - whether this reader connects immediately after creation.
Throws:
java.rmi.RemoteException - whenever there is an RMI error.

registerForAsynchronous

void registerForAsynchronous(AsynchronousNotifiable receiver)
                             throws java.rmi.RemoteException
register for asynchronous messages from the physical reader.

Parameters:
receiver - the receiver that shall be notified with the message.
Throws:
java.rmi.RemoteException - whenever there is an RMI error.

deregisterFromAsynchronous

void deregisterFromAsynchronous(AsynchronousNotifiable receiver)
                                throws java.rmi.RemoteException
deregister from the asynchronous messages. the receiver will no more receive asynchronous llrp messages.

Parameters:
receiver - the receiver to deregister.
Throws:
java.rmi.RemoteException - whenever there is an RMI error.

setKeepAlivePeriod

void setKeepAlivePeriod(int keepAlivePeriod,
                        int times,
                        boolean report,
                        boolean throwException)
                        throws java.rmi.RemoteException
sets the connection timeout period for the reader. if the times * keepAlivePeriod has passed by without a notification from the reader the reader gets disconnected.

Parameters:
keepAlivePeriod - the reader must send in this period a keepalive message. time in ms.
times - how many missed keepalive messages are ok.
report - whether to report the keepalive messages to the repo or not.
throwException - whether to throw an exception upon disconnection.
Throws:
java.rmi.RemoteException - whenever there is an RMI error.

getKeepAlivePeriod

int getKeepAlivePeriod()
                       throws java.rmi.RemoteException
returns the keepalive period set for this reader.

Returns:
the keepalive period set for this reader.
Throws:
java.rmi.RemoteException - whenever there is an RMI error.

setReportKeepAlive

void setReportKeepAlive(boolean report)
                        throws java.rmi.RemoteException
if set to true, the reader will report all the keep-alive messages exchanged between the reader and the driver stub.

Parameters:
report - if true report the status messages. if false not.
Throws:
java.rmi.RemoteException - whenever there is an RMI error.

isReportKeepAlive

boolean isReportKeepAlive()
                          throws java.rmi.RemoteException
Returns:
whether the reader stub delivers the keep-alive messages to the repo or not.
Throws:
java.rmi.RemoteException - whenever there is an RMI error.

getMetaData

ReaderMetaData getMetaData()
                           throws java.rmi.RemoteException
the reader meta-data contains information about the reader, the settings, etc.

Returns:
a meta-data structure.
Throws:
java.rmi.RemoteException - whenever there is an RMI error.


Copyright © 2009. All Rights Reserved.