|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.rmi.server.RemoteObject java.rmi.server.RemoteServer java.rmi.server.UnicastRemoteObject org.fosstrak.llrp.adaptor.AdaptorImpl
public class AdaptorImpl
This adaptor implements the Adaptor interface.
Field Summary | |
---|---|
protected java.lang.String |
adaptorName
the name of this adaptor. |
protected java.util.Map<java.lang.String,ReaderImpl> |
readers
a map holding all the readers contained in this adaptor. |
Fields inherited from class java.rmi.server.RemoteObject |
---|
ref |
Constructor Summary | |
---|---|
AdaptorImpl(java.lang.String adaptorName)
Constructor for a adaptor. |
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 |
setAdaptorManagement(AdaptorManagement management)
|
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. |
Methods inherited from class java.rmi.server.UnicastRemoteObject |
---|
clone, exportObject, exportObject, exportObject, unexportObject |
Methods inherited from class java.rmi.server.RemoteServer |
---|
getClientHost, getLog, setLog |
Methods inherited from class java.rmi.server.RemoteObject |
---|
equals, getRef, hashCode, toString, toStub |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected java.util.Map<java.lang.String,ReaderImpl> readers
protected java.lang.String adaptorName
Constructor Detail |
---|
public AdaptorImpl(java.lang.String adaptorName) throws java.rmi.RemoteException
adaptorName
- the name of this adaptor.
java.rmi.RemoteException
- whenever there is an rmi exception.Method Detail |
---|
public boolean containsReader(java.lang.String readerName) throws java.rmi.RemoteException
Adaptor
containsReader
in interface Adaptor
readerName
- the name of the reader.
java.rmi.RemoteException
- when there was an rmi exception.public void define(java.lang.String readerName, java.lang.String readerAddress, boolean clientInitiatedConnection, boolean connectImmediately) throws java.rmi.RemoteException, LLRPRuntimeException
Adaptor
define
in interface Adaptor
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. connectImmediately
- tells whether the reader shall establish connection immediately or notjava.rmi.RemoteException
- when there was an rmi exception.
LLRPRuntimeException
- if a runtime exception occurs (like duplicate reader name etc. ...).public void define(java.lang.String readerName, java.lang.String readerAddress, int port, boolean clientInitiatedConnection, boolean connectImmediately) throws java.rmi.RemoteException, LLRPRuntimeException
Adaptor
define
in interface Adaptor
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. connectImmediately
- tells whether the reader shall establish connection immediately or notjava.rmi.RemoteException
- when there was an rmi exception.
LLRPRuntimeException
- if a runtime exception occurs (like duplicate reader name etc. ...).public java.lang.String getAdaptorName() throws java.rmi.RemoteException
Adaptor
getAdaptorName
in interface Adaptor
java.rmi.RemoteException
- when there was an rmi exception.public java.util.List<java.lang.String> getReaderNames() throws java.rmi.RemoteException
Adaptor
getReaderNames
in interface Adaptor
java.rmi.RemoteException
- when there was an rmi exception.public void undefine(java.lang.String readerName) throws java.rmi.RemoteException, LLRPRuntimeException
Adaptor
undefine
in interface Adaptor
readerName
- the name of the LLRP reader to remove.
java.rmi.RemoteException
- when there was an rmi exception.
LLRPRuntimeException
- if a runtime exception occurs (eg reader does not exist etc. ...).public void undefineAll() throws java.rmi.RemoteException, LLRPRuntimeException
Adaptor
undefineAll
in interface Adaptor
java.rmi.RemoteException
- when there was an rmi exception.
LLRPRuntimeException
- if a runtime exception occurs (eg reader does not exist etc. ...).public void disconnectAll() throws java.rmi.RemoteException, LLRPRuntimeException
Adaptor
disconnectAll
in interface Adaptor
java.rmi.RemoteException
- when there was an rmi exception.
LLRPRuntimeException
- if a runtime exception occurs (eg reader does not exist etc. ...).public void sendLLRPMessage(java.lang.String readerName, byte[] message) throws java.rmi.RemoteException, LLRPRuntimeException
Adaptor
sendLLRPMessage
in interface Adaptor
readerName
- the name of the reader where to send the message.message
- the llrp message.
java.rmi.RemoteException
- when there was an rmi exception.
LLRPRuntimeException
- whever a runtime error occurs.public void sendLLRPMessageToAllReaders(byte[] message) throws java.rmi.RemoteException, LLRPRuntimeException
Adaptor
sendLLRPMessageToAllReaders
in interface Adaptor
message
- the llrp message.
java.rmi.RemoteException
- when there was an rmi exception.
LLRPRuntimeException
- whever a runtime error occurs.public void registerForAsynchronous(AsynchronousNotifiable receiver) throws java.rmi.RemoteException
Adaptor
registerForAsynchronous
in interface Adaptor
receiver
- the receiver that shall be notified with the message.
java.rmi.RemoteException
- when there was an rmi exception.public void messageReceivedCallback(byte[] message, java.lang.String readerName) throws java.rmi.RemoteException
Adaptor
messageReceivedCallback
in interface Adaptor
message
- the llrp message.readerName
- the name of the reader that triggered the event.
java.rmi.RemoteException
- when there was an rmi exception.public void deregisterFromAsynchronous(AsynchronousNotifiable receiver) throws java.rmi.RemoteException
Adaptor
deregisterFromAsynchronous
in interface Adaptor
receiver
- the receiver to deregister.
java.rmi.RemoteException
- when there was an rmi exception.public void errorCallback(LLRPRuntimeException e, java.lang.String readerName) throws java.rmi.RemoteException
Adaptor
errorCallback
in interface Adaptor
e
- the exception that has been reported.readerName
- the name of the reader where the error occured.
java.rmi.RemoteException
- whenver there is an error on transport level (rmi).public Reader getReader(java.lang.String readerName) throws java.rmi.RemoteException
Adaptor
getReader
in interface Adaptor
readerName
- the name of the requested reader.
java.rmi.RemoteException
- when there was an rmi exception.public void setAdaptorName(java.lang.String adaptorName) throws java.rmi.RemoteException
Adaptor
setAdaptorName
in interface Adaptor
adaptorName
- the name of the adaptor to set.
java.rmi.RemoteException
public void setAdaptorManagement(AdaptorManagement management)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |