Interface Record
-
- All Known Implementing Classes:
AbstractRecord
,AppendRecord
,ReadRecord
public interface Record
Record interface.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
cancelUpdate()
Cancel the changes made to an appended record.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.NodeId
readNodeId()
Read aNodeId
from the underlying stream.QNodeTypeDefinition
readNodeTypeDef()
Read aNodeTypeDef
from the underlying stream.Path
readPath()
Read aPath
from the underlying stream.Path
readPathElement()
Read a named path element from the underlying stream.PrivilegeDefinition
readPrivilegeDef()
Read aPrivilegeDefinition
from the underlying stream.PropertyId
readPropertyId()
Read aPropertyId
from the underlying stream.Name
readQName()
Read aName
frmo the underlying stream.String
readString()
Read a string from the underlying stream.long
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)
Write a byte to the underlying stream.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
writeNodeId(NodeId nodeId)
Write aNodeId
to the underlying stream.void
writeNodeTypeDef(QNodeTypeDefinition ntd)
Write aNodeTypeDef
to the underlying stream.void
writePath(Path path)
Write aPath
to the underlying stream.void
writePathElement(Path element)
Write aPath.Element
to the underlying stream.void
writePrivilegeDef(PrivilegeDefinition privilegeDefinition)
Write aPrivilegeDefinition
to the underlying stream.void
writePropertyId(PropertyId propertyId)
Write aPropertyId
to the underlying stream.void
writeQName(Name name)
Write aName
to the underlying stream.void
writeString(String s)
Write a string to the underlying stream.
-
-
-
Method Detail
-
getRevision
long getRevision()
Returns the revision this record represents.- Returns:
- revision
-
getJournalId
String getJournalId()
Return this record's journal identifier.- Returns:
- journal identifier
-
getProducerId
String getProducerId()
Return this record's producer identifier.- Returns:
- producer identifier
-
readByte
byte readByte() throws JournalException
Read a byte from the underlying stream.- Returns:
- byte
- Throws:
JournalException
- if an error occurs
-
readChar
char readChar() throws JournalException
Read a character from the underlying stream.- Returns:
- character
- Throws:
JournalException
- if an error occurs
-
readBoolean
boolean readBoolean() throws JournalException
Read a boolean from the underlying stream.- Returns:
- boolean
- Throws:
JournalException
- if an error occurs
-
readInt
int readInt() throws JournalException
Read an integer from the underlying stream.- Returns:
- integer
- Throws:
JournalException
- if an error occurs
-
readLong
long readLong() throws JournalException
Read a long from the underlying stream.- Returns:
- long value.
- Throws:
JournalException
- if an error occurs
-
readString
String readString() throws JournalException
Read a string from the underlying stream.- Returns:
- string or
null
- Throws:
JournalException
- if an error occurs
-
readFully
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
-
readQName
Name readQName() throws JournalException
Read aName
frmo the underlying stream.- Returns:
- name name
- Throws:
JournalException
- if an error occurs
-
readPathElement
Path readPathElement() throws JournalException
Read a named path element from the underlying stream.- Returns:
- path element
- Throws:
JournalException
- if an error occurs
-
readPath
Path readPath() throws JournalException
Read aPath
from the underlying stream.- Returns:
- path
- Throws:
JournalException
- if an error occurs
-
readNodeId
NodeId readNodeId() throws JournalException
Read aNodeId
from the underlying stream.- Returns:
- node id
- Throws:
JournalException
- if an error occurs
-
readPropertyId
PropertyId readPropertyId() throws JournalException
Read aPropertyId
from the underlying stream.- Returns:
- property id
- Throws:
JournalException
- if an error occurs
-
readNodeTypeDef
QNodeTypeDefinition readNodeTypeDef() throws JournalException
Read aNodeTypeDef
from the underlying stream.- Returns:
- node type definition
- Throws:
JournalException
- if an error occurs
-
readPrivilegeDef
PrivilegeDefinition readPrivilegeDef() throws JournalException
Read aPrivilegeDefinition
from the underlying stream.- Returns:
- privilege definition
- Throws:
JournalException
- if an error occurs
-
writeByte
void writeByte(int n) throws JournalException
Write a byte to the underlying stream.- Parameters:
n
- byte- Throws:
JournalException
- if an error occurs
-
writeChar
void writeChar(char c) throws JournalException
Write a character to the underlying stream.- Parameters:
c
- character- Throws:
JournalException
- if an error occurs
-
writeBoolean
void writeBoolean(boolean b) throws JournalException
Write a boolean from the underlying stream.- Parameters:
b
- boolean- Throws:
JournalException
- if an error occurs
-
writeInt
void writeInt(int n) throws JournalException
Write an integer to the underlying stream.- Parameters:
n
- integer- Throws:
JournalException
- if an error occurs
-
writeLong
void writeLong(long n) throws JournalException
Write a long to the underlying stream.- Parameters:
n
- long- Throws:
JournalException
- if an error occurs
-
writeString
void writeString(String s) throws JournalException
Write a string to the underlying stream.- Parameters:
s
- string, may benull
- Throws:
JournalException
- if an error occurs
-
write
void write(byte[] b) throws JournalException
Write an array of bytes to the underlying stream.- Parameters:
b
- byte array- Throws:
JournalException
- if an error occurs
-
writeQName
void writeQName(Name name) throws JournalException
Write aName
to the underlying stream.- Parameters:
name
- name- Throws:
JournalException
- if an error occurs
-
writePathElement
void writePathElement(Path element) throws JournalException
Write aPath.Element
to the underlying stream.- Parameters:
element
- path element- Throws:
JournalException
- if an error occurs
-
writePath
void writePath(Path path) throws JournalException
Write aPath
to the underlying stream.- Parameters:
path
- path- Throws:
JournalException
- if an error occurs
-
writeNodeId
void writeNodeId(NodeId nodeId) throws JournalException
Write aNodeId
to the underlying stream.- Parameters:
nodeId
- node id- Throws:
JournalException
- if an error occurs
-
writePropertyId
void writePropertyId(PropertyId propertyId) throws JournalException
Write aPropertyId
to the underlying stream.- Parameters:
propertyId
- property id- Throws:
JournalException
- if an error occurs
-
writeNodeTypeDef
void writeNodeTypeDef(QNodeTypeDefinition ntd) throws JournalException
Write aNodeTypeDef
to the underlying stream.- Parameters:
ntd
- node type definition- Throws:
JournalException
- if an error occurs
-
writePrivilegeDef
void writePrivilegeDef(PrivilegeDefinition privilegeDefinition) throws JournalException
Write aPrivilegeDefinition
to the underlying stream.- Parameters:
privilegeDefinition
- privilege definition- Throws:
JournalException
- if an error occurs
-
update
long update() throws JournalException
Update the changes made to an appended record. This will also update this record's revision.- Returns:
- The update size in bytes.
- Throws:
JournalException
- if this record has not been appended, or if another error occurs
-
cancelUpdate
void cancelUpdate()
Cancel the changes made to an appended record.
-
-