public class FS4FederateKilledMessage extends Sim0MQMessage
Copyright (c) 2016-2019 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See Sim0MQ License.
Modifier and Type | Class and Description |
---|---|
static class |
FS4FederateKilledMessage.Builder
Builder for the FederateStarted Message.
|
VERSION
Constructor and Description |
---|
FS4FederateKilledMessage(Object simulationRunId,
Object senderId,
Object receiverId,
long messageId,
String instanceId,
boolean status,
String error) |
Modifier and Type | Method and Description |
---|---|
byte[] |
createByteArray()
Create a byte array of the fields.
|
static FS4FederateKilledMessage |
createMessage(Object[] fields,
Object intendedReceiverId)
Build a message from an Object[] that was received.
|
Object[] |
createObjectArray()
Create a Sim0MQ object array of the fields.
|
String |
getError() |
String |
getInstanceId() |
static String |
getMessageType() |
short |
getNumberOfPayloadFields()
Get the number of payload fields in the message.
|
boolean |
isStatus() |
check, getMagicNumber, getMessageId, getMessageStatus, getMessageTypeId, getReceiverId, getSenderId, getSimulationRunId
public FS4FederateKilledMessage(Object simulationRunId, Object senderId, Object receiverId, long messageId, String instanceId, boolean status, String error) throws Sim0MQException, NullPointerException
simulationRunId
- the Simulation run ids can be provided in different types. Examples are two 64-bit longs
indicating a UUID, or a String with a UUID number, a String with meaningful identification, or a short or an
int with a simulation run number.senderId
- The sender id can be used to send back a message to the sender at some later time.receiverId
- The receiver id can be used to check whether the message is meant for us, or should be discarded (or an
error can be sent if we receive a message not meant for us).messageId
- The unique message number is meant to confirm with a callback that the message has been received
correctly. The number is unique for the sender, so not globally within the federation.instanceId
- The sender id of the model that was started or had an error while starting. This is exactly the same as
the instanceId sent by the Federation Manager in the StartFederate message.status
- Did the termination of the model succeed?error
- If there was an error with the model termination, the error message is sent as well. Otherwise this field is
an empty string.Sim0MQException
- on unknown data typeNullPointerException
- when one of the parameters is nullpublic String getInstanceId()
public boolean isStatus()
public String getError()
public static final String getMessageType()
public short getNumberOfPayloadFields()
getNumberOfPayloadFields
in class Sim0MQMessage
public Object[] createObjectArray()
createObjectArray
in class Sim0MQMessage
public byte[] createByteArray() throws Sim0MQException, org.djutils.serialization.SerializationException
createByteArray
in class Sim0MQMessage
Sim0MQException
- on unknown data type as part of the contentorg.djutils.serialization.SerializationException
- when the byte array cannot be created, e.g. because the number of bytes does not matchpublic static FS4FederateKilledMessage createMessage(Object[] fields, Object intendedReceiverId) throws Sim0MQException
fields
- Object[]; the fields in the messageintendedReceiverId
- id of the intended receiverSim0MQException
- when number of fields is not correctCopyright © 2016–2019 Delft University of Technology. All rights reserved.