public final class RejectionEnvelope extends AbstractMessageEnvelope<io.spine.core.EventId,io.spine.core.Event,io.spine.core.EventContext> implements SignalEnvelope<io.spine.core.EventId,io.spine.core.Event,io.spine.core.EventContext>
Event
which provides convenient access to its properties.Modifier and Type | Method and Description |
---|---|
io.spine.core.EventContext |
context()
Obtains the context of the message.
|
static RejectionEnvelope |
from(CommandEnvelope origin,
java.lang.Throwable throwable)
Creates an instance of
Rejection from the rejected command and a Throwable
caused by the ThrowableMessage . |
static RejectionEnvelope |
from(EventEnvelope event)
Creates a new
RejectionEnvelope from the given event. |
EventEnvelope |
getEvent() |
io.spine.core.Command |
getOrigin()
Obtains the origin command.
|
io.spine.base.CommandMessage |
getOriginMessage()
Obtains the origin command message.
|
io.spine.core.EventId |
id()
The ID of the message.
|
io.spine.base.RejectionMessage |
message()
Obtains the message.
|
EventClass |
messageClass()
Obtains the message class.
|
io.spine.core.TenantId |
tenantId()
Obtains ID of the tenant in which context the actor works.
|
equals, hashCode, outerObject, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
actorContext, asMessageOrigin, messageId
outerObject
public static RejectionEnvelope from(EventEnvelope event)
RejectionEnvelope
from the given event.
Throws an IllegalArgumentException
if the given event is not a rejection.
event
- the rejection eventpublic static RejectionEnvelope from(CommandEnvelope origin, java.lang.Throwable throwable)
Rejection
from the rejected command and a Throwable
caused by the ThrowableMessage
.
If the producer is not set, uses
the RejectionEnvelope.DEFAULT_EVENT_PRODUCER
as the producer.
origin
- the rejected commandthrowable
- the caught errorRejection
java.lang.IllegalArgumentException
- if the given Throwable
is not caused by
a ThrowableMessage
public io.spine.core.TenantId tenantId()
SignalEnvelope
tenantId
in interface SignalEnvelope<io.spine.core.EventId,io.spine.core.Event,io.spine.core.EventContext>
public io.spine.core.EventId id()
MessageEnvelope
id
in interface MessageEnvelope<io.spine.core.EventId,io.spine.core.Event,io.spine.core.EventContext>
public io.spine.base.RejectionMessage message()
MessageEnvelope
message
in interface MessageEnvelope<io.spine.core.EventId,io.spine.core.Event,io.spine.core.EventContext>
public EventClass messageClass()
MessageEnvelope
messageClass
in interface MessageEnvelope<io.spine.core.EventId,io.spine.core.Event,io.spine.core.EventContext>
public io.spine.core.EventContext context()
MessageEnvelope
context
in interface MessageEnvelope<io.spine.core.EventId,io.spine.core.Event,io.spine.core.EventContext>
public EventEnvelope getEvent()
public io.spine.core.Command getOrigin()
public io.spine.base.CommandMessage getOriginMessage()