Package COM.activesw.api.client
Class NativeEvent
- java.lang.Object
-
- COM.activesw.api.client.NativeEvent
-
public class NativeEvent extends java.lang.Object
NativeEvent
-
-
Constructor Summary
Constructors Constructor Description NativeEvent(NativeEvent nativeEvent)
NativeEvent(java.lang.String eventTypeName)
NativeEvent(java.lang.String eventTypeName, int initialCapacity)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clear()
void
clearField(java.lang.String fieldName)
Clears the field for specified field name.void
clearField(java.lang.String fieldName, boolean ignoreEx)
Clears the field for specified field name.protected NativeStruct
getBody()
protected NativeFieldIterator
getBodyIterator()
protected NativeStruct
getEnvelope()
protected NativeFieldIterator
getEnvelopeIterator()
long
getEventId()
java.lang.String
getEventTypeName()
BrokerField
getField(java.lang.String fieldName, boolean getCopy)
Returns the field for specified field name.java.lang.String[]
getFieldNames(java.lang.String fieldName)
Returns the field names for specified field name.short
getFieldType(java.lang.String fieldName)
Returns the field for specified field name.BrokerField
getSequenceField(java.lang.String fieldName, int offset, int count, boolean makeCopy)
Returns the sequence field for specified field name.int
getSequenceFieldLength(java.lang.String fieldName)
Returns the length of the specified sequence field.boolean
isFieldSet(java.lang.String fieldName)
Returns true if the specified field is set.boolean
isTyped()
Returns true if the event is typed.protected void
setBody(java.lang.Object body)
protected void
setEnvelope(java.lang.Object envelope)
protected void
setEventId(long eventId)
void
setEventTypeName(java.lang.String eventTypeName)
void
setField(java.lang.String fieldName, short type, java.lang.Object value, boolean makeCopy)
Sets a field.void
setSequenceField(java.lang.String fieldName, short type, int srcOffset, int destOffset, int count, java.lang.Object srcValue, boolean makeCopy)
Sets count elements of a sequence field starting at srcOffset, growing the sequence if necessary For typed events: If the type definition for fieldName is not found or if it does not match the type definition then a BrokerException will be thrown.void
setSequenceFieldLength(java.lang.String fieldName, int length)
Sets the length of a sequence field For typed events: If the type definition for fieldName is not found or if it does not match the type definition then a BrokerException will be thrown.void
setSequenceFieldLength(java.lang.String fieldName, int length, short elemType)
Sets the length of a sequence field For typed events: If the type definition for fieldName is not found or if it does not match the type definition then a BrokerException will be thrown.
-
-
-
Constructor Detail
-
NativeEvent
public NativeEvent(java.lang.String eventTypeName)
-
NativeEvent
public NativeEvent(java.lang.String eventTypeName, int initialCapacity)
-
NativeEvent
public NativeEvent(NativeEvent nativeEvent) throws BrokerException
- Throws:
BrokerException
-
-
Method Detail
-
clearField
public void clearField(java.lang.String fieldName, boolean ignoreEx) throws BrokerException
Clears the field for specified field name. If ignoreEx is set to true, FieldNotFoundException is not thrown. For untyped events: If the field is not found then a BrokerFieldNotFound exception will be thrown. Note that it is not possible to clear individual elements of a sequence.- Parameters:
fieldName
- - the fully qualified name of the field to get- Throws:
BrokerFieldNotFoundException
BrokerFieldTypeMismatchException
BrokerException
-
clearField
public void clearField(java.lang.String fieldName) throws BrokerException
Clears the field for specified field name. This method will throw a field not found exception if the field does not exist. For untyped events: If the field is not found then a BrokerFieldNotFound exception will be thrown. Note that it is not possible to clear individual elements of a sequence.- Parameters:
fieldName
- - the fully qualified name of the field to get- Throws:
BrokerFieldNotFoundException
BrokerFieldTypeMismatchException
BrokerException
-
getField
public BrokerField getField(java.lang.String fieldName, boolean getCopy) throws BrokerException
Returns the field for specified field name.- Parameters:
fieldName
- - the fully qualified name of the field to get- Returns:
- BrokerField
- Throws:
BrokerFieldNotFoundException
BrokerFieldTypeMismatchException
BrokerException
-
getFieldNames
public java.lang.String[] getFieldNames(java.lang.String fieldName) throws BrokerException
Returns the field names for specified field name.- Parameters:
fieldName
- - the fully qualified name of the field to get- Returns:
- BrokerField
- Throws:
BrokerFieldNotFoundException
BrokerFieldTypeMismatchException
BrokerException
-
getSequenceField
public BrokerField getSequenceField(java.lang.String fieldName, int offset, int count, boolean makeCopy) throws BrokerException
Returns the sequence field for specified field name. If the field is found then the field is returned. For typed events: If the type definition for fieldName is not found then a BrokerFieldNotFound exception will be thrown. If the type definition is found but the field is not set then the field's default value will be returned. For untyped events: If the field is not found then a BrokerFieldNotFound exception will be thrown.- Parameters:
fieldName
- - the fully qualified name of the field to get- Returns:
- BrokerField
- Throws:
BrokerFieldNotFoundException
BrokerFieldTypeMismatchException
BrokerException
-
getSequenceFieldLength
public int getSequenceFieldLength(java.lang.String fieldName) throws BrokerException
Returns the length of the specified sequence field.- Parameters:
fieldName
- - the fully qualified name of the field to get- Returns:
- BrokerField
- Throws:
BrokerFieldNotFoundException
BrokerFieldTypeMismatchException
BrokerException
-
getFieldType
public short getFieldType(java.lang.String fieldName) throws BrokerException
Returns the field for specified field name. If the field is found then the field is returned. For typed events: If the type definition for fieldName is not found then a BrokerFieldNotFound exception will be thrown. If the type definition is found but the field is not set then the field's default value will be returned. For untyped events: If the field is not found then a BrokerFieldNotFound exception will be thrown.- Parameters:
fieldName
- - the fully qualified name of the field to get- Returns:
- short - the field's type (see BrokerTypeDef.FIELD_TYPE_XXX)
- Throws:
BrokerFieldNotFoundException
BrokerFieldTypeMismatchException
BrokerException
-
isFieldSet
public boolean isFieldSet(java.lang.String fieldName) throws BrokerException
Returns true if the specified field is set. For typed events: If the type definition for fieldName is not found then a BrokerFieldNotFound exception will be thrown.- Parameters:
fieldName
- - the fully qualified name of the field to get- Returns:
- boolean
- Throws:
BrokerFieldNotFoundException
BrokerFieldTypeMismatchException
BrokerException
-
isTyped
public boolean isTyped() throws BrokerException
Returns true if the event is typed.- Returns:
- boolean
- Throws:
BrokerException
-
setField
public void setField(java.lang.String fieldName, short type, java.lang.Object value, boolean makeCopy) throws BrokerException
Sets a field. If the field exists in the event then its value will be overwritten. For typed events: If the type definition for fieldName is not found or if it does not match the type definition then a BrokerException will be thrown. For untyped events: If the field already exists but is of a different type then a BrokerFieldTypeMismatchException will be thrown.- Parameters:
fieldName
- - the fully qualified name of the field to settype
- - the field's type (see BrokerTypeDef.FIELD_TYPE_XXX)value
- - the field's value- Throws:
BrokerFieldNotFoundException
BrokerFieldTypeMismatchException
BrokerException
-
setSequenceField
public void setSequenceField(java.lang.String fieldName, short type, int srcOffset, int destOffset, int count, java.lang.Object srcValue, boolean makeCopy) throws BrokerException
Sets count elements of a sequence field starting at srcOffset, growing the sequence if necessary For typed events: If the type definition for fieldName is not found or if it does not match the type definition then a BrokerException will be thrown. For untyped events: If the field already exists but is of a different type then a BrokerFieldTypeMismatchException will be thrown.- Parameters:
fieldName
- - the fully qualified name of the field to settype
- - the field's type (see BrokerTypeDef.FIELD_TYPE_XXX)srcOffset
- - offset of source arraydestOffset
- - offset of dest sequencecount
- - the number of elements to setsrcValue
- - the source array- Throws:
BrokerFieldNotFoundException
BrokerFieldTypeMismatchException
BrokerException
-
setSequenceFieldLength
public void setSequenceFieldLength(java.lang.String fieldName, int length) throws BrokerException
Sets the length of a sequence field For typed events: If the type definition for fieldName is not found or if it does not match the type definition then a BrokerException will be thrown. For untyped events: If the field already exists but is of a different type then a BrokerFieldTypeMismatchException will be thrown.- Parameters:
fieldName
- - the fully qualified name of the field to setlength
- - the number of elements in the sequence- Throws:
BrokerFieldNotFoundException
BrokerFieldTypeMismatchException
BrokerException
-
setSequenceFieldLength
public void setSequenceFieldLength(java.lang.String fieldName, int length, short elemType) throws BrokerException
Sets the length of a sequence field For typed events: If the type definition for fieldName is not found or if it does not match the type definition then a BrokerException will be thrown. For untyped events: If the field already exists but is of a different type then a BrokerFieldTypeMismatchException will be thrown.- Parameters:
fieldName
- - the fully qualified name of the field to setlength
- - the number of elements in the sequence- Throws:
BrokerFieldNotFoundException
BrokerFieldTypeMismatchException
BrokerException
-
getEventId
public long getEventId()
-
getEventTypeName
public java.lang.String getEventTypeName()
-
setEventTypeName
public void setEventTypeName(java.lang.String eventTypeName)
-
setEventId
protected void setEventId(long eventId)
-
getBodyIterator
protected NativeFieldIterator getBodyIterator()
-
getEnvelopeIterator
protected NativeFieldIterator getEnvelopeIterator()
-
getBody
protected NativeStruct getBody()
-
getEnvelope
protected NativeStruct getEnvelope()
-
setBody
protected void setBody(java.lang.Object body) throws BrokerException
- Throws:
BrokerException
-
setEnvelope
protected void setEnvelope(java.lang.Object envelope) throws BrokerException
- Throws:
BrokerException
-
clear
public void clear() throws BrokerException
- Throws:
BrokerException
-
-