Interface TransformerData

    • Method Detail

      • getDSDataPointer

        long getDSDataPointer()

        Gets the pointer to the C ds_data struct that holds the state information for the update. This method is used internally by the TransformerData.

        Once the update has been sent, pointer is nulled down, and this method will throw a IllegalStateException.

        Returns:
        The pointer to the ds_data struct.
        Throws:
        java.lang.IllegalStateException - If the update has already been sent using either the DSPacket.send() or send(int) methods.
      • setType

        void setType​(ObjectType objectType)

        Sets the update's object type to the specified type.

        Parameters:
        objectType - The type of object.
        Throws:
        java.lang.NullPointerException - If the objectType is null.
      • getObjectType

        ObjectType getObjectType()

        Gets the update's object type.

        Returns:
        The ObjectType that represents the object type for this update.
      • getSequenceNumber

        int getSequenceNumber()

        Gets the update's sequence number.

        Returns:
        the sequence number of the update.
      • merge

        int merge​(TransformerData transformerDataToMerge)

        Merges the fields from the specified TransformerData with those in this TransformerData. If a field does not exist within this TransformerData then the field will be added to it. If the field already exists, then its value will be updated.

        If a field exists multiple times (as occurs with type 2 and type 3 records), only the first occurrence will be merged.

        Parameters:
        transformerDataToMerge - The TransformerData from which the fields should be merged from.
        Returns:
        The number of fields that were updated.
      • send

        void send​(int flags)

        Sends the update to the Transformer core. The specified flags will determine what the core does with the update.

        As soon as the update is sent, its memory is freed by the Transformer core. Any further attempts to use the object will result in IllegalStateExceptions being thrown. If the update needs to be sent, then further changes made to the object, the DSFactory.createTransformerData(TransformerData) method should be used to create a copy of the object before the update is sent.

        The valid flags are:

        • NO_FLAGS
        • STORE_IN_CACHE
        • PUBLISH_TO_PEERS
        • SILENT_SEND
        • MAINTAIN_TIMESTAMP
        Parameters:
        flags - The flags that should be passed to the Transformer core to tell it how to process the update.
        Throws:
        java.lang.IllegalStateException - If the update has already been sent.