Class 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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • NativeEvent

        public NativeEvent​(java.lang.String eventTypeName)
      • NativeEvent

        public NativeEvent​(java.lang.String eventTypeName,
                           int initialCapacity)
    • 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
      • 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
      • 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
      • 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 set
        type - - 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 set
        type - - the field's type (see BrokerTypeDef.FIELD_TYPE_XXX)
        srcOffset - - offset of source array
        destOffset - - offset of dest sequence
        count - - the number of elements to set
        srcValue - - 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 set
        length - - 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 set
        length - - 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)