public class DiscoveredDeviceAdminMessage extends AbstractAdminMessage
CLASSIFIER_ADD_SUBSCRIPTION, CLASSIFIER_BOW_DOWN_TO_NEW_KING, CLASSIFIER_CENSUS_MESSAGE, CLASSIFIER_CLOSE_SERVER_CONNECTION, CLASSIFIER_DISCOVERED_DEVICE, CLASSIFIER_FINISHED_HANDSHAKE, CLASSIFIER_KEEP_ALIVE_MESSAGE, CLASSIFIER_NEW_PRINCE_MESSAGE, CLASSIFIER_PRINCE_ACK, CLASSIFIER_PRINCE_FOUND_A_KING_MESSAGE, CLASSIFIER_REMOVE_SUBSCRIPTION, CLASSIFIER_SERVER_CONNECTION_AVAILABLE, CLASSIFIER_SERVER_CONNECTION_DOWN, CLASSIFIER_SERVER_CONNECTION_RELAY_PAYLOAD, CLASSIFIER_STRING_MESSAGE, gson, HEADER_LENGTH| Constructor and Description |
|---|
DiscoveredDeviceAdminMessage(AbstractBlaubotDeviceDiscoveryEvent deviceDiscoveryEvent)
Creates a message to dispatch a DeviceDiscoveryEvent to another device.
|
DiscoveredDeviceAdminMessage(BlaubotMessage rawMessage) |
DiscoveredDeviceAdminMessage(java.lang.String uniqueDeviceId,
State state,
java.util.List<ConnectionMetaDataDTO> connectionMetaDataList)
Creates a message to dispatch a DeviceDiscoveryEvent to another device.
|
| Modifier and Type | Method and Description |
|---|---|
AbstractBlaubotDeviceDiscoveryEvent |
createDiscoveryEvent()
Creates a new discovery event based on this message
|
boolean |
equals(java.lang.Object o) |
java.lang.String |
getUniqueDeviceId() |
int |
hashCode() |
protected byte[] |
payloadToBytes()
Gets this message's byte representation (NOT including the classifier)
|
protected void |
setUpFromBytes(java.nio.ByteBuffer messagePayloadAsBytes)
Should set the message's attributes based on the message's payload.
|
java.lang.String |
toString() |
classifierAndPayloadBytes, getClassifier, setClassifier, toBlaubotMessagepublic DiscoveredDeviceAdminMessage(java.lang.String uniqueDeviceId,
State state,
java.util.List<ConnectionMetaDataDTO> connectionMetaDataList)
uniqueDeviceId - the uniqueDeviceId of the device that was discoveredstate - the state of the discovered deviceconnectionMetaDataList - the connection meta data of the just discovered devicepublic DiscoveredDeviceAdminMessage(AbstractBlaubotDeviceDiscoveryEvent deviceDiscoveryEvent)
deviceDiscoveryEvent - a device discovery event to be dispatchedpublic DiscoveredDeviceAdminMessage(BlaubotMessage rawMessage)
protected byte[] payloadToBytes()
AbstractAdminMessagepayloadToBytes in class AbstractAdminMessagepublic AbstractBlaubotDeviceDiscoveryEvent createDiscoveryEvent()
protected void setUpFromBytes(java.nio.ByteBuffer messagePayloadAsBytes)
AbstractAdminMessageByteBuffer contains the classifier bytes but it's current
index will be set beyond that.setUpFromBytes in class AbstractAdminMessagemessagePayloadAsBytes - a ByteBuffer wrapped around the message's payload with it's current index set beyond the classifier bytespublic java.lang.String getUniqueDeviceId()
public java.lang.String toString()
toString in class java.lang.Objectpublic boolean equals(java.lang.Object o)
equals in class AbstractAdminMessagepublic int hashCode()
hashCode in class AbstractAdminMessage