Interface TransceiverInterface
- All Superinterfaces:
org.djutils.base.Identifiable
- All Known Implementing Classes:
AbstractEventTransceiver
,AbstractIdTransceiver
,AbstractTransceiver
,CrossSectionElementTransceiver
,GtuIdTransceiver
,GtuTransceiver
,LaneGtuIdTransceiver
,LinkGtuIdTransceiver
,LinkIdTransceiver
,LinkTransceiver
,NodeIdTransceiver
,NodeTransceiver
,Publisher
,SimulatorStateTransceiver
public interface TransceiverInterface
extends org.djutils.base.Identifiable
Transceivers with machine interpretable description of address and result types. A transceiver converts DSOL events to Sim0MQ
messages and Sim0MQ messages to DJUTILS event (un-)subscriptions, or DSOL events.
Copyright (c) 2020-2024 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.
- Author:
- Alexander Verbraeck, Peter Knoppers
-
Method Summary
Modifier and TypeMethodDescriptionObject[]
get
(Object[] address, ReturnWrapper returnWrapper) Retrieve the data.org.djutils.metadata.MetaData
Specification of arguments needed in a request.default TransceiverInterface
getIdSource
(int addressLevel, ReturnWrapper returnWrapper) Retrieve the TransceiverInterface that can be used to get detailed information about a single object.org.djutils.metadata.MetaData
Report the specification of a result of the transceiver.default boolean
Report if this transceiver has an id source.Methods inherited from interface org.djutils.base.Identifiable
getId
-
Method Details
-
getAddressFields
org.djutils.metadata.MetaData getAddressFields()Specification of arguments needed in a request.- Returns:
- MetaData; the specification of arguments needed in a request
-
getIdSource
default TransceiverInterface getIdSource(int addressLevel, ReturnWrapper returnWrapper) throws org.sim0mq.Sim0MQException, org.djutils.serialization.SerializationException Retrieve the TransceiverInterface that can be used to get detailed information about a single object.- Parameters:
addressLevel
- int; index of the argument in the address fieldsreturnWrapper
- ReturnWrapper; to be used to report problems- Returns:
- TransceiverInterface; to be used to get valid values for argument
addressLevel
, or null if valid values for the argument at indexaddressLevel
can not be obtained through a TransceiverInterface object - Throws:
org.djutils.serialization.SerializationException
- when the ReturnWrapper failsorg.sim0mq.Sim0MQException
- when the ReturnWrapper fails
-
hasIdSource
default boolean hasIdSource()Report if this transceiver has an id source.- Returns:
- boolean; true if this transceiver has an id source; false if this transceiver does not have an id source
-
getResultFields
org.djutils.metadata.MetaData getResultFields()Report the specification of a result of the transceiver.- Returns:
- MetaData; the specification of a result from the transceiver
-
get
Object[] get(Object[] address, ReturnWrapper returnWrapper) throws RemoteException, org.sim0mq.Sim0MQException, org.djutils.serialization.SerializationException Retrieve the data.- Parameters:
address
- Object[]; the address of the data to retrievereturnWrapper
- ReturnWrapper; to be used to report problems- Returns:
- Object[]; the retrieved data, or null when no object with the address could be found
- Throws:
RemoteException
- when communication needed to retrieve the data failedorg.djutils.serialization.SerializationException
- when encoding an error message failsorg.sim0mq.Sim0MQException
- when encoding an error message fails
-