org.apache.jackrabbit.core.journal
Class ReadRecord

java.lang.Object
  extended by org.apache.jackrabbit.core.journal.AbstractRecord
      extended by org.apache.jackrabbit.core.journal.ReadRecord
All Implemented Interfaces:
Record

public class ReadRecord
extends AbstractRecord

Record used for reading.


Field Summary
 
Fields inherited from class org.apache.jackrabbit.core.journal.AbstractRecord
nsResolver, resolver
 
Constructor Summary
ReadRecord(String journalId, String producerId, long revision, DataInputStream dataIn, int length, NamespaceResolver resolver, NamePathResolver npResolver)
          Create a new instance of this class.
 
Method Summary
 void cancelUpdate()
          Cancel the changes made to an appended record.
 void close()
          Close this record, eventually skipping unconsumed bytes.
 String getJournalId()
          Return this record's journal identifier.
 String getProducerId()
          Return this record's producer identifier.
 long getRevision()
          Returns the revision this record represents.
 boolean readBoolean()
          Read a boolean from the underlying stream.
 byte readByte()
          Read a byte from the underlying stream.
 char readChar()
          Read a character from the underlying stream.
 void readFully(byte[] b)
          Fully read an array of bytes from the underlying stream.
 int readInt()
          Read an integer from the underlying stream.
 long readLong()
          Read a long from the underlying stream.
 String readString()
          Read a string from the underlying stream.
 void update()
          Update the changes made to an appended record.
 void write(byte[] b)
          Write an array of bytes to the underlying stream.
 void writeBoolean(boolean b)
          Write a boolean from the underlying stream.
 void writeByte(int n)
          Unsupported methods when appending.
 void writeChar(char c)
          Write a character to the underlying stream.
 void writeInt(int n)
          Write an integer to the underlying stream.
 void writeLong(long n)
          Write a long to the underlying stream.
 void writeQName(Name name)
          Write a Name to the underlying stream.
 void writeString(String s)
          Write a string to the underlying stream.
 
Methods inherited from class org.apache.jackrabbit.core.journal.AbstractRecord
readNodeId, readNodeTypeDef, readPath, readPathElement, readPropertyId, readQName, writeNodeId, writeNodeTypeDef, writePath, writePathElement, writePropertyId
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReadRecord

public ReadRecord(String journalId,
                  String producerId,
                  long revision,
                  DataInputStream dataIn,
                  int length,
                  NamespaceResolver resolver,
                  NamePathResolver npResolver)
Create a new instance of this class.

Method Detail

getJournalId

public String getJournalId()
Return this record's journal identifier.

Returns:
journal identifier

getProducerId

public String getProducerId()
Return this record's producer identifier.

Returns:
producer identifier

getRevision

public long getRevision()
Returns the revision this record represents.

Returns:
revision

readByte

public byte readByte()
              throws JournalException
Read a byte from the underlying stream.

Returns:
byte
Throws:
JournalException - if an error occurs

readChar

public char readChar()
              throws JournalException
Read a character from the underlying stream.

Returns:
character
Throws:
JournalException - if an error occurs

readBoolean

public boolean readBoolean()
                    throws JournalException
Read a boolean from the underlying stream.

Returns:
boolean
Throws:
JournalException - if an error occurs

readInt

public int readInt()
            throws JournalException
Read an integer from the underlying stream.

Returns:
integer
Throws:
JournalException - if an error occurs

readLong

public long readLong()
              throws JournalException
Read a long from the underlying stream.

Returns:
long value.
Throws:
JournalException - if an error occurs

readString

public String readString()
                  throws JournalException
Read a string from the underlying stream.

Returns:
string or null
Throws:
JournalException - if an error occurs

readFully

public void readFully(byte[] b)
               throws JournalException
Fully read an array of bytes from the underlying stream.

Parameters:
b - byte array
Throws:
JournalException - if an error occurs

close

public void close()
           throws IOException
Close this record, eventually skipping unconsumed bytes.

Throws:
IOException - if an I/O error occurs

writeByte

public void writeByte(int n)
               throws JournalException
Unsupported methods when appending.

Parameters:
n - byte
Throws:
JournalException - if an error occurs

writeChar

public void writeChar(char c)
               throws JournalException
Description copied from interface: Record
Write a character to the underlying stream.

Parameters:
c - character
Throws:
JournalException - if an error occurs

writeBoolean

public void writeBoolean(boolean b)
                  throws JournalException
Description copied from interface: Record
Write a boolean from the underlying stream.

Parameters:
b - boolean
Throws:
JournalException - if an error occurs

writeInt

public void writeInt(int n)
              throws JournalException
Description copied from interface: Record
Write an integer to the underlying stream.

Parameters:
n - integer
Throws:
JournalException - if an error occurs

writeLong

public void writeLong(long n)
               throws JournalException
Description copied from interface: Record
Write a long to the underlying stream.

Parameters:
n - long
Throws:
JournalException - if an error occurs

writeString

public void writeString(String s)
                 throws JournalException
Description copied from interface: Record
Write a string to the underlying stream.

Parameters:
s - string, may be null
Throws:
JournalException - if an error occurs

writeQName

public void writeQName(Name name)
                throws JournalException
Description copied from class: AbstractRecord
Write a Name to the underlying stream.

Specified by:
writeQName in interface Record
Overrides:
writeQName in class AbstractRecord
Parameters:
name - name
Throws:
JournalException - if an error occurs

write

public void write(byte[] b)
           throws JournalException
Description copied from interface: Record
Write an array of bytes to the underlying stream.

Parameters:
b - byte array
Throws:
JournalException - if an error occurs

update

public void update()
            throws JournalException
Description copied from interface: Record
Update the changes made to an appended record. This will also update this record's revision.

Throws:
JournalException - if this record has not been appended, or if another error occurs

cancelUpdate

public void cancelUpdate()
Description copied from interface: Record
Cancel the changes made to an appended record.



Copyright © 2004-2010 The Apache Software Foundation. All Rights Reserved.