Class LedgerEntry


  • public class LedgerEntry
    extends java.lang.Object
    Ledger entry. Its a simple tuple containing the ledger id, the entry-id, and the entry content.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      (package private) io.netty.buffer.ByteBuf data  
      (package private) long entryId  
      (package private) long ledgerId  
      (package private) long length  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      byte[] getEntry()
      Returns the content of the entry.
      io.netty.buffer.ByteBuf getEntryBuffer()
      Return the internal buffer that contains the entry payload.
      long getEntryId()  
      java.io.InputStream getEntryInputStream()
      Returns the content of the entry.
      long getLedgerId()  
      long getLength()  
      • Methods inherited from class java.lang.Object

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

      • ledgerId

        final long ledgerId
      • entryId

        final long entryId
      • length

        final long length
      • data

        io.netty.buffer.ByteBuf data
    • Method Detail

      • getLedgerId

        public long getLedgerId()
      • getEntryId

        public long getEntryId()
      • getLength

        public long getLength()
      • getEntry

        public byte[] getEntry()
        Returns the content of the entry. This method can be called only once. While using v2 wire protocol this method will automatically release the internal ByteBuf
        Returns:
        the content of the entry
        Throws:
        java.lang.IllegalStateException - if this method is called twice
      • getEntryInputStream

        public java.io.InputStream getEntryInputStream()
        Returns the content of the entry. This method can be called only once. While using v2 wire protocol this method will automatically release the internal ByteBuf when calling the close method of the returned InputStream
        Returns:
        an InputStream which gives access to the content of the entry
        Throws:
        java.lang.IllegalStateException - if this method is called twice
      • getEntryBuffer

        public io.netty.buffer.ByteBuf getEntryBuffer()
        Return the internal buffer that contains the entry payload.

        Note: Using v2 wire protocol it is responsibility of the caller to ensure to release the buffer after usage.

        Returns:
        a ByteBuf which contains the data
        Throws:
        java.lang.IllegalStateException - if the entry has been retrieved by getEntry() or getEntryInputStream().
        See Also:
        ClientConfiguration.setNettyUsePooledBuffers(boolean)