public interface ExceptionEventDatagram extends ImmutableEventDatagram, EventDatagramWithProperties
Title: Structured Data Objects
Description: General interface for Service Exception Objects.
Exception
implementation. In general they serve a dual purpose. When used as standard in-process
exceptions the exception objects behave like any normal exceptions.
When used in the context of a service that is executing in the StreamScape framework
the Exception Handler
mechanism will serialize the exception objects
to transportable data packets and post them to the Exchange. This allows observers
or remote trigger mechanisms to receive and process the exception object as though
they were thrown locally by the JVM.
Copyright: Copyright (c) 2010
Company: StreamScape Technologies
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
SEMANTIC_TYPE_NAME |
DEFAULT_SERIAL_VERSION_ID
Modifier and Type | Method and Description |
---|---|
boolean |
canConvertEventProperty(java.lang.String propertyName,
PropertyType propertyType)
Checks if the value of the specified property can be converted to the object of the specified type.
|
void |
clearEventProperties()
Clears all the properties.
|
boolean |
existsEventProperty(java.lang.String name)
Checks if the property with the specified name exists.
|
java.lang.String |
getCorrelationId()
Returns a string version of the correlation identifier.
|
byte[] |
getCorrelationIdAsBytes()
Returns the correlation identifier as a byte array.
|
int |
getErrorCode()
Returns an error code of the exception.
|
java.lang.String |
getErrorCodeAsString()
Returns an error code of the exception as a string.
|
java.lang.String |
getErrorMessage()
Returns an error message of the exception.
|
java.math.BigDecimal |
getEventBigDecimalProperty(java.lang.String name)
Returns the value of the
BigDecimal property with the specified name. |
boolean |
getEventBooleanProperty(java.lang.String name)
Returns the value of the
Boolean property with the specified name. |
byte |
getEventByteProperty(java.lang.String name)
Returns the value of the
Byte property with the specified name. |
double |
getEventDoubleProperty(java.lang.String name)
Returns the value of the
Double property with the specified name. |
float |
getEventFloatProperty(java.lang.String name)
Returns the value of the
Float property with the specified name. |
int |
getEventIntProperty(java.lang.String name)
Returns the value of the
Integer property with the specified name. |
long |
getEventLongProperty(java.lang.String name)
Returns the value of the
Long property with the specified name. |
java.lang.Object |
getEventObjectProperty(java.lang.String name)
Returns the value of the
Object property with the specified name. |
java.util.Set |
getEventPropertyNames()
Returns a list of existing property names.
|
PropertyType |
getEventPropertyType(java.lang.String propertyName)
Returns the type of the event property with the specified name.
|
short |
getEventShortProperty(java.lang.String name)
Returns the value of the
Short property with the specified name. |
byte[] |
getEventSink()
Returns the event sink address of this exception as a byte array.
|
java.lang.String |
getEventStringProperty(java.lang.String name)
Returns the value of the
String property with the specified name. |
java.lang.String |
getReplyTo()
Returns the
Event Identifier that an event consumer may use to send a
reply or acknowledgement on. |
Severity |
getSeverity()
Returns a severity of the exception.
|
void |
removeEventProperty(java.lang.String name)
Removes the event property with the specified name.
|
void |
resetReplyTo()
Sets the event
replyTo parameter to null . |
void |
setCorrelationId(java.lang.String correlationId)
Sets the optional correlation identifier.
|
void |
setCorrelationIdAsBytes(byte[] correlationId)
Sets the optional correlation identifier as a byte array.
|
void |
setErrorCode(int code)
Sets an error code of the exception.
|
void |
setEventBigDecimalProperty(java.lang.String name,
java.math.BigDecimal value)
Sets the specified value of a
BigDecimal property with the specified name. |
void |
setEventBigDecimalProperty(java.lang.String name,
int precision,
int scale)
Sets a template value of a
BigDecimal property with the specified name. |
void |
setEventBooleanProperty(java.lang.String name,
boolean value)
Sets the specified value of a
Boolean property with the specified name. |
void |
setEventByteProperty(java.lang.String name,
byte value)
Sets the specified value of a
Byte property with the specified name. |
void |
setEventDoubleProperty(java.lang.String name,
double value)
Sets the specified value of a
Double property with the specified name. |
void |
setEventFloatProperty(java.lang.String name,
float value)
Sets the specified value of a
Float property with the specified name. |
void |
setEventGroupId(java.lang.String group)
Sets the optional field that allows developers to group this event with others
of a similar type or within a sequence.
|
void |
setEventIntProperty(java.lang.String name,
int value)
Sets the specified value of a
Integer property with the specified name. |
void |
setEventKey(java.lang.String key)
Sets an optional field that uniquely identifies this event type instance.
|
void |
setEventLongProperty(java.lang.String name,
long value)
Sets the specified value of a
Long property with the specified name. |
void |
setEventObjectProperty(java.lang.String name,
java.lang.Object value)
Sets a user defined property for this event datagram.
|
void |
setEventShortProperty(java.lang.String name,
short value)
Sets the specified value of a
Short property with the specified name. |
void |
setEventSink(byte[] eventSink)
Sets the event sink address of this exception as a byte array.
|
void |
setEventStringProperty(java.lang.String name,
java.lang.String value)
Sets the specified value of a
String property with the specified name. |
void |
setReplyTo(java.lang.String eventId)
Sets the
Event Identifier that an event consumer may use to send a
reply or acknowledgement on. |
void |
setSeverity(Severity severity)
Sets a severity of the exception.
|
clone, getDurable, getEventGroupId, getEventId, getEventKey, getEventSource, getTimestamp, getTransmitAccess
getSerialVersionUID
static final java.lang.String SEMANTIC_TYPE_NAME
void setEventKey(java.lang.String key)
key
- the event key to be set.SDORuntimeException
- if the event is coalesced (locked for editing).void setEventGroupId(java.lang.String group)
SDORuntimeException
- if the event is coalesced (locked for editing).java.lang.String getCorrelationId()
byte[] getCorrelationIdAsBytes()
void setCorrelationId(java.lang.String correlationId)
correlationId
- the event correlation identifier to be set.SDORuntimeException
- if the event is coalesced (locked for editing).void setCorrelationIdAsBytes(byte[] correlationId)
correlationId
- the event correlation identifier to be set.SDORuntimeException
- if the event is coalesced (locked for editing).void setErrorCode(int code)
code
- the error code to be set.SDORuntimeException
- if the event is coalesced (locked for editing).int getErrorCode()
java.lang.String getErrorCodeAsString()
void setSeverity(Severity severity)
severity
- the severity to be set.SDORuntimeException
- if the event is coalesced (locked for editing).Severity getSeverity()
java.lang.String getErrorMessage()
void setReplyTo(java.lang.String eventId) throws SDOFormatException
Event Identifier
that an event consumer may use to send a
reply or acknowledgement on.
The Exchange uses this field to create acknowledgement events.
This setting may not be changed after the event is raised.eventId
- the event identifier to be set.SDORuntimeException
- if the event is coalesced (locked for editing).SDOFormatException
- if the specified event identifier has invalid format.java.lang.String getReplyTo()
Event Identifier
that an event consumer may use to send a
reply or acknowledgement on.replyTo
event parameter.void resetReplyTo()
replyTo
parameter to null
.SDORuntimeException
- if the event is coalesced (locked for editing).byte[] getEventSink()
ImmutableEventDatagram.getEventSource()
) is set to event sink of the exception in the corresponding event listener).
See ExceptionDatagramFactory.createEvent(String, ImmutableEventDatagram)
.
void setEventSink(byte[] eventSink)
getEventSink()
.eventSink
- the event sink to be set.SDORuntimeException
- if the event is coalesced (locked for editing).java.lang.Object getEventObjectProperty(java.lang.String name) throws SDOException
Object
property with the specified name.getEventObjectProperty
in interface EventDatagramWithProperties
name
- the specified property name.null
if the property with the specified name is not found.SDOException
- if the specified name has invalid format.boolean getEventBooleanProperty(java.lang.String name) throws SDOException
Boolean
property with the specified name.getEventBooleanProperty
in interface EventDatagramWithProperties
name
- the specified property name.Boolean
property.SDOException
- if the specified name has invalid format or
if the Boolean
property with the specified name is not found.byte getEventByteProperty(java.lang.String name) throws SDOException
Byte
property with the specified name.getEventByteProperty
in interface EventDatagramWithProperties
name
- the specified property name.Byte
property.SDOException
- if the specified name has invalid format or
if the Byte
property with the specified name is not found.short getEventShortProperty(java.lang.String name) throws SDOException
Short
property with the specified name.getEventShortProperty
in interface EventDatagramWithProperties
name
- the specified property name.Short
property.SDOException
- if the specified name has invalid format or
if the Short
property with the specified name is not found.int getEventIntProperty(java.lang.String name) throws SDOException
Integer
property with the specified name.getEventIntProperty
in interface EventDatagramWithProperties
name
- the specified property name.Integer
property.SDOException
- if the specified name has invalid format or
if the Integer
property with the specified name is not found.long getEventLongProperty(java.lang.String name) throws SDOException
Long
property with the specified name.getEventLongProperty
in interface EventDatagramWithProperties
name
- the specified property name.Long
property.SDOException
- if the specified name has invalid format or
if the Long
property with the specified name is not found.float getEventFloatProperty(java.lang.String name) throws SDOException
Float
property with the specified name.getEventFloatProperty
in interface EventDatagramWithProperties
name
- the specified property name.Float
property.SDOException
- if the specified name has invalid format or
if the Float
property with the specified name is not found.double getEventDoubleProperty(java.lang.String name) throws SDOException
Double
property with the specified name.getEventDoubleProperty
in interface EventDatagramWithProperties
name
- the specified property name.Double
property.SDOException
- if the specified name has invalid format or
if the Double
property with the specified name is not found.java.math.BigDecimal getEventBigDecimalProperty(java.lang.String name) throws SDOException
BigDecimal
property with the specified name.getEventBigDecimalProperty
in interface EventDatagramWithProperties
name
- the specified property name.BigDecimal
property.SDOException
- if the specified name has invalid format or
if the BigDecimal
property with the specified name is not found.java.lang.String getEventStringProperty(java.lang.String name) throws SDOException
String
property with the specified name.getEventStringProperty
in interface EventDatagramWithProperties
name
- the specified property name.String
property.SDOException
- if the specified name has invalid format or
if the String
property with the specified name is not found.void setEventObjectProperty(java.lang.String name, java.lang.Object value) throws SDOException
Java Messaging Service
properties. This allows EventGrams to be routed and filtered by a variety
of technologies including SAX and XSLT processors.
If this event datagram has been created from a prototype (by method DatagramFactory.createEvent(String)
),
adding of new properties is not allowed. An exception will be thrown if the specified property does not exist.
Adding of new properties is allowed for uninitialized event datagram intended for a prototype creation
(such datagram can be created by methods like DatagramFactory.newEventInstance(String)
or
DatagramFactory.newEventInstanceFrom(String)
).
The following table describes allowable property type mapping capabilities:
+-------------+------------------------------------------------------------+ | | boolean byte short int long float double BigDecimal String | +------------ +------------------------------------------------------------+ | boolean | X X | | byte | X X X X X X | | short | X X X X X | | int | X X X X | | long | X X X | | float | X X X X | | double | X X X | | BigDecimal | X X | | String | X X X X X X X X X | +-------------+------------------------------------------------------------+The method only allows object versions of java primitive types to be set. Setting the property to
null
is not allowed.setEventObjectProperty
in interface EventDatagramWithProperties
name
- the property name to be set.value
- the property value to be set.SDORuntimeException
- if the event is coalesced (locked for editing).SDOException
- if the specified property does not exist and this event has been created from a prototype or
if some internal error occurs.void setEventBooleanProperty(java.lang.String name, boolean value) throws SDOException
Boolean
property with the specified name.setEventBooleanProperty
in interface EventDatagramWithProperties
name
- the property name to be set.value
- the property value to be set.SDORuntimeException
- if the event is coalesced (locked for editing).SDOException
- if the specified property does not exist and this event has been created from a prototype or
if some internal error occurs.void setEventByteProperty(java.lang.String name, byte value) throws SDOException
Byte
property with the specified name.setEventByteProperty
in interface EventDatagramWithProperties
name
- the property name to be set.value
- the property value to be set.SDORuntimeException
- if the event is coalesced (locked for editing).SDOException
- if the specified property does not exist and this event has been created from a prototype or
if some internal error occurs.void setEventShortProperty(java.lang.String name, short value) throws SDOException
Short
property with the specified name.setEventShortProperty
in interface EventDatagramWithProperties
name
- the property name to be set.value
- the property value to be set.SDORuntimeException
- if the event is coalesced (locked for editing).SDOException
- if the specified property does not exist (in a case if this event has been created from a prototype) or
if some internal error occurs.void setEventIntProperty(java.lang.String name, int value) throws SDOException
Integer
property with the specified name.setEventIntProperty
in interface EventDatagramWithProperties
name
- the property name to be set.value
- the property value to be set.SDORuntimeException
- if the event is coalesced (locked for editing).SDOException
- if the specified property does not exist and this event has been created from a prototype or
if some internal error occurs.void setEventLongProperty(java.lang.String name, long value) throws SDOException
Long
property with the specified name.setEventLongProperty
in interface EventDatagramWithProperties
name
- the property name to be set.value
- the property value to be set.SDORuntimeException
- if the event is coalesced (locked for editing).SDOException
- if the specified property does not exist and this event has been created from a prototype or
if some internal error occurs.void setEventFloatProperty(java.lang.String name, float value) throws SDOException
Float
property with the specified name.setEventFloatProperty
in interface EventDatagramWithProperties
name
- the property name to be set.value
- the property value to be set.SDORuntimeException
- if the event is coalesced (locked for editing).SDOException
- if the specified property does not exist and this event has been created from a prototype or
if some internal error occurs.void setEventDoubleProperty(java.lang.String name, double value) throws SDOException
Double
property with the specified name.setEventDoubleProperty
in interface EventDatagramWithProperties
name
- the property name to be set.value
- the property value to be set.SDORuntimeException
- if the event is coalesced (locked for editing).SDOException
- if the specified property does not exist and this event has been created from a prototype or
if some internal error occurs.void setEventBigDecimalProperty(java.lang.String name, java.math.BigDecimal value) throws SDOException
BigDecimal
property with the specified name.
This property in an event prototype is used as a template for all event instances based on this prototype.
All values set by this method will be converted in accordance with the template value
(e.g. precision and scale will be taken from the template value).
If a template value is 0
it is treated as a value with precision 128
and scale 0
.
setEventBigDecimalProperty
in interface EventDatagramWithProperties
name
- the property name to be set.value
- the property value to be set.SDORuntimeException
- if the event is coalesced (locked for editing).SDOException
- if the specified property does not exist and this event has been created from a prototype or
if some internal error occurs.void setEventBigDecimalProperty(java.lang.String name, int precision, int scale) throws SDOException
BigDecimal
property with the specified name.
BigDecimal
value with the specified precision and scale filling it with '9' digits.
E.g. setEventBigDecimalProperty("example", 10, 3)
makes the property "example" with value -9999999.999
.
This method is applicable only if this datagram is an event prototype.
It is used for defining a template property in an event prototype (see setEventBigDecimalProperty(String, java.math.BigDecimal)
)
for further information).
setEventBigDecimalProperty
in interface EventDatagramWithProperties
name
- the property name to be set.precision
- the precision to be set.scale
- the scale to be set.SDORuntimeException
- if the event is coalesced (locked for editing).SDOException
- if this event is not an event prototype or
if precision is not a positive number or
if scale is negative number or
if some internal error occurs.void setEventStringProperty(java.lang.String name, java.lang.String value) throws SDOException
String
property with the specified name.setEventStringProperty
in interface EventDatagramWithProperties
name
- the property name to be set.value
- the property value to be set.SDORuntimeException
- if the event is coalesced (locked for editing).SDOException
- if the specified property does not exist and this event has been created from a prototype or
if some internal error occurs.void removeEventProperty(java.lang.String name) throws SDOException
If this event datagram has been created from a prototype (by method DatagramFactory.createEvent(String)
),
removing of existing properties is not allowed. An exception will be thrown if the specified property exists.
Removing of existing properties is allowed for uninitialized event datagram intended for a prototype creation
(such datagram can be created by methods like DatagramFactory.newEventInstance(String)
or
DatagramFactory.newEventInstanceFrom(String)
).
removeEventProperty
in interface EventDatagramWithProperties
name
- the name of the property to be removed.SDORuntimeException
- if the event is coalesced (locked for editing).SDOException
- if the specified name has invalid format or
if the specified property is an annotated property or
if the specified property exists and this event has been created from a prototype or
if some internal error occurs.boolean existsEventProperty(java.lang.String name) throws SDOException
existsEventProperty
in interface EventDatagramWithProperties
name
- the name of the property to be checked.true
if the specified property exists, false
otherwise.SDOException
- if the specified name has invalid format.java.util.Set getEventPropertyNames()
getEventPropertyNames
in interface EventDatagramWithProperties
void clearEventProperties()
clearEventProperties
in interface EventDatagramWithProperties
SDORuntimeException
- if the event is coalesced (locked for editing).PropertyType getEventPropertyType(java.lang.String propertyName) throws SDOException
getEventPropertyType
in interface EventDatagramWithProperties
propertyName
- the specified property name.null
if the property with the specified name is not found.SDOException
- if the specified name has invalid format.boolean canConvertEventProperty(java.lang.String propertyName, PropertyType propertyType) throws SDOException
canConvertEventProperty
in interface EventDatagramWithProperties
propertyName
- the name of the property to be checked.propertyType
- the specified property type.true
if the specified property value can be converted to specified type instance, false
otherwise.SDOException
- if the specified name has invalid format.Copyright © 2015-2024 StreamScape Technologies. All rights reserved.