Package COM.activesw.api.client
Class BrokerPacked
- java.lang.Object
-
- COM.activesw.api.client.BrokerPacked
-
public class BrokerPacked extends java.lang.Object
Manages a packed broker event.
-
-
Constructor Summary
Constructors Constructor Description BrokerPacked(byte[] data)
Create a packed event from some read in data.BrokerPacked(BrokerPacked packed_event)
Copy constructor.BrokerPacked(java.lang.String bin_string)
Create from a bin stringBrokerPacked(java.lang.String event_type_name, int version)
Create an empty packed event.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static boolean
allowSetEnvelope(boolean allowed)
Allow/disallow setting of envelope fields for this thread.void
clearField(java.lang.String field_name, boolean is_typechecked)
Clear a field's valuejava.lang.String
eventToBinString()
Stringify an event in binary form.void
eventToString(BrokerTypeDef def, int indent_level, java.util.Locale locale, java.lang.StringBuffer buf)
Stringify an event.static boolean
getAllowSetEnvelope()
byte[]
getData()
Get the binary formlong
getEventId()
Get the event ID.BrokerField
getField(java.lang.String field_name, boolean is_typechecked)
Get a field's value - throws BrokerFieldNotFoundException if field not foundjava.lang.String[]
getFieldNames(java.lang.String field_name)
Get field namesBrokerField
getFieldType(java.lang.String field_name)
Get a field's typeint
getPackVersion()
Get the packed format versionBrokerField
getSequenceField(java.lang.String field_name, int offset, int max_n, boolean is_typechecked)
Get a sequence field's valueint
getSequenceSize(java.lang.String field_name, boolean is_typechecked)
Get a sequence field's sizeint
getSystemPackVersion()
Get the system pack versionjava.lang.String
getTypeName()
Get the type nameint
getTypeVersion()
Get the type versionstatic boolean
isExtendedReservedWord(java.lang.String st)
Check if a name is an extended reserved wordstatic boolean
isReservedWord(java.lang.String st)
Check if a name is a reserved wordboolean
isValidEvent()
Determine if this event is validvoid
setField(java.lang.String field_name, short value_type, java.lang.Object value)
Set a field's valuevoid
setSequenceSize(java.lang.String field_name, short type, int size)
Set a sequence field's sizevoid
validate(BrokerTypeDef def)
Validate an event against its definition.static void
validateEventTypeName(java.lang.String event_type_name)
Check if event name is validstatic boolean
validateFieldName(java.lang.String name)
Check if field name is validstatic boolean
validateFieldNameChars(char[] c)
-
-
-
Constructor Detail
-
BrokerPacked
public BrokerPacked(java.lang.String event_type_name, int version) throws BrokerException
Create an empty packed event.- Throws:
BrokerException
-
BrokerPacked
public BrokerPacked(byte[] data) throws BrokerException
Create a packed event from some read in data. Does not copy the data.- Throws:
BrokerException
-
BrokerPacked
public BrokerPacked(BrokerPacked packed_event)
Copy constructor.
-
BrokerPacked
public BrokerPacked(java.lang.String bin_string) throws BrokerException
Create from a bin string- Throws:
BrokerException
-
-
Method Detail
-
eventToBinString
public java.lang.String eventToBinString()
Stringify an event in binary form.
-
getData
public byte[] getData()
Get the binary form
-
getPackVersion
public int getPackVersion() throws BrokerException
Get the packed format version- Throws:
BrokerException
-
getSystemPackVersion
public int getSystemPackVersion()
Get the system pack version
-
getTypeVersion
public int getTypeVersion()
Get the type version
-
getEventId
public long getEventId()
Get the event ID.
-
getTypeName
public java.lang.String getTypeName()
Get the type name
-
getField
public BrokerField getField(java.lang.String field_name, boolean is_typechecked) throws BrokerException
Get a field's value - throws BrokerFieldNotFoundException if field not found- Throws:
BrokerException
-
getFieldType
public BrokerField getFieldType(java.lang.String field_name) throws BrokerException
Get a field's type- Throws:
BrokerException
-
getSequenceField
public BrokerField getSequenceField(java.lang.String field_name, int offset, int max_n, boolean is_typechecked) throws BrokerException
Get a sequence field's value- Throws:
BrokerException
-
setField
public void setField(java.lang.String field_name, short value_type, java.lang.Object value) throws BrokerException
Set a field's value- Throws:
BrokerException
-
clearField
public void clearField(java.lang.String field_name, boolean is_typechecked) throws BrokerException
Clear a field's value- Throws:
BrokerException
-
getSequenceSize
public int getSequenceSize(java.lang.String field_name, boolean is_typechecked) throws BrokerException
Get a sequence field's size- Throws:
BrokerException
-
setSequenceSize
public void setSequenceSize(java.lang.String field_name, short type, int size) throws BrokerException
Set a sequence field's size- Throws:
BrokerException
-
getFieldNames
public java.lang.String[] getFieldNames(java.lang.String field_name) throws BrokerException
Get field names- Throws:
BrokerException
-
validate
public void validate(BrokerTypeDef def) throws BrokerException
Validate an event against its definition.- Throws:
BrokerException
-
eventToString
public void eventToString(BrokerTypeDef def, int indent_level, java.util.Locale locale, java.lang.StringBuffer buf) throws BrokerException
Stringify an event.- Throws:
BrokerException
-
allowSetEnvelope
public static boolean allowSetEnvelope(boolean allowed)
Allow/disallow setting of envelope fields for this thread. Allows setting of all broker controlled fields and of undefined fields.
-
getAllowSetEnvelope
public static boolean getAllowSetEnvelope()
-
isValidEvent
public boolean isValidEvent()
Determine if this event is valid
-
validateFieldName
public static boolean validateFieldName(java.lang.String name) throws BrokerException
Check if field name is valid- Throws:
BrokerException
-
validateFieldNameChars
public static boolean validateFieldNameChars(char[] c) throws BrokerException
- Throws:
BrokerException
-
validateEventTypeName
public static void validateEventTypeName(java.lang.String event_type_name) throws BrokerException
Check if event name is valid- Throws:
BrokerException
-
isReservedWord
public static boolean isReservedWord(java.lang.String st)
Check if a name is a reserved word
-
isExtendedReservedWord
public static boolean isExtendedReservedWord(java.lang.String st)
Check if a name is an extended reserved word
-
-