1 package org.opentrafficsim.sim0mq.publisher;
2
3 /**
4 * Interface for handlers of incoming data and commands that are not directly processed by the Publisher.
5 * <p>
6 * Copyright (c) 2021-2020=1 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
7 * <br>
8 * BSD-style license. See <a href="https://opentrafficsim.org/docs/license.html">OpenTrafficSim License</a>.
9 * </p>
10 * @author <a href="https://github.com/averbraeck">Alexander Verbraeck</a>
11 * @author <a href="https://tudelft.nl/staff/p.knoppers-1">Peter Knoppers</a>
12 */
13 public interface IncomingDataHandler
14 {
15 /**
16 * Obtain a descriptive name of the IncomingDataHandler.
17 * @return String; a descriptive name of the IncomingDataHandler
18 */
19 String getId();
20
21 /**
22 * Obtain the key that is used to identify incoming data destined for this IncomingDataHandler, (this key should appear in
23 * field 5 of the Sim0MQ messages).
24 * @return String; the key that identify incoming data destined for this IncomingDataHandler
25 */
26 String getKey();
27
28 /**
29 * Process incoming data.
30 * @param decodedMessage Object[]; decoded Sim0MQMessages that has been converted by the createObjectArray method
31 * @return String; null on success, nonNull on failure to handle the data
32 */
33 String handleIncomingData(Object[] decodedMessage);
34
35 }