Package COM.activesw.api.client
Class ReflectEvent
- java.lang.Object
-
- COM.activesw.api.client.ReflectEvent
-
public class ReflectEvent extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description static int
AUTO_SIZE
static int
ENTIRE_SEQUENCE
-
Constructor Summary
Constructors Constructor Description ReflectEvent(BrokerClient client, BrokerTypeDef brokerDef, java.lang.Class cls)
ReflectEvent(ReflectEvent event)
ReflectEvent(java.lang.Class cls)
ReflectEvent(java.lang.Object obj)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clear()
Clears all fields of the event so it can be re-used.void
clearField(java.lang.String fieldName)
Clear (un-set) a field in the event.static void
eventToObject(BrokerEvent brokerEvent, java.lang.Object objectEvent)
static ReflectEvent
fromBinData(BrokerClient client, byte[] data, java.lang.Class cls)
Create an event using a byte array given out by toBinData().void
fromBrokerEvent(BrokerEvent brokerEvent)
boolean
getBooleanField(java.lang.String fieldName)
Get the value of a boolean field.boolean[]
getBooleanSeqField(java.lang.String fieldName, int offset, int maxN)
Get the value of a boolean sequence field.byte
getByteField(java.lang.String fieldName)
Get the value of a byte field.byte[]
getByteSeqField(java.lang.String fieldName, int offset, int maxN)
Get the value of a byte sequence field.char
getCharField(java.lang.String fieldName)
Get the value of a char field.char[]
getCharSeqField(java.lang.String fieldName, int offset, int maxN)
Get the value of a char sequence field.BrokerDate
getDateField(java.lang.String fieldName)
Get the value of a date field.BrokerDate[]
getDateSeqField(java.lang.String fieldName, int offset, int maxN)
Get the value of a date sequence field.double
getDoubleField(java.lang.String fieldName)
Get the value of a double field.double[]
getDoubleSeqField(java.lang.String fieldName, int offset, int maxN)
Get the value of a double sequence field.long
getEventId()
Get the event ID (as set by the broker) for this event.BrokerField
getField(java.lang.String fieldName)
Get the value of field.java.lang.String[]
getFieldNames(java.lang.String fieldName)
Get the list of field names in an event.short
getFieldType(java.lang.String fieldName)
Gets the type for the specified field.float
getFloatField(java.lang.String fieldName)
Get the value of a float field.float[]
getFloatSeqField(java.lang.String fieldName, int offset, int maxN)
Get the value of a float sequence field.int
getIntegerField(java.lang.String fieldName)
Get the value of an integer field.int[]
getIntegerSeqField(java.lang.String fieldName, int offset, int maxN)
Get the value of an integer sequence field.long
getLongField(java.lang.String fieldName)
Get the value of a long field.long[]
getLongSeqField(java.lang.String fieldName, int offset, int maxN)
Get the value of a long sequence field.long
getPublishSequenceNumber()
Get the publishing sequence number for this event.long
getReceiptSequenceNumber()
Get the receipt sequence number (as set by the broker) for this event.BrokerField
getSequenceField(java.lang.String fieldName, int offset, int maxN)
Get the value of a sequence field.int
getSequenceFieldSize(java.lang.String fieldName)
Get the size of a sequence field.short
getShortField(java.lang.String fieldName)
Get the value of a short field.short[]
getShortSeqField(java.lang.String fieldName, int offset, int maxN)
Get the value of a short sequence field.java.lang.Object
getStorageObject()
java.lang.String
getStringField(java.lang.String fieldName)
Get the value of a string field.java.lang.String[]
getStringSeqField(java.lang.String fieldName, int offset, int maxN)
Get the value of a string sequence field.ReflectEvent
getStructFieldAsEvent(java.lang.String fieldName)
Get the value of a structure field.ReflectEvent[]
getStructSeqFieldAsEvents(java.lang.String fieldName, int offset, int maxN)
Get the value of a structure sequence field.int
getTag()
Get the event's 'tag' envelope field.ReflectTypeDef
getTypeDef()
Get the event's type definition.char
getUCCharField(java.lang.String fieldName)
Get the value of a unicode char field.char[]
getUCCharSeqField(java.lang.String fieldName, int offset, int maxN)
Get the value of a unicode char sequence field.java.lang.String
getUCStringField(java.lang.String fieldName)
Get the value of a unicode string field.java.lang.String[]
getUCStringSeqField(java.lang.String fieldName, int offset, int maxN)
Get the value of a unicode string sequence field.boolean
isFieldSet(java.lang.String fieldName)
Determine if the specified field is set in the event.static void
objectToEvent(java.lang.Object objectEvent, BrokerEvent brokerEvent)
void
setBooleanField(java.lang.String fieldName, boolean value)
Sets the value of a boolean field.void
setBooleanSeqField(java.lang.String fieldName, int srcOffset, int destOffset, int n, boolean[] value)
Sets the value of a subrange of a boolean sequence field.void
setByteField(java.lang.String fieldName, byte value)
Sets the value of a byte field.void
setByteSeqField(java.lang.String fieldName, int srcOffset, int destOffset, int n, byte[] value)
Sets the value of a subrange of a byte sequence field.void
setCharField(java.lang.String fieldName, char value)
Sets the value of a char field.void
setCharSeqField(java.lang.String fieldName, int srcOffset, int destOffset, int n, char[] value)
Sets the value of a subrange of a char sequence field.void
setDateField(java.lang.String fieldName, BrokerDate value)
Sets the value of a date field.void
setDateSeqField(java.lang.String fieldName, int srcOffset, int destOffset, int n, BrokerDate[] value)
Sets the value of a subrange of a date sequence field.void
setDoubleField(java.lang.String fieldName, double value)
Sets the value of a double field.void
setDoubleSeqField(java.lang.String fieldName, int srcOffset, int destOffset, int n, double[] value)
Sets the value of a subrange of a double sequence field.void
setField(java.lang.String fieldName, short fieldType, java.lang.Object value)
Sets the value of a field.void
setField(java.lang.String fieldName, BrokerField field)
Sets the value of a field.void
setFloatField(java.lang.String fieldName, float value)
Sets the value of a float field.void
setFloatSeqField(java.lang.String fieldName, int srcOffset, int destOffset, int n, float[] value)
Sets the value of a subrange of a float sequence field.void
setIntegerField(java.lang.String fieldName, int value)
Sets the value of an integer field.void
setIntegerSeqField(java.lang.String fieldName, int srcOffset, int destOffset, int n, int[] value)
Sets the value of a subrange of an integer sequence field.void
setLongField(java.lang.String fieldName, long value)
Sets the value of a long field.void
setLongSeqField(java.lang.String fieldName, int srcOffset, int destOffset, int n, long[] value)
Sets the value of a subrange of a long sequence field.void
setPublishSequenceNumber(long seqn)
Set the publishing sequence number for this event.void
setSequenceField(java.lang.String fieldName, short fieldType, int srcOffset, int destOffset, int n, java.lang.Object value)
Sets the value of a subrange of a sequence field.void
setSequenceFieldSize(java.lang.String fieldName, int size)
Set the size of a sequence field.void
setShortField(java.lang.String fieldName, short value)
Sets the value of a short field.void
setShortSeqField(java.lang.String fieldName, int srcOffset, int destOffset, int n, short[] value)
Sets the value of a subrange of a short sequence field.void
setStringField(java.lang.String fieldName, java.lang.String value)
Sets the value of a string field.void
setStringFieldToSubstring(java.lang.String fieldName, int offset, int nc, java.lang.String value)
Sets the value of a string field to a substring of another string.void
setStringSeqField(java.lang.String fieldName, int srcOffset, int destOffset, int n, java.lang.String[] value)
Sets the value of a subrange of a string sequence field.void
setStructFieldFromEvent(java.lang.String fieldName, ReflectEvent value)
Sets the value of a structure field.void
setStructSeqFieldFromEvents(java.lang.String fieldName, int srcOffset, int destOffset, int n, ReflectEvent[] value)
Sets the value of a structure sequence field.void
setTag(int tag)
Set the event's 'tag' envelope field.void
setUCCharField(java.lang.String fieldName, char value)
Sets the value of a unicode char field.void
setUCCharSeqField(java.lang.String fieldName, int srcOffset, int destOffset, int n, char[] value)
Sets the value of a subrange of a unicode char sequence field.void
setUCStringField(java.lang.String fieldName, java.lang.String value)
Sets the value of a unicode string field.void
setUCStringFieldToSubstring(java.lang.String fieldName, int offset, int nc, java.lang.String value)
Sets the value of a unicode string field to a substring of another string.void
setUCStringSeqField(java.lang.String fieldName, int srcOffset, int destOffset, int n, java.lang.String[] value)
Sets the value of a subrange of a unicode string sequence field.byte[]
toBinData()
Get out the event's data as a byte array.void
toBrokerEvent(BrokerEvent brokerEvent)
java.lang.String
toFormattedString(java.lang.String formatString)
Format an event string.java.lang.String
toFormattedString(java.lang.String formatString, java.util.Locale locale)
Format an event string.java.lang.String
toString()
Get event content as a string which includes newlines.java.lang.String
toString(int indentLevel)
Get event content as a string suitable for human viewing.java.lang.String
toString(int indentLevel, java.util.Locale locale)
Get event content as a string suitable for human viewing.java.lang.String
toString(java.util.Locale locale)
Get event content as a string which includes newlines.
-
-
-
Field Detail
-
ENTIRE_SEQUENCE
public static final int ENTIRE_SEQUENCE
- See Also:
- Constant Field Values
-
AUTO_SIZE
public static final int AUTO_SIZE
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ReflectEvent
public ReflectEvent(java.lang.Class cls) throws BrokerException
- Throws:
BrokerException
-
ReflectEvent
public ReflectEvent(BrokerClient client, BrokerTypeDef brokerDef, java.lang.Class cls) throws BrokerException
- Throws:
BrokerException
-
ReflectEvent
public ReflectEvent(java.lang.Object obj) throws BrokerException
- Throws:
BrokerException
-
ReflectEvent
public ReflectEvent(ReflectEvent event) throws BrokerException
- Throws:
BrokerException
-
-
Method Detail
-
getStorageObject
public java.lang.Object getStorageObject()
-
getEventId
public long getEventId()
Get the event ID (as set by the broker) for this event. Always zero if not received from the broker, or if the event was published by a client using a pre-3.0 release of the product.
-
fromBrokerEvent
public void fromBrokerEvent(BrokerEvent brokerEvent) throws BrokerException
- Throws:
BrokerException
-
toBrokerEvent
public void toBrokerEvent(BrokerEvent brokerEvent) throws BrokerException
- Throws:
BrokerException
-
objectToEvent
public static void objectToEvent(java.lang.Object objectEvent, BrokerEvent brokerEvent) throws BrokerException
- Throws:
BrokerException
-
eventToObject
public static void eventToObject(BrokerEvent brokerEvent, java.lang.Object objectEvent) throws BrokerException
- Throws:
BrokerException
-
getTypeDef
public ReflectTypeDef getTypeDef()
Get the event's type definition.
-
getPublishSequenceNumber
public long getPublishSequenceNumber()
Get the publishing sequence number for this event.
-
setPublishSequenceNumber
public void setPublishSequenceNumber(long seqn)
Set the publishing sequence number for this event. This is called prior to publishing an event. Zero (or not calling this) will always result in the event being sent. Non-zero events are discarded by the broker if they have a sequence number less than or equal to the highest number already processed by the broker for this client.
-
getReceiptSequenceNumber
public long getReceiptSequenceNumber()
Get the receipt sequence number (as set by the broker) for this event. Always zero if not received from the broker, or for events being stored volatile in the broker.
-
getFieldType
public short getFieldType(java.lang.String fieldName) throws BrokerException
Gets the type for the specified field. Sequence fields can use "[]" if it is the last part of the name on an event without a client, or always on events with a client.- Throws:
BrokerFieldNotFoundException
- If the field name does not exist in the event.BrokerFieldTypeMismatchException
- If the field name incorrectly accesses a type (such as using [2] on a non-sequence field).BrokerInvalidFieldNameException
- If the field name is not valid.BrokerNullParameterException
- If fieldName is null.BrokerException
-
setByteField
public void setByteField(java.lang.String fieldName, byte value) throws BrokerException
Sets the value of a byte field.- Throws:
BrokerFieldNotFoundException
- If the field name does not exist in the event.BrokerFieldTypeMismatchException
- If the field is not of the specified type or the name incorrectly accesses a type (such as using [2] on a non-sequence field).BrokerInvalidFieldNameException
- If the field name is not valid.BrokerNullParameterException
- If fieldName is null.BrokerException
-
setShortField
public void setShortField(java.lang.String fieldName, short value) throws BrokerException
Sets the value of a short field.- Throws:
BrokerFieldNotFoundException
- If the field name does not exist in the event.BrokerFieldTypeMismatchException
- If the field is not of the specified type or the name incorrectly accesses a type (such as using [2] on a non-sequence field).BrokerInvalidFieldNameException
- If the field name is not valid.BrokerNullParameterException
- If fieldName is null.BrokerException
-
setIntegerField
public void setIntegerField(java.lang.String fieldName, int value) throws BrokerException
Sets the value of an integer field.- Throws:
BrokerFieldNotFoundException
- If the field name does not exist in the event.BrokerFieldTypeMismatchException
- If the field is not of the specified type or the name incorrectly accesses a type (such as using [2] on a non-sequence field).BrokerInvalidFieldNameException
- If the field name is not valid.BrokerNullParameterException
- If fieldName is null.BrokerException
-
setLongField
public void setLongField(java.lang.String fieldName, long value) throws BrokerException
Sets the value of a long field.- Throws:
BrokerFieldNotFoundException
- If the field name does not exist in the event.BrokerFieldTypeMismatchException
- If the field is not of the specified type or the name incorrectly accesses a type (such as using [2] on a non-sequence field).BrokerInvalidFieldNameException
- If the field name is not valid.BrokerNullParameterException
- If fieldName is null.BrokerException
-
setFloatField
public void setFloatField(java.lang.String fieldName, float value) throws BrokerException
Sets the value of a float field.- Throws:
BrokerFieldNotFoundException
- If the field name does not exist in the event.BrokerFieldTypeMismatchException
- If the field is not of the specified type or the name incorrectly accesses a type (such as using [2] on a non-sequence field).BrokerInvalidFieldNameException
- If the field name is not valid.BrokerNullParameterException
- If fieldName is null.BrokerException
-
setDoubleField
public void setDoubleField(java.lang.String fieldName, double value) throws BrokerException
Sets the value of a double field.- Throws:
BrokerFieldNotFoundException
- If the field name does not exist in the event.BrokerFieldTypeMismatchException
- If the field is not of the specified type or the name incorrectly accesses a type (such as using [2] on a non-sequence field).BrokerInvalidFieldNameException
- If the field name is not valid.BrokerNullParameterException
- If fieldName is null.BrokerException
-
setBooleanField
public void setBooleanField(java.lang.String fieldName, boolean value) throws BrokerException
Sets the value of a boolean field.- Throws:
BrokerFieldNotFoundException
- If the field name does not exist in the event.BrokerFieldTypeMismatchException
- If the field is not of the specified type or the name incorrectly accesses a type (such as using [2] on a non-sequence field).BrokerInvalidFieldNameException
- If the field name is not valid.BrokerNullParameterException
- If fieldName is null.BrokerException
-
setDateField
public void setDateField(java.lang.String fieldName, BrokerDate value) throws BrokerException
Sets the value of a date field.- Throws:
BrokerFieldNotFoundException
- If the field name does not exist in the event.BrokerFieldTypeMismatchException
- If the field is not of the specified type or the name incorrectly accesses a type (such as using [2] on a non-sequence field).BrokerInvalidFieldNameException
- If the field name is not valid.BrokerNullParameterException
- If fieldName or value are null.BrokerException
-
setCharField
public void setCharField(java.lang.String fieldName, char value) throws BrokerException
Sets the value of a char field. Characters which do not map to ANSI/ISO-Latin-1 will become underscores ('_').- Throws:
BrokerFieldNotFoundException
- If the field name does not exist in the event.BrokerFieldTypeMismatchException
- If the field is not of the specified type or the name incorrectly accesses a type (such as using [2] on a non-sequence field).BrokerInvalidFieldNameException
- If the field name is not valid.BrokerNullParameterException
- If fieldName is null.BrokerException
-
setUCCharField
public void setUCCharField(java.lang.String fieldName, char value) throws BrokerException
Sets the value of a unicode char field.- Throws:
BrokerFieldNotFoundException
- If the field name does not exist in the event.BrokerFieldTypeMismatchException
- If the field is not of the specified type or the name incorrectly accesses a type (such as using [2] on a non-sequence field).BrokerInvalidFieldNameException
- If the field name is not valid.BrokerNullParameterException
- If fieldName is null.BrokerException
-
setStringField
public void setStringField(java.lang.String fieldName, java.lang.String value) throws BrokerException
Sets the value of a string field. Characters which do not map to ANSI/ISO-Latin-1 will become underscores ('_'). Can also be used to set the value of a unicode string field if your event is typechecked or the named field already is set to a unicode value.- Throws:
BrokerFieldNotFoundException
- If the field name does not exist in the event.BrokerFieldTypeMismatchException
- If the field is not of the specified type or the name incorrectly accesses a type (such as using [2] on a non-sequence field).BrokerInvalidFieldNameException
- If the field name is not valid.BrokerNullParameterException
- If fieldName or value are null.BrokerException
-
setUCStringField
public void setUCStringField(java.lang.String fieldName, java.lang.String value) throws BrokerException
Sets the value of a unicode string field.- Throws:
BrokerFieldNotFoundException
- If the field name does not exist in the event.BrokerFieldTypeMismatchException
- If the field is not of the specified type or the name incorrectly accesses a type (such as using [2] on a non-sequence field).BrokerInvalidFieldNameException
- If the field name is not valid.BrokerNullParameterException
- If fieldName or value are null.BrokerException
-
setStringFieldToSubstring
public void setStringFieldToSubstring(java.lang.String fieldName, int offset, int nc, java.lang.String value) throws BrokerException
Sets the value of a string field to a substring of another string. If nc is AUTO_SIZE (-1), take the rest of the string. Characters which do not map to ANSI/ISO-Latin-1 will become underscores ('_').- Throws:
BrokerFieldNotFoundException
- If the field name does not exist in the event.BrokerFieldTypeMismatchException
- If the field is not of the specified type or the name incorrectly accesses a type (such as using [2] on a non-sequence field).BrokerInvalidFieldNameException
- If the field name is not valid.BrokerNullParameterException
- If fieldName or value are null.BrokerOutOfRangeException
- If offset is not within the size of the string, or if nc would exceed the size of the string.BrokerException
-
setUCStringFieldToSubstring
public void setUCStringFieldToSubstring(java.lang.String fieldName, int offset, int nc, java.lang.String value) throws BrokerException
Sets the value of a unicode string field to a substring of another string. If nc is AUTO_SIZE (-1), take the rest of the string.- Throws:
BrokerFieldNotFoundException
- If the field name does not exist in the event.BrokerFieldTypeMismatchException
- If the field is not of the specified type or the name incorrectly accesses a type (such as using [2] on a non-sequence field).BrokerInvalidFieldNameException
- If the field name is not valid.BrokerNullParameterException
- If fieldName or value are null.BrokerOutOfRangeException
- If offset is not within the size of the string, or if nc would exceed the size of the string.BrokerException
-
setByteSeqField
public void setByteSeqField(java.lang.String fieldName, int srcOffset, int destOffset, int n, byte[] value) throws BrokerException
Sets the value of a subrange of a byte sequence field. The 'n' parameter can be set to AUTO_SIZE (-1) to use the actual array size. The 'destOffset' parameter can be set to ENTIRE_SEQUENCE (-1) to set the sequence size to the number of elements being set.- Throws:
BrokerFieldNotFoundException
- If the field name does not exist in the event.BrokerFieldTypeMismatchException
- If the field is not of the specified type or the name incorrectly accesses a type (such as using [2] on a non-sequence field).BrokerInvalidFieldNameException
- If the field name is not valid.BrokerNullParameterException
- If fieldName or value are null.BrokerOutOfRangeException
- If srcOffset is not within the size of the the passed in value, if destOffset is less than zero, or if n is less than -1.BrokerException
-
setShortSeqField
public void setShortSeqField(java.lang.String fieldName, int srcOffset, int destOffset, int n, short[] value) throws BrokerException
Sets the value of a subrange of a short sequence field. The 'n' parameter can be set to AUTO_SIZE (-1) to use the actual array size. The 'destOffset' parameter can be set to ENTIRE_SEQUENCE (-1) to set the sequence size to the number of elements being set.- Throws:
BrokerFieldNotFoundException
- If the field name does not exist in the event.BrokerFieldTypeMismatchException
- If the field is not of the specified type or the name incorrectly accesses a type (such as using [2] on a non-sequence field).BrokerInvalidFieldNameException
- If the field name is not valid.BrokerNullParameterException
- If fieldName or value are null.BrokerOutOfRangeException
- If srcOffset is not within the size of the the passed in value, if destOffset is less than zero, or if n is less than -1.BrokerException
-
setIntegerSeqField
public void setIntegerSeqField(java.lang.String fieldName, int srcOffset, int destOffset, int n, int[] value) throws BrokerException
Sets the value of a subrange of an integer sequence field. The 'n' parameter can be set to AUTO_SIZE (-1) to use the actual array size. The 'destOffset' parameter can be set to ENTIRE_SEQUENCE (-1) to set the sequence size to the number of elements being set.- Throws:
BrokerFieldNotFoundException
- If the field name does not exist in the event.BrokerFieldTypeMismatchException
- If the field is not of the specified type or the name incorrectly accesses a type (such as using [2] on a non-sequence field).BrokerInvalidFieldNameException
- If the field name is not valid.BrokerNullParameterException
- If fieldName or value are null.BrokerOutOfRangeException
- If srcOffset is not within the size of the the passed in value, if destOffset is less than zero, or if n is less than -1.BrokerException
-
setLongSeqField
public void setLongSeqField(java.lang.String fieldName, int srcOffset, int destOffset, int n, long[] value) throws BrokerException
Sets the value of a subrange of a long sequence field. The 'n' parameter can be set to AUTO_SIZE (-1) to use the actual array size. The 'destOffset' parameter can be set to ENTIRE_SEQUENCE (-1) to set the sequence size to the number of elements being set.- Throws:
BrokerFieldNotFoundException
- If the field name does not exist in the event.BrokerFieldTypeMismatchException
- If the field is not of the specified type or the name incorrectly accesses a type (such as using [2] on a non-sequence field).BrokerInvalidFieldNameException
- If the field name is not valid.BrokerNullParameterException
- If fieldName or value are null.BrokerOutOfRangeException
- If srcOffset is not within the size of the the passed in value, if destOffset is less than zero, or if n is less than -1.BrokerException
-
setFloatSeqField
public void setFloatSeqField(java.lang.String fieldName, int srcOffset, int destOffset, int n, float[] value) throws BrokerException
Sets the value of a subrange of a float sequence field. The 'n' parameter can be set to AUTO_SIZE (-1) to use the actual array size. The 'destOffset' parameter can be set to ENTIRE_SEQUENCE (-1) to set the sequence size to the number of elements being set.- Throws:
BrokerFieldNotFoundException
- If the field name does not exist in the event.BrokerFieldTypeMismatchException
- If the field is not of the specified type or the name incorrectly accesses a type (such as using [2] on a non-sequence field).BrokerInvalidFieldNameException
- If the field name is not valid.BrokerNullParameterException
- If fieldName or value are null.BrokerOutOfRangeException
- If srcOffset is not within the size of the the passed in value, if destOffset is less than zero, or if n is less than -1.BrokerException
-
setDoubleSeqField
public void setDoubleSeqField(java.lang.String fieldName, int srcOffset, int destOffset, int n, double[] value) throws BrokerException
Sets the value of a subrange of a double sequence field. The 'n' parameter can be set to AUTO_SIZE (-1) to use the actual array size. The 'destOffset' parameter can be set to ENTIRE_SEQUENCE (-1) to set the sequence size to the number of elements being set.- Throws:
BrokerFieldNotFoundException
- If the field name does not exist in the event.BrokerFieldTypeMismatchException
- If the field is not of the specified type or the name incorrectly accesses a type (such as using [2] on a non-sequence field).BrokerInvalidFieldNameException
- If the field name is not valid.BrokerNullParameterException
- If fieldName or value are null.BrokerOutOfRangeException
- If srcOffset is not within the size of the the passed in value, if destOffset is less than zero, or if n is less than -1.BrokerException
-
setBooleanSeqField
public void setBooleanSeqField(java.lang.String fieldName, int srcOffset, int destOffset, int n, boolean[] value) throws BrokerException
Sets the value of a subrange of a boolean sequence field. The 'n' parameter can be set to AUTO_SIZE (-1) to use the actual array size. The 'destOffset' parameter can be set to ENTIRE_SEQUENCE (-1) to set the sequence size to the number of elements being set.- Throws:
BrokerFieldNotFoundException
- If the field name does not exist in the event.BrokerFieldTypeMismatchException
- If the field is not of the specified type or the name incorrectly accesses a type (such as using [2] on a non-sequence field).BrokerInvalidFieldNameException
- If the field name is not valid.BrokerNullParameterException
- If fieldName or value are null.BrokerOutOfRangeException
- If srcOffset is not within the size of the the passed in value, if destOffset is less than zero, or if n is less than -1.BrokerException
-
setDateSeqField
public void setDateSeqField(java.lang.String fieldName, int srcOffset, int destOffset, int n, BrokerDate[] value) throws BrokerException
Sets the value of a subrange of a date sequence field. The 'n' parameter can be set to AUTO_SIZE (-1) to use the actual array size. The 'destOffset' parameter can be set to ENTIRE_SEQUENCE (-1) to set the sequence size to the number of elements being set.- Throws:
BrokerFieldNotFoundException
- If the field name does not exist in the event.BrokerFieldTypeMismatchException
- If the field is not of the specified type or the name incorrectly accesses a type (such as using [2] on a non-sequence field).BrokerInvalidFieldNameException
- If the field name is not valid.BrokerNullParameterException
- If fieldName or value are null, or if any of the elements of the value array are null.BrokerOutOfRangeException
- If srcOffset is not within the size of the the passed in value, if destOffset is less than zero, or if n is less than -1.BrokerException
-
setCharSeqField
public void setCharSeqField(java.lang.String fieldName, int srcOffset, int destOffset, int n, char[] value) throws BrokerException
Sets the value of a subrange of a char sequence field. The 'n' parameter can be set to AUTO_SIZE (-1) to use the actual array size. The 'destOffset' parameter can be set to ENTIRE_SEQUENCE (-1) to set the sequence size to the number of elements being set. Characters which do not map to ANSI/ISO-Latin-1 will become underscores ('_').- Throws:
BrokerFieldNotFoundException
- If the field name does not exist in the event.BrokerFieldTypeMismatchException
- If the field is not of the specified type or the name incorrectly accesses a type (such as using [2] on a non-sequence field).BrokerInvalidFieldNameException
- If the field name is not valid.BrokerNullParameterException
- If fieldName or value are null.BrokerOutOfRangeException
- If srcOffset is not within the size of the the passed in value, if destOffset is less than zero, or if n is less than -1.BrokerException
-
setUCCharSeqField
public void setUCCharSeqField(java.lang.String fieldName, int srcOffset, int destOffset, int n, char[] value) throws BrokerException
Sets the value of a subrange of a unicode char sequence field. The 'n' parameter can be set to AUTO_SIZE (-1) to use the actual array size. The 'destOffset' parameter can be set to ENTIRE_SEQUENCE (-1) to set the sequence size to the number of elements being set.- Throws:
BrokerFieldNotFoundException
- If the field name does not exist in the event.BrokerFieldTypeMismatchException
- If the field is not of the specified type or the name incorrectly accesses a type (such as using [2] on a non-sequence field).BrokerInvalidFieldNameException
- If the field name is not valid.BrokerNullParameterException
- If fieldName or value are null.BrokerOutOfRangeException
- If srcOffset is not within the size of the the passed in value, if destOffset is less than zero, or if n is less than -1.BrokerException
-
setStringSeqField
public void setStringSeqField(java.lang.String fieldName, int srcOffset, int destOffset, int n, java.lang.String[] value) throws BrokerException
Sets the value of a subrange of a string sequence field. Can also be used to set the value of a unicode string sequence field if your event is typechecked or the named field already is set to a unicode string sequence value. The 'n' parameter can be set to AUTO_SIZE (-1) to use the actual array size. The 'destOffset' parameter can be set to ENTIRE_SEQUENCE (-1) to set the sequence size to the number of elements being set. Characters which do not map to ANSI/ISO-Latin-1 will become underscores ('_').- Throws:
BrokerFieldNotFoundException
- If the field name does not exist in the event.BrokerFieldTypeMismatchException
- If the field is not of the specified type or the name incorrectly accesses a type (such as using [2] on a non-sequence field).BrokerInvalidFieldNameException
- If the field name is not valid.BrokerNullParameterException
- If fieldName or value are null, or if any of the elements of the value array are null.BrokerOutOfRangeException
- If srcOffset is not within the size of the the passed in value, if destOffset is less than zero, or if n is less than -1.BrokerException
-
setUCStringSeqField
public void setUCStringSeqField(java.lang.String fieldName, int srcOffset, int destOffset, int n, java.lang.String[] value) throws BrokerException
Sets the value of a subrange of a unicode string sequence field. The 'n' parameter can be set to AUTO_SIZE (-1) to use the actual array size. The 'destOffset' parameter can be set to ENTIRE_SEQUENCE (-1) to set the sequence size to the number of elements being set.- Throws:
BrokerFieldNotFoundException
- If the field name does not exist in the event.BrokerFieldTypeMismatchException
- If the field is not of the specified type or the name incorrectly accesses a type (such as using [2] on a non-sequence field).BrokerInvalidFieldNameException
- If the field name is not valid.BrokerNullParameterException
- If fieldName or value are null, or if any of the elements of the value array are null.BrokerOutOfRangeException
- If srcOffset is not within the size of the the passed in value, if destOffset is less than zero, or if n is less than -1.BrokerException
-
setSequenceField
public void setSequenceField(java.lang.String fieldName, short fieldType, int srcOffset, int destOffset, int n, java.lang.Object value) throws BrokerException
Sets the value of a subrange of a sequence field. The 'n' parameter can be set to AUTO_SIZE (-1) to use the actual array size. The 'destOffset' parameter can be set to ENTIRE_SEQUENCE (-1) to set the sequence size to the number of elements being set. The 'value' parameter should be the proper kind of array to match the 'fieldType' parameter. For 'fieldType' set to BrokerTypeDef.FIELD_TYPE_*: BYTE = byte[], SHORT = short[], INT = int[], LONG = long[], FLOAT = float[], DOUBLE = double[], BOOLEAN = boolean[], DATE = BrokerDate[], CHAR = char[], UNICODE_CHAR = char[], STRING = String[], UNICODE_STRING = String[], STRUCT = BrokerEvent[]. A sequence of sequences cannot be set with this operation. A value of STRING can also be used to set the value of a UNICODE_STRING sequence field if your event is typechecked or the named field already is set to a unicode string sequence value.- Throws:
BrokerFieldNotFoundException
- If the field name does not exist in the event.BrokerFieldTypeMismatchException
- If the field is not of the specified type, or if the value field is not of the type required for the fieldType specified, or the name incorrectly accesses a type (such as using [2] on a non-sequence field).BrokerInvalidFieldNameException
- If the field name is not valid.BrokerInvalidTypeException
- If fieldType is BrokerTypeDef.FIELD_TYPE_SEQUENCE or is not a supported field type.BrokerNullParameterException
- If fieldName or value are null.BrokerOutOfRangeException
- If srcOffset is not within the size of the the passed in value, if destOffset is less than zero, or if n is less than -1.BrokerException
-
setSequenceFieldSize
public void setSequenceFieldSize(java.lang.String fieldName, int size) throws BrokerException
Set the size of a sequence field.- Throws:
BrokerFieldNotFoundException
- If the field name does not exist in the event.BrokerFieldTypeMismatchException
- If the field is not a sequence, or the name incorrectly accesses a type (such as using [2] on a non-sequence field).BrokerInvalidFieldNameException
- If the field name is not valid.BrokerNullParameterException
- If fieldName is null.BrokerOutOfRangeException
- If size is less than zero.BrokerException
-
setStructFieldFromEvent
public void setStructFieldFromEvent(java.lang.String fieldName, ReflectEvent value) throws BrokerException
Sets the value of a structure field. The value event should contain the appropriate fields for the structure. The type of the value event and any envelope fields on the value event are ignored. If fieldName is "" or null, the top level of the event is modified.- Throws:
BrokerFieldNotFoundException
- If the field name does not exist in the event.BrokerFieldTypeMismatchException
- If the field is not a structure, or the name incorrectly accesses a type (such as using [2] on a non-sequence field).BrokerInvalidFieldNameException
- If the field name is not valid.BrokerNullParameterException
- If value is null.BrokerException
-
setStructSeqFieldFromEvents
public void setStructSeqFieldFromEvents(java.lang.String fieldName, int srcOffset, int destOffset, int n, ReflectEvent[] value) throws BrokerException
Sets the value of a structure sequence field. The value events should contain the appropriate fields for the structures being set. The type of the value events and any envelope fields on the value events are ignored. The 'n' parameter can be set to AUTO_SIZE (-1) to use the actual array size. The 'destOffset' parameter can be set to ENTIRE_SEQUENCE (-1) to set the sequence size to the number of elements being set.- Throws:
BrokerFieldNotFoundException
- If the field name does not exist in the event.BrokerFieldTypeMismatchException
- If the field is not of the specified type, or the name incorrectly accesses a type (such as using [2] on a non-sequence field).BrokerInvalidFieldNameException
- If the field name is not valid.BrokerNullParameterException
- If fieldName or value are null, or if any of the elements in the value array are null.BrokerOutOfRangeException
- If srcOffset is not within the size of the the passed in value, if destOffset is less than zero, or if n is less than -1.BrokerException
-
setField
public void setField(java.lang.String fieldName, short fieldType, java.lang.Object value) throws BrokerException
Sets the value of a field. The 'value' parameter should be the proper kind of object to match the 'fieldType' parameter. For 'fieldType' set to BrokerTypeDef.FIELD_TYPE_*: BYTE = Byte, SHORT = Short, INT = Integer, LONG = Long, FLOAT = Float, DOUBLE = Double, BOOLEAN = Boolean, DATE = BrokerDate, CHAR = Character, UNICODE_CHAR = Character, STRING = String, UNICODE_STRING = String, STRUCT = BrokerEvent. A sequence cannot be set with this operation. Use setSequenceField() for sequences. A value of STRING can also be used to set the value of a UNICODE_STRING field if your event is typechecked or the named field already is set to a unicode string value.- Throws:
BrokerFieldNotFoundException
- If the field name does not exist in the event.BrokerFieldTypeMismatchException
- If the field is not of the specified type, or the value object type does not match the fieldType specified, or the name incorrectly accesses a type (such as using [2] on a non-sequence field).BrokerInvalidFieldNameException
- If the field name is not valid.BrokerInvalidTypeException
- If fieldType is BrokerTypeDef.FIELD_TYPE_SEQUENCE or is not a supported field type.BrokerNullParameterException
- If fieldName or value are null.BrokerException
-
setField
public void setField(java.lang.String fieldName, BrokerField field) throws BrokerException
Sets the value of a field. Does not accept sequences. The 'value' field in the BrokerField should be the proper kind of object to match the 'fieldType' field. For 'fieldType' set to BrokerTypeDef.FIELD_TYPE_*: BYTE = Byte, SHORT = Short, INT = Integer, LONG = Long, FLOAT = Float, DOUBLE = Double, BOOLEAN = Boolean, DATE = BrokerDate, CHAR = Character, UNICODE_CHAR = Character, STRING= String, UNICODE_STRING = String, STRUCT = BrokerEvent. A sequence cannot be set with this operation. Use setSequenceField() for sequences.- Throws:
BrokerFieldNotFoundException
- If the field name does not exist in the event.BrokerFieldTypeMismatchException
- If the field is not of the specified type, or the value object type does not match the fieldType specified, or the name incorrectly accesses a type (such as using [2] on a non-sequence field).BrokerInvalidFieldNameException
- If the field name is not valid.BrokerInvalidTypeException
- If the fieldType field is BrokerTypeDef.FIELD_TYPE_SEQUENCE or is not a supported field type.BrokerNullParameterException
- If fieldName, field, or the value field in 'field' are null.BrokerException
-
getByteField
public byte getByteField(java.lang.String fieldName) throws BrokerException
Get the value of a byte field.- Throws:
BrokerFieldNotFoundException
- If the field name does not exist in the event.BrokerFieldTypeMismatchException
- If the field is not of the specified type, or the name incorrectly accesses a type (such as using [2] on a non-sequence field).BrokerInvalidFieldNameException
- If the field name is not valid.BrokerNullParameterException
- If fieldName is null.BrokerException
-
getShortField
public short getShortField(java.lang.String fieldName) throws BrokerException
Get the value of a short field.- Throws:
BrokerFieldNotFoundException
- If the field name does not exist in the event.BrokerFieldTypeMismatchException
- If the field is not of the specified type, or the name incorrectly accesses a type (such as using [2] on a non-sequence field).BrokerInvalidFieldNameException
- If the field name is not valid.BrokerNullParameterException
- If fieldName is null.BrokerException
-
getIntegerField
public int getIntegerField(java.lang.String fieldName) throws BrokerException
Get the value of an integer field.- Throws:
BrokerFieldNotFoundException
- If the field name does not exist in the event.BrokerFieldTypeMismatchException
- If the field is not of the specified type, or the name incorrectly accesses a type (such as using [2] on a non-sequence field).BrokerInvalidFieldNameException
- If the field name is not valid.BrokerNullParameterException
- If fieldName is null.BrokerException
-
getLongField
public long getLongField(java.lang.String fieldName) throws BrokerException
Get the value of a long field.- Throws:
BrokerFieldNotFoundException
- If the field name does not exist in the event.BrokerFieldTypeMismatchException
- If the field is not of the specified type, or the name incorrectly accesses a type (such as using [2] on a non-sequence field).BrokerInvalidFieldNameException
- If the field name is not valid.BrokerNullParameterException
- If fieldName is null.BrokerException
-
getFloatField
public float getFloatField(java.lang.String fieldName) throws BrokerException
Get the value of a float field.- Throws:
BrokerFieldNotFoundException
- If the field name does not exist in the event.BrokerFieldTypeMismatchException
- If the field is not of the specified type, or the name incorrectly accesses a type (such as using [2] on a non-sequence field).BrokerInvalidFieldNameException
- If the field name is not valid.BrokerNullParameterException
- If fieldName is null.BrokerException
-
getDoubleField
public double getDoubleField(java.lang.String fieldName) throws BrokerException
Get the value of a double field.- Throws:
BrokerFieldNotFoundException
- If the field name does not exist in the event.BrokerFieldTypeMismatchException
- If the field is not of the specified type, or the name incorrectly accesses a type (such as using [2] on a non-sequence field).BrokerInvalidFieldNameException
- If the field name is not valid.BrokerNullParameterException
- If fieldName is null.BrokerException
-
getBooleanField
public boolean getBooleanField(java.lang.String fieldName) throws BrokerException
Get the value of a boolean field.- Throws:
BrokerFieldNotFoundException
- If the field name does not exist in the event.BrokerFieldTypeMismatchException
- If the field is not of the specified type, or the name incorrectly accesses a type (such as using [2] on a non-sequence field).BrokerInvalidFieldNameException
- If the field name is not valid.BrokerNullParameterException
- If fieldName is null.BrokerException
-
getDateField
public BrokerDate getDateField(java.lang.String fieldName) throws BrokerException
Get the value of a date field.- Throws:
BrokerFieldNotFoundException
- If the field name does not exist in the event.BrokerFieldTypeMismatchException
- If the field is not of the specified type, or the name incorrectly accesses a type (such as using [2] on a non-sequence field).BrokerInvalidFieldNameException
- If the field name is not valid.BrokerNullParameterException
- If fieldName is null.BrokerException
-
getCharField
public char getCharField(java.lang.String fieldName) throws BrokerException
Get the value of a char field.- Throws:
BrokerFieldNotFoundException
- If the field name does not exist in the event.BrokerFieldTypeMismatchException
- If the field is not of the specified type, or the name incorrectly accesses a type (such as using [2] on a non-sequence field).BrokerInvalidFieldNameException
- If the field name is not valid.BrokerNullParameterException
- If fieldName is null.BrokerException
-
getUCCharField
public char getUCCharField(java.lang.String fieldName) throws BrokerException
Get the value of a unicode char field.- Throws:
BrokerFieldNotFoundException
- If the field name does not exist in the event.BrokerFieldTypeMismatchException
- If the field is not of the specified type, or the name incorrectly accesses a type (such as using [2] on a non-sequence field).BrokerInvalidFieldNameException
- If the field name is not valid.BrokerNullParameterException
- If fieldName is null.BrokerException
-
getStringField
public java.lang.String getStringField(java.lang.String fieldName) throws BrokerException
Get the value of a string field. Can also be used to get the value of a unicode string field.- Throws:
BrokerFieldNotFoundException
- If the field name does not exist in the event.BrokerFieldTypeMismatchException
- If the field is not of the specified type, or the name incorrectly accesses a type (such as using [2] on a non-sequence field).BrokerInvalidFieldNameException
- If the field name is not valid.BrokerNullParameterException
- If fieldName is null.BrokerException
-
getUCStringField
public java.lang.String getUCStringField(java.lang.String fieldName) throws BrokerException
Get the value of a unicode string field.- Throws:
BrokerFieldNotFoundException
- If the field name does not exist in the event.BrokerFieldTypeMismatchException
- If the field is not of the specified type, or the name incorrectly accesses a type (such as using [2] on a non-sequence field).BrokerInvalidFieldNameException
- If the field name is not valid.BrokerNullParameterException
- If fieldName is null.BrokerException
-
getByteSeqField
public byte[] getByteSeqField(java.lang.String fieldName, int offset, int maxN) throws BrokerException
Get the value of a byte sequence field. Gets the entire length if maxN is ENTIRE_SEQUENCE (-1), otherwise gets up to maxN values.- Throws:
BrokerFieldNotFoundException
- If the field name does not exist in the event.BrokerFieldTypeMismatchException
- If the field is not of the specified type, or the name incorrectly accesses a type (such as using [2] on a non-sequence field).BrokerInvalidFieldNameException
- If the field name is not valid.BrokerNullParameterException
- If fieldName is null.BrokerOutOfRangeException
- If offset is less than zero or greater than the sequence size, or maxN is less than zero.BrokerException
-
getShortSeqField
public short[] getShortSeqField(java.lang.String fieldName, int offset, int maxN) throws BrokerException
Get the value of a short sequence field. Gets the entire length if maxN is ENTIRE_SEQUENCE (-1), otherwise gets up to maxN values.- Throws:
BrokerFieldNotFoundException
- If the field name does not exist in the event.BrokerFieldTypeMismatchException
- If the field is not of the specified type, or the name incorrectly accesses a type (such as using [2] on a non-sequence field).BrokerInvalidFieldNameException
- If the field name is not valid.BrokerNullParameterException
- If fieldName is null.BrokerOutOfRangeException
- If offset is less than zero or greater than the sequence size, or maxN is less than zero.BrokerException
-
getIntegerSeqField
public int[] getIntegerSeqField(java.lang.String fieldName, int offset, int maxN) throws BrokerException
Get the value of an integer sequence field. Gets the entire length if maxN is ENTIRE_SEQUENCE (-1), otherwise gets up to maxN values.- Throws:
BrokerFieldNotFoundException
- If the field name does not exist in the event.BrokerFieldTypeMismatchException
- If the field is not of the specified type, or the name incorrectly accesses a type (such as using [2] on a non-sequence field).BrokerInvalidFieldNameException
- If the field name is not valid.BrokerNullParameterException
- If fieldName is null.BrokerOutOfRangeException
- If offset is less than zero or greater than the sequence size, or maxN is less than zero.BrokerException
-
getLongSeqField
public long[] getLongSeqField(java.lang.String fieldName, int offset, int maxN) throws BrokerException
Get the value of a long sequence field. Gets the entire length if maxN is ENTIRE_SEQUENCE (-1), otherwise gets up to maxN values.- Throws:
BrokerFieldNotFoundException
- If the field name does not exist in the event.BrokerFieldTypeMismatchException
- If the field is not of the specified type, or the name incorrectly accesses a type (such as using [2] on a non-sequence field).BrokerInvalidFieldNameException
- If the field name is not valid.BrokerNullParameterException
- If fieldName is null.BrokerOutOfRangeException
- If offset is less than zero or greater than the sequence size, or maxN is less than zero.BrokerException
-
getFloatSeqField
public float[] getFloatSeqField(java.lang.String fieldName, int offset, int maxN) throws BrokerException
Get the value of a float sequence field. Gets the entire length if maxN is ENTIRE_SEQUENCE (-1), otherwise gets up to maxN values.- Throws:
BrokerFieldNotFoundException
- If the field name does not exist in the event.BrokerFieldTypeMismatchException
- If the field is not of the specified type, or the name incorrectly accesses a type (such as using [2] on a non-sequence field).BrokerInvalidFieldNameException
- If the field name is not valid.BrokerNullParameterException
- If fieldName is null.BrokerOutOfRangeException
- If offset is less than zero or greater than the sequence size, or maxN is less than zero.BrokerException
-
getDoubleSeqField
public double[] getDoubleSeqField(java.lang.String fieldName, int offset, int maxN) throws BrokerException
Get the value of a double sequence field. Gets the entire length if maxN is ENTIRE_SEQUENCE (-1), otherwise gets up to maxN values.- Throws:
BrokerFieldNotFoundException
- If the field name does not exist in the event.BrokerFieldTypeMismatchException
- If the field is not of the specified type, or the name incorrectly accesses a type (such as using [2] on a non-sequence field).BrokerInvalidFieldNameException
- If the field name is not valid.BrokerNullParameterException
- If fieldName is null.BrokerOutOfRangeException
- If offset is less than zero or greater than the sequence size, or maxN is less than zero.BrokerException
-
getBooleanSeqField
public boolean[] getBooleanSeqField(java.lang.String fieldName, int offset, int maxN) throws BrokerException
Get the value of a boolean sequence field. Gets the entire length if maxN is ENTIRE_SEQUENCE (-1), otherwise gets up to maxN values.- Throws:
BrokerFieldNotFoundException
- If the field name does not exist in the event.BrokerFieldTypeMismatchException
- If the field is not of the specified type, or the name incorrectly accesses a type (such as using [2] on a non-sequence field).BrokerInvalidFieldNameException
- If the field name is not valid.BrokerNullParameterException
- If fieldName is null.BrokerOutOfRangeException
- If offset is less than zero or greater than the sequence size, or maxN is less than zero.BrokerException
-
getDateSeqField
public BrokerDate[] getDateSeqField(java.lang.String fieldName, int offset, int maxN) throws BrokerException
Get the value of a date sequence field. Gets the entire length if maxN is ENTIRE_SEQUENCE (-1), otherwise gets up to maxN values.- Throws:
BrokerFieldNotFoundException
- If the field name does not exist in the event.BrokerFieldTypeMismatchException
- If the field is not of the specified type, or the name incorrectly accesses a type (such as using [2] on a non-sequence field).BrokerInvalidFieldNameException
- If the field name is not valid.BrokerNullParameterException
- If fieldName is null.BrokerOutOfRangeException
- If offset is less than zero or greater than the sequence size, or maxN is less than zero.BrokerException
-
getCharSeqField
public char[] getCharSeqField(java.lang.String fieldName, int offset, int maxN) throws BrokerException
Get the value of a char sequence field. Gets the entire length if maxN is ENTIRE_SEQUENCE (-1), otherwise gets up to maxN values.- Throws:
BrokerFieldNotFoundException
- If the field name does not exist in the event.BrokerFieldTypeMismatchException
- If the field is not of the specified type, or the name incorrectly accesses a type (such as using [2] on a non-sequence field).BrokerInvalidFieldNameException
- If the field name is not valid.BrokerNullParameterException
- If fieldName is null.BrokerOutOfRangeException
- If offset is less than zero or greater than the sequence size, or maxN is less than zero.BrokerException
-
getUCCharSeqField
public char[] getUCCharSeqField(java.lang.String fieldName, int offset, int maxN) throws BrokerException
Get the value of a unicode char sequence field. Gets the entire length if maxN is ENTIRE_SEQUENCE (-1), otherwise gets up to maxN values.- Throws:
BrokerFieldNotFoundException
- If the field name does not exist in the event.BrokerFieldTypeMismatchException
- If the field is not of the specified type, or the name incorrectly accesses a type (such as using [2] on a non-sequence field).BrokerInvalidFieldNameException
- If the field name is not valid.BrokerNullParameterException
- If fieldName is null.BrokerOutOfRangeException
- If offset is less than zero or greater than the sequence size, or maxN is less than zero.BrokerException
-
getStringSeqField
public java.lang.String[] getStringSeqField(java.lang.String fieldName, int offset, int maxN) throws BrokerException
Get the value of a string sequence field. Gets the entire length if maxN is ENTIRE_SEQUENCE (-1), otherwise gets up to maxN values. Can also be used to get the value of a unicode string sequence field.- Throws:
BrokerFieldNotFoundException
- If the field name does not exist in the event.BrokerFieldTypeMismatchException
- If the field is not of the specified type, or the name incorrectly accesses a type (such as using [2] on a non-sequence field).BrokerInvalidFieldNameException
- If the field name is not valid.BrokerNullParameterException
- If fieldName is null.BrokerOutOfRangeException
- If offset is less than zero or greater than the sequence size, or maxN is less than zero.BrokerException
-
getUCStringSeqField
public java.lang.String[] getUCStringSeqField(java.lang.String fieldName, int offset, int maxN) throws BrokerException
Get the value of a unicode string sequence field. Gets the entire length if maxN is ENTIRE_SEQUENCE (-1), otherwise gets up to maxN values.- Throws:
BrokerFieldNotFoundException
- If the field name does not exist in the event.BrokerFieldTypeMismatchException
- If the field is not of the specified type, or the name incorrectly accesses a type (such as using [2] on a non-sequence field).BrokerInvalidFieldNameException
- If the field name is not valid.BrokerNullParameterException
- If fieldName is null.BrokerOutOfRangeException
- If offset is less than zero or greater than the sequence size, or maxN is less than zero.BrokerException
-
getSequenceFieldSize
public int getSequenceFieldSize(java.lang.String fieldName) throws BrokerException
Get the size of a sequence field.- Throws:
BrokerFieldNotFoundException
- If the field name does not exist in the event.BrokerFieldTypeMismatchException
- If the the name incorrectly accesses a type (such as using [2] on a non-sequence field).BrokerInvalidFieldNameException
- If the field name is not valid.BrokerNullParameterException
- If fieldName is null.BrokerException
-
getSequenceField
public BrokerField getSequenceField(java.lang.String fieldName, int offset, int maxN) throws BrokerException
Get the value of a sequence field. Gets the entire length if maxN is ENTIRE_SEQUENCE (-1), otherwise gets up to maxN values. The 'value' field in the BrokerField will be set to match the 'fieldType' field. For 'fieldType' set to BrokerTypeDef.FIELD_TYPE_*: BYTE = byte[], SHORT = short[], INT = int[], LONG = long[], FLOAT = float[], DOUBLE = double[], BOOLEAN = boolean[], DATE = BrokerDate[], CHAR = char[], UNICODE_CHAR = char[], UNICODE_STRING = String[], STRING= String[], STRUCT = BrokerEvent[]. Cannot get a sequence of sequences with this operation.- Throws:
BrokerFieldNotFoundException
- If the field name does not exist in the event.BrokerFieldTypeMismatchException
- If the the name incorrectly accesses a type (such as using [2] on a non-sequence field).BrokerInvalidFieldNameException
- If the field name is not valid.BrokerInvalidTypeException
- If the field is a sequence of sequences.BrokerNullParameterException
- If fieldName is null.BrokerOutOfRangeException
- If offset is less than zero or greater than the sequence size, or maxN is less than zero.BrokerException
-
getStructFieldAsEvent
public ReflectEvent getStructFieldAsEvent(java.lang.String fieldName) throws BrokerException
Get the value of a structure field. The event will contain the appropriate fields and its type name will be "structValue". If fieldName is "" or null, the top level of the event is returned.- Throws:
BrokerFieldNotFoundException
- If the field name does not exist in the event.BrokerFieldTypeMismatchException
- If the field is not of the specified type, or the name incorrectly accesses a type (such as using [2] on a non-sequence field).BrokerInvalidFieldNameException
- If the field name is not valid.BrokerException
-
getStructSeqFieldAsEvents
public ReflectEvent[] getStructSeqFieldAsEvents(java.lang.String fieldName, int offset, int maxN) throws BrokerException
Get the value of a structure sequence field. The events will not be typechecked and they will contain the appropriate fields from the structs. Gets the entire length if maxN is ENTIRE_SEQUENCE (-1), otherwise gets up to maxN values.- Throws:
BrokerFieldNotFoundException
- If the field name does not exist in the event.BrokerFieldTypeMismatchException
- If the field is not of the specified type, or the name incorrectly accesses a type (such as using [2] on a non-sequence field).BrokerInvalidFieldNameException
- If the field name is not valid.BrokerNullParameterException
- If fieldName is null.BrokerOutOfRangeException
- If offset is less than zero or greater than the sequence size, or maxN is less than zero.BrokerException
-
getField
public BrokerField getField(java.lang.String fieldName) throws BrokerException
Get the value of field. The 'value' field in the BrokerField will be set to match the 'fieldType' field. For 'fieldType' set to BrokerTypeDef.FIELD_TYPE_*: BYTE = Byte, SHORT = Short, INT = Integer, LONG = Long, FLOAT = Float, DOUBLE = Double, BOOLEAN = Boolean, DATE = BrokerDate, CHAR = Character, UNICODE_CHAR = Character, STRING= String, UNICODE_STRING = String, STRUCT = BrokerEvent. Cannot get a sequence with this operation.- Throws:
BrokerFieldNotFoundException
- If the field name does not exist in the event.BrokerFieldTypeMismatchException
- If the the name incorrectly accesses a type (such as using [2] on a non-sequence field).BrokerInvalidFieldNameException
- If the field name is not valid.BrokerInvalidTypeException
- If the field is a sequence.BrokerNullParameterException
- If fieldName is null.BrokerException
-
getFieldNames
public java.lang.String[] getFieldNames(java.lang.String fieldName) throws BrokerException
Get the list of field names in an event. If fieldName is null or "", it gets the fields at the top level of the event. Otherwise, the fieldName should refer to a structure sub-field and it will return the names at that level. Non-structured types will return zero names.- Throws:
BrokerFieldNotFoundException
- If the field name does not exist in the event.BrokerFieldTypeMismatchException
- If the name incorrectly accesses a type (such as using [2] on a non-sequence field).BrokerInvalidFieldNameException
- If the field name is not valid.BrokerException
-
isFieldSet
public boolean isFieldSet(java.lang.String fieldName) throws BrokerException
Determine if the specified field is set in the event. For non-typechecked events, this is merely whether the field exists or not. For typechecked events, this tells if the field has been assigned a value or is simply defaulting to a value because it was not set.- Throws:
BrokerFieldNotFoundException
- If the field name does not exist in the event.BrokerFieldTypeMismatchException
- If the name incorrectly accesses a type (such as using [2] on a non-sequence field).BrokerInvalidFieldNameException
- If the field name is not valid.BrokerNullParameterException
- If fieldName is null.BrokerException
-
clear
public void clear() throws BrokerException
Clears all fields of the event so it can be re-used.- Throws:
BrokerException
-
clearField
public void clearField(java.lang.String fieldName) throws BrokerException
Clear (un-set) a field in the event.- Throws:
BrokerFieldNotFoundException
- If the field name does not exist in the event.BrokerFieldTypeMismatchException
- If the name incorrectly accesses a type (such as using [2] on a non-sequence field).BrokerInvalidFieldNameException
- If the field name is not valid.BrokerNullParameterException
- If fieldName is null.BrokerException
-
getTag
public int getTag() throws BrokerException
Get the event's 'tag' envelope field. This is equivalent to getIntegerField("_env.tag"), but it can be more convenient.- Throws:
BrokerFieldNotFoundException
- If "_env.tag" is not set on the event.BrokerException
-
setTag
public void setTag(int tag) throws BrokerException
Set the event's 'tag' envelope field. This is the same as setIntegerField("_env.tag",tag), but it can be more convenient.- Throws:
BrokerException
-
toString
public java.lang.String toString()
Get event content as a string which includes newlines. Event field values will be formatted for the US English locale.- Overrides:
toString
in classjava.lang.Object
-
toString
public java.lang.String toString(java.util.Locale locale)
Get event content as a string which includes newlines. Event field values will be formatted for the specified locale
-
toString
public java.lang.String toString(int indentLevel)
Get event content as a string suitable for human viewing. The "indentLevel" is the number of 4-space indents that the output should be generated for.
-
toString
public java.lang.String toString(int indentLevel, java.util.Locale locale)
Get event content as a string suitable for human viewing. The "indentLevel" is the number of 4-space indents that the output should be generated for. Event field values will be formatted for the specified locale.
-
toFormattedString
public java.lang.String toFormattedString(java.lang.String formatString) throws BrokerException
Format an event string. Take the formatString and replace all references to event fields with their values. See class BrokerFormat for details.- Throws:
BrokerException
-
toFormattedString
public java.lang.String toFormattedString(java.lang.String formatString, java.util.Locale locale) throws BrokerException
Format an event string. Take the formatString and replace all references to event fields with their values. Event field values will be formatted for the specified locale. See class BrokerFormat for details.- Throws:
BrokerException
-
toBinData
public byte[] toBinData()
Get out the event's data as a byte array. This is useful for storage on disk or in a database.
-
fromBinData
public static ReflectEvent fromBinData(BrokerClient client, byte[] data, java.lang.Class cls) throws BrokerException
Create an event using a byte array given out by toBinData().- Throws:
BrokerCorruptDataException
- If data is not a valid event.BrokerNoPermissionException
- If a client is specified and the client does not have permission to publish or subscribe to the event type.BrokerNullParameterException
- If data is null.BrokerUnknownEventTypeException
- If a client is specified and the broker does not have an event type with the specified name.BrokerException
-
-