org.fosstrak.llrp.adaptor
Interface Adaptor

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

public interface Adaptor
extends java.rmi.Remote

The interface Adaptor provides a general interface how to access a set of LLRP readers.

Author:
sawielan

Method Summary
 boolean containsReader(java.lang.String readerName)
          checks whether a readerName already exists.
 void define(java.lang.String readerName, java.lang.String readerAddress, boolean clientInitiatedConnection, boolean connectImmediately)
          defines a new LLRP reader on this adaptor.
 void define(java.lang.String readerName, java.lang.String readerAddress, int port, boolean clientInitiatedConnection, boolean connectImmediately)
          defines a new LLRP reader on this adaptor.
 void deregisterFromAsynchronous(AsynchronousNotifiable receiver)
          deregister from the asynchronous messages. the receiver will no more receive asynchronous llrp messages.
 void disconnectAll()
          disconnects all the LLRP readers from this adaptor.
 void errorCallback(LLRPRuntimeException e, java.lang.String readerName)
          callback interface for asynchronous error messages from the reader.
 java.lang.String getAdaptorName()
          returns the name of this adaptor.
 Reader getReader(java.lang.String readerName)
          returns a requested reader.
 java.util.List<java.lang.String> getReaderNames()
          returns a list of all currently registered LLRP readers.
 void messageReceivedCallback(byte[] message, java.lang.String readerName)
          when a asynchronous message arrives from the reader this method will be invoked. the message then gets dispatched to the registered receivers.
 void registerForAsynchronous(AsynchronousNotifiable receiver)
          register for asynchronous messages from the reader.
 void sendLLRPMessage(java.lang.String readerName, byte[] message)
          sends a llrp message to the specified reader.
 void sendLLRPMessageToAllReaders(byte[] message)
          sends a llrp message to all the readers.
 void setAdaptorName(java.lang.String adaptorName)
          sets the name of the adaptor.
 void undefine(java.lang.String readerName)
          removes a LLRP reader from this adaptor.
 void undefineAll()
          removes all the LLRP readers from this adaptor.
 

Method Detail

define

void define(java.lang.String readerName,
            java.lang.String readerAddress,
            boolean clientInitiatedConnection,
            boolean connectImmediately)
            throws java.rmi.RemoteException,
                   LLRPRuntimeException
defines a new LLRP reader on this adaptor.

Parameters:
readerName - the name of the LLRP reader.
readerAddress - the address where to contact the LLRP reader.
clientInitiatedConnection - LLRP allows two different ways how to create a connection to a reader.
  1. client initiated connection: in this model the client tries to establish the connection to the reader
  2. reader initiated connection: in this model the client waits for a reader to establish the connection
when you specify true a client initiated connection is established. otherwise a reader initiated connection.
connectImmediately - tells whether the reader shall establish connection immediately or not
  1. true: the reader tries to build up the connection immediately
  2. false: the reader is just created, but the connection to the physical reader will not be established yet. you need to run the connect command on the reader before you can use it!
Throws:
LLRPRuntimeException - if a runtime exception occurs (like duplicate reader name etc. ...).
java.rmi.RemoteException - when there was an rmi exception.

define

void define(java.lang.String readerName,
            java.lang.String readerAddress,
            int port,
            boolean clientInitiatedConnection,
            boolean connectImmediately)
            throws java.rmi.RemoteException,
                   LLRPRuntimeException
defines a new LLRP reader on this adaptor.

Parameters:
readerName - the name of the LLRP reader.
readerAddress - the address where to contact the LLRP reader.
port - the port where to connect to.
clientInitiatedConnection - LLRP allows two different ways how to create a connection to a reader.
  1. client initiated connection: in this model the client tries to establish the connection to the reader
  2. reader initiated connection: in this model the client waits for a reader to establish the connection
when you specify true a client initiated connection is established. otherwise a reader initiated connection.
connectImmediately - tells whether the reader shall establish connection immediately or not
  1. true: the reader tries to build up the connection immediately
  2. false: the reader is just created, but the connection to the physical reader will not be established yet. you need to run the connect command on the reader before you can use it!
Throws:
LLRPRuntimeException - if a runtime exception occurs (like duplicate reader name etc. ...).
java.rmi.RemoteException - when there was an rmi exception.

undefine

void undefine(java.lang.String readerName)
              throws java.rmi.RemoteException,
                     LLRPRuntimeException
removes a LLRP reader from this adaptor.

Parameters:
readerName - the name of the LLRP reader to remove.
Throws:
LLRPRuntimeException - if a runtime exception occurs (eg reader does not exist etc. ...).
java.rmi.RemoteException - when there was an rmi exception.

undefineAll

void undefineAll()
                 throws java.rmi.RemoteException,
                        LLRPRuntimeException
removes all the LLRP readers from this adaptor.

Throws:
java.rmi.RemoteException - when there was an rmi exception.
LLRPRuntimeException - if a runtime exception occurs (eg reader does not exist etc. ...).

disconnectAll

void disconnectAll()
                   throws java.rmi.RemoteException,
                          LLRPRuntimeException
disconnects all the LLRP readers from this adaptor.

Throws:
java.rmi.RemoteException - when there was an rmi exception.
LLRPRuntimeException - if a runtime exception occurs (eg reader does not exist etc. ...).

containsReader

boolean containsReader(java.lang.String readerName)
                       throws java.rmi.RemoteException
checks whether a readerName already exists.

Parameters:
readerName - the name of the reader.
Returns:
true if the reader exists else false.
Throws:
java.rmi.RemoteException - when there was an rmi exception.

getReaderNames

java.util.List<java.lang.String> getReaderNames()
                                                throws java.rmi.RemoteException
returns a list of all currently registered LLRP readers.

Returns:
a list of all currently registered LLRP readers.
Throws:
java.rmi.RemoteException - when there was an rmi exception.

getReader

Reader getReader(java.lang.String readerName)
                 throws java.rmi.RemoteException
returns a requested reader.

Parameters:
readerName - the name of the requested reader.
Returns:
the reader.
Throws:
java.rmi.RemoteException - when there was an rmi exception.

getAdaptorName

java.lang.String getAdaptorName()
                                throws java.rmi.RemoteException
returns the name of this adaptor.

Returns:
the name of this adaptor.
Throws:
java.rmi.RemoteException - when there was an rmi exception.

setAdaptorName

void setAdaptorName(java.lang.String adaptorName)
                    throws java.rmi.RemoteException
sets the name of the adaptor.

Parameters:
adaptorName - the name of the adaptor to set.
Throws:
java.rmi.RemoteException

sendLLRPMessage

void sendLLRPMessage(java.lang.String readerName,
                     byte[] message)
                     throws java.rmi.RemoteException,
                            LLRPRuntimeException
sends a llrp message to the specified reader.

Parameters:
readerName - the name of the reader where to send the message.
message - the llrp message.
Throws:
LLRPRuntimeException - whever a runtime error occurs.
java.rmi.RemoteException - when there was an rmi exception.

sendLLRPMessageToAllReaders

void sendLLRPMessageToAllReaders(byte[] message)
                                 throws java.rmi.RemoteException,
                                        LLRPRuntimeException
sends a llrp message to all the readers.

Parameters:
message - the llrp message.
Throws:
LLRPRuntimeException - whever a runtime error occurs.
java.rmi.RemoteException - when there was an rmi exception.

registerForAsynchronous

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

Parameters:
receiver - the receiver that shall be notified with the message.
Throws:
java.rmi.RemoteException - when there was an rmi exception.

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 - when there was an rmi exception.

messageReceivedCallback

void messageReceivedCallback(byte[] message,
                             java.lang.String readerName)
                             throws java.rmi.RemoteException
when a asynchronous message arrives from the reader this method will be invoked. the message then gets dispatched to the registered receivers.

Parameters:
message - the llrp message.
readerName - the name of the reader that triggered the event.
Throws:
java.rmi.RemoteException - when there was an rmi exception.

errorCallback

void errorCallback(LLRPRuntimeException e,
                   java.lang.String readerName)
                   throws java.rmi.RemoteException
callback interface for asynchronous error messages from the reader.

Parameters:
e - the exception that has been reported.
readerName - the name of the reader where the error occured.
Throws:
java.rmi.RemoteException - whenver there is an error on transport level (rmi).


Copyright © 2009. All Rights Reserved.