Signal

public interface Signal<I extends SignalId, M extends KnownMessage, C extends MessageContext> implements WithActor, WithTime

A message which can be dispatched and cause other messages.

A signal message travels through the system just like an electronic signal travels through a neural network. It cases the system to change its state either directly or by exciting other signals.

A signal message may originate from outside the system, from a user, or from a policy implemented in the system.

Parameters

<I>

the type of the signal identifier

<M>

the type of the enclosed messages

<C>

the type of the message context

Functions

Link copied to clipboard
public Origin asMessageOrigin()
Obtains this signal as an origin of other signals.
Link copied to clipboard
public C context()
Obtains the context of the enclosed message.
Link copied to clipboard
public M enclosedMessage()
Obtains the unpacked form of the enclosed message.
Link copied to clipboard
public TypeUrl enclosedTypeUrl()
Obtains the type URL of the enclosed message.
Link copied to clipboard
public abstract C getContext()
Obtains the context of the enclosed message.
Link copied to clipboard
public abstract I getId()
Obtains the identifier of the message.
Link copied to clipboard
public abstract Any getMessage()
Obtains the packed version of the enclosed message.
Link copied to clipboard
public I id()
Obtains the identifier of the message.
Link copied to clipboard
public Builder identityBuilder()
Creates the builder for identity of the message, by supplying the ID and the type URL of the enclosed message.
Link copied to clipboard
public boolean is(Class<? extends Message> enclosedMessageClass)
Verifies if the enclosed message has the same type as the passed, or the passed type is the super-type of the message.
Link copied to clipboard
public MessageId messageId()
Obtains the ID of this message.
Link copied to clipboard
public abstract Optional<Origin> origin()
Obtains the origin of this signal.
Link copied to clipboard
public Optional<MessageId> parent()
Link copied to clipboard
public abstract MessageId rootMessage()
Obtains the ID of the first message in the chain.
Link copied to clipboard
public Class<? extends M> type()
Obtains the type of the signal as the type of the enclosedMessage.

Inherited functions

Link copied to clipboard
public UserId actor()
The ID of the associated user.
Link copied to clipboard
public abstract ActorContext actorContext()
The context of the associated user.
Link copied to clipboard
public Instant instant()
Obtains the associated time point as Instant.
Link copied to clipboard
public boolean isAfter(Timestamp bound)
Verifies if associated time is after the passed point in time.
Link copied to clipboard
public boolean isBefore(Timestamp bound)
Verifies if the associated time is before the passed point in time.
Link copied to clipboard
public boolean isBetween(Timestamp periodStart, Timestamp periodEnd)
Verifies if the associated time point is within the passed period of time.
Link copied to clipboard
Obtains the local date of the instant associated time point}.
Link copied to clipboard
Obtains the local date and time of the instant associated time point}.
Link copied to clipboard
public TenantId tenant()
Obtains the ID of the tenant under which the message was created.
Link copied to clipboard
public abstract Timestamp timestamp()
Obtains the point in time associated with the object.