public abstract class AbstractEBusMessage extends ENotificationMessage implements Serializable
ConnectionMessage and
ServerMessage classes. Defines the common notification
subject used for all eBus client messages.
Contains the remote TCP address and service port used by subclasses.
ConnectionMessage,
ServerMessage,
Serialized Form| Modifier and Type | Class and Description |
|---|---|
static class |
AbstractEBusMessage.Builder<M extends AbstractEBusMessage,B extends AbstractEBusMessage.Builder<M,?>>
Base class builder for
AbstractEBusMessage
builders. |
EMessage.MessageType| Modifier and Type | Field and Description |
|---|---|
static String |
EBUS_SUBJECT
"/eBus" is the subject used for all eBus
ConnectionMessage and ServerMessage
instances. |
InetSocketAddress |
remoteAddress
The client address referenced in this message.
|
int |
serverPort
A TCP service port number.
|
MAX_FIELDS| Modifier | Constructor and Description |
|---|---|
protected |
AbstractEBusMessage(AbstractEBusMessage.Builder builder) |
protected |
AbstractEBusMessage(InetSocketAddress addr,
int serverPort)
Creates a new eBus message instance with the subject set
to
EBUS_SUBJECT and the timestamp set to the
current time. |
protected |
AbstractEBusMessage(long timestamp,
InetSocketAddress addr,
int serverPort)
Creates a new eBus message instance with the subject set
to
EBUS_SUBJECT and the timestamp set to the
given time. |
protected |
AbstractEBusMessage(String subject,
long timestamp,
InetSocketAddress addr,
int serverPort)
Creates a new eBus client message instance for the given
message subject and timestamp.
|
| Modifier and Type | Method and Description |
|---|---|
String |
toString()
Returns the message as text.
|
equals, hashCode, isApplicationMessage, isSystemMessage, key, messageTypepublic static final String EBUS_SUBJECT
ConnectionMessage and ServerMessage
instances.
When subscribing for ConnectionMessage and
ServerMessage, always use the subject "/eBus".
public final InetSocketAddress remoteAddress
public final int serverPort
protected AbstractEBusMessage(InetSocketAddress addr, int serverPort)
EBUS_SUBJECT and the timestamp set to the
current time.addr - the remote eBus address.serverPort - connection is associated with this
EServer port; zero if not an accepted connection.NullPointerException - if addr is null.protected AbstractEBusMessage(long timestamp,
InetSocketAddress addr,
int serverPort)
EBUS_SUBJECT and the timestamp set to the
given time.timestamp - the notification timestamp.addr - the remote eBus address.serverPort - connection is associated with this
EServer port; zero if not an accepted connection.NullPointerException - if addr is null.protected AbstractEBusMessage(String subject, long timestamp, InetSocketAddress addr, int serverPort)
subject - the notification subject. Will always be
"/eBus".timestamp - the notification timestamp.addr - the remote eBus address.serverPort - connection is associated with this
EServer port; zero if not an accepted connection.NullPointerException - if addr is null.protected AbstractEBusMessage(AbstractEBusMessage.Builder builder)
Copyright © 2019. All rights reserved.