Class DefaultChunkColumnValue

    • Constructor Detail

      • DefaultChunkColumnValue

        public DefaultChunkColumnValue​(java.lang.String columnName,
                                       oracle.sql.Datum columnData,
                                       int chunkType)
                                throws StreamsException
        Constructs a DefaultChunkColumnValue object with the column information.
        Parameters:
        columnName - The column name, cannot be NULL
        columnData - The column data, can be NULL. If NULL is used, a valid chunk type must be specified.
        chunkType - The chunk type as defined in ChunkColumnValue
        Throws:
        StreamsException - is thrown if columnName is NULL
      • DefaultChunkColumnValue

        public DefaultChunkColumnValue​(java.lang.String columnName,
                                       oracle.sql.Datum columnData,
                                       int chunkType,
                                       java.math.BigInteger chunkOffset,
                                       java.math.BigInteger chunkOperationSize)
                                throws StreamsException
        Constructs a DefaultChunkColumnValue object with the column information. as well as the offset and size.
        Parameters:
        columnName - The column name, cannot be NULL
        columnData - The column data, can be NULL. If NULL is used, a valid chunk type must be specified.
        chunkType - The chunk type as defined in ChunkColumnValue
        chunkOffset - The chunk operation offset
        chunkOperationSize - The chunk operation size
        Throws:
        StreamsException - is thrown if chunkType is invalid
    • Method Detail

      • getChunkType

        public int getChunkType()
        Gets the chunk type.
        Chunk type indicates the type of the column for which data can be divided into multiple chunks. Valid values are BLOB, CLOB, NCLOB, XMLTYPE or OSON (Oracle binary JSON format).
        Specified by:
        getChunkType in interface ChunkColumnValue
        Returns:
        A integer contains the chunk type as defined in ChunkColumnValue
      • setChunkType

        public void setChunkType​(int chunkType)
                          throws StreamsException
        Sets the chunk type.
        Chunk type is used to specify the type of the column for which data can be divided into mutliple chunks. Valid values are BLOB, CLOB, NCLOB, XMLTYPE or OSON (Oracle binary JSON format). See chunk type definition in ChunkColumnValue.
        Specified by:
        setChunkType in interface ChunkColumnValue
        Parameters:
        chunkType - The chunk type as defined in ChunkColumnValue
        Throws:
        StreamsException - is thrown if chunk type is unsupported
      • getUpdatedRowId

        public oracle.sql.Datum getUpdatedRowId()
        Gets the updated rowid after receiving all chunks for the row.
        The updated rowid is in oracle.sql.CHAR format. It is valid only when the chunk is the end of the entire row, otherwise it will be null.
        Specified by:
        getUpdatedRowId in interface ChunkColumnValue
        Returns:
        an datum object that contains the updated rowid
      • setUpdatedRowId

        public void setUpdatedRowId​(oracle.sql.Datum updatedRowId)
        Updates the rowid when chunk is the end of row.
        Specified by:
        setUpdatedRowId in interface ChunkColumnValue
        Parameters:
        updatedRowId - The updated rowid after all chunks
      • setColumnData

        public void setColumnData​(oracle.sql.Datum columnData)
        Sets the column data for a ChunkColumnValue.
        Column data in a chunk can be an instance of either oracle.sql.CHAR or oracle.sql.RAW.
        Parameters:
        columnData - The column data, instance of oracle.sql.Datum subclass.
      • setColumnData

        public void setColumnData​(oracle.sql.Datum columnData,
                                  int columnDataType)
                           throws StreamsException
        Sets the column data.
        This method overwrites the method defined in parent class ColumnValue.
        columnDataType is ignored in this class since the columnDataType can be derived from chunkType if it is a ChunkColumnValue object. The mapping is maintained internally.
        Specified by:
        setColumnData in interface ColumnValue
        Overrides:
        setColumnData in class DefaultColumnValue
        Parameters:
        columnData - The column data, instance of oracle.sql.Datum subclasses.
        columnDataType - The column data type as defined in ColumnValue.
        Throws:
        StreamsException - is thrown if the columnData is NULL and the columnDataType maintained internally is invalid.
      • getChunkOffset

        public java.math.BigInteger getChunkOffset()
        Gets the chunk operation offset.
        This method is used to obtain the offset information for piecewise LOB operations. For DML operations, NULL is returned.
        If there are multiple chunks for one LOB WRITE operation, only the offset of the first chunk is relevant.
        Specified by:
        getChunkOffset in interface ChunkColumnValue
        Returns:
        a BigInteger contains the chunk operation offset
      • getCharSetId

        public int getCharSetId()
        Gets the chunk character set identifier (ID) for an XMLTYPE chunk
        The character set ID indicates the character set used to interpret the XMLTYPE chunk data.
        Check oracle.sql.CharacterSet for the definition of Oracle CharacterSet Id.
        Specified by:
        getCharSetId in interface ChunkColumnValue
        Returns:
        An integer that indicates the character set
      • setChunkOffset

        public void setChunkOffset​(java.math.BigInteger chunkOffset)
        Sets the chunk operation offset.
        Setting the chunk operation offset is required for a piecwise LOB operation in which the offset indicates the starting point for the LOB operation. The offset value starts at 1.
        Specified by:
        setChunkOffset in interface ChunkColumnValue
        Parameters:
        chunkOffset - The chunk operation offset
      • getChunkOperationSize

        public java.math.BigInteger getChunkOperationSize()
        Gets the chunk operation size.
        Use this method to obtain the size information for piecewise LOB operations. For DML operations, NULL is returned.
        Specified by:
        getChunkOperationSize in interface ChunkColumnValue
        Returns:
        A BigInteger contains the chunk operation size
      • setChunkOperationSize

        public void setChunkOperationSize​(java.math.BigInteger chunkOperationSize)
        Sets the chunk operation size.
        Setting the chunk operation size is required for piecewise LOB ERASE and LOB TRIM operations. For LOB ERASE operations, the chunk operation size specifies the amount of data to erase. For LOB TRIM operations, the chunk operation size specified the amount of data to trim.
        Specified by:
        setChunkOperationSize in interface ChunkColumnValue
        Parameters:
        chunkOperationSize - The chunk operation size
      • isLastChunk

        public boolean isLastChunk()
        Indicates whether the chunk is the last one for the column.
        Specified by:
        isLastChunk in interface ChunkColumnValue
        Returns:
        a boolean flag indicates if this is the last chunk
      • isEmptyChunk

        public boolean isEmptyChunk()
        Indicates whether the chunk is empty. For a LOB column, an empty LOB is different from a column that contains a NULL.
        Specified by:
        isEmptyChunk in interface ChunkColumnValue
        Returns:
        a boolean flag indicates if this is an empty chunk
      • isXMLDiff

        public boolean isXMLDiff()
        Indicates whether the chunk is an XMLDiff.
        Specified by:
        isXMLDiff in interface ChunkColumnValue
        Returns:
        a boolean flag indicates if this is an XMLDiff
      • isJSONDiff

        public boolean isJSONDiff()
        Indicates whether the chunk is a JSONDiff.
        Specified by:
        isJSONDiff in interface ChunkColumnValue
        Returns:
        a boolean flag indicates if this is the end of row change.
      • isEndOfRow

        public boolean isEndOfRow()
        Indicates whether the chunk is the end of the entire row change.
        A chunk is the end of the entire row change if it is the last chunk for the last column in an LCR.
        Specified by:
        isEndOfRow in interface ChunkColumnValue
        Returns:
        True if this is the end of row change.
      • setLastChunk

        public void setLastChunk​(boolean lastChunk)
        Sets the last chunk flag.
        The last chunk flag indicates whether the chunk is the last one for the current column.
        Specified by:
        setLastChunk in interface ChunkColumnValue
        Parameters:
        lastChunk - The last chunk flag
      • setEmptyChunk

        public void setEmptyChunk​(boolean emptyChunk)
        Sets the empty chunk flag.
        The empty chunk flag indicates if the chunk contains an empty LOB. For LOB columns, an empty LOB column is different from a column with a NULL value. Use this method to indicate whether the column contains an empty LOB.
        Specified by:
        setEmptyChunk in interface ChunkColumnValue
        Parameters:
        emptyChunk - The empty chunk flag
      • setXMLDiff

        public void setXMLDiff​(boolean xmlDiff)
        Sets the XMLDiff flag.
        The XMLDiff flag indicates if the chunk contains an XMLDiff.
        Specified by:
        setXMLDiff in interface ChunkColumnValue
        Parameters:
        xmlDiff - The XMLDiff flag
      • setJSONDiff

        public void setJSONDiff​(boolean jsonDiff)
        Sets the JsonDiff flag.
        This flag indicates whether the JSON chunk is a JsonDiff.
        Specified by:
        setJSONDiff in interface ChunkColumnValue
        Parameters:
        jsonDiff - The XMLDiff flag
      • setEndOfRow

        public void setEndOfRow​(boolean endOfRow)
        Sets the endOfRow chunk flag.
        The endOfRow flag indicates whether the chunk is the last one for the last column in an LCR, which also indicates the end of the entire row change.
        Specified by:
        setEndOfRow in interface ChunkColumnValue
        Parameters:
        endOfRow - The endOfRow chunk flag
      • setCharSetId

        public void setCharSetId​(int charSetId)
        Sets the character set ID for an XMLTYPE chunk.
        Check oracle.sql.CharacterSet for the definition of Oracle CharacterSet Id.
        Specified by:
        setCharSetId in interface ChunkColumnValue
        Parameters:
        charSetId - The character set id