Interface Record
-
- All Known Implementing Classes:
AbstractRecord,AppendRecord,ReadRecord
public interface RecordRecord interface.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidcancelUpdate()Cancel the changes made to an appended record.StringgetJournalId()Return this record's journal identifier.StringgetProducerId()Return this record's producer identifier.longgetRevision()Returns the revision this record represents.booleanreadBoolean()Read a boolean from the underlying stream.bytereadByte()Read a byte from the underlying stream.charreadChar()Read a character from the underlying stream.voidreadFully(byte[] b)Fully read an array of bytes from the underlying stream.intreadInt()Read an integer from the underlying stream.longreadLong()Read a long from the underlying stream.NodeIdreadNodeId()Read aNodeIdfrom the underlying stream.QNodeTypeDefinitionreadNodeTypeDef()Read aNodeTypeDeffrom the underlying stream.PathreadPath()Read aPathfrom the underlying stream.PathreadPathElement()Read a named path element from the underlying stream.PrivilegeDefinitionreadPrivilegeDef()Read aPrivilegeDefinitionfrom the underlying stream.PropertyIdreadPropertyId()Read aPropertyIdfrom the underlying stream.NamereadQName()Read aNamefrmo the underlying stream.StringreadString()Read a string from the underlying stream.longupdate()Update the changes made to an appended record.voidwrite(byte[] b)Write an array of bytes to the underlying stream.voidwriteBoolean(boolean b)Write a boolean from the underlying stream.voidwriteByte(int n)Write a byte to the underlying stream.voidwriteChar(char c)Write a character to the underlying stream.voidwriteInt(int n)Write an integer to the underlying stream.voidwriteLong(long n)Write a long to the underlying stream.voidwriteNodeId(NodeId nodeId)Write aNodeIdto the underlying stream.voidwriteNodeTypeDef(QNodeTypeDefinition ntd)Write aNodeTypeDefto the underlying stream.voidwritePath(Path path)Write aPathto the underlying stream.voidwritePathElement(Path element)Write aPath.Elementto the underlying stream.voidwritePrivilegeDef(PrivilegeDefinition privilegeDefinition)Write aPrivilegeDefinitionto the underlying stream.voidwritePropertyId(PropertyId propertyId)Write aPropertyIdto the underlying stream.voidwriteQName(Name name)Write aNameto the underlying stream.voidwriteString(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 JournalExceptionRead a byte from the underlying stream.- Returns:
- byte
- Throws:
JournalException- if an error occurs
-
readChar
char readChar() throws JournalExceptionRead a character from the underlying stream.- Returns:
- character
- Throws:
JournalException- if an error occurs
-
readBoolean
boolean readBoolean() throws JournalExceptionRead a boolean from the underlying stream.- Returns:
- boolean
- Throws:
JournalException- if an error occurs
-
readInt
int readInt() throws JournalExceptionRead an integer from the underlying stream.- Returns:
- integer
- Throws:
JournalException- if an error occurs
-
readLong
long readLong() throws JournalExceptionRead 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 JournalExceptionFully 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 aNamefrmo 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 aPathfrom the underlying stream.- Returns:
- path
- Throws:
JournalException- if an error occurs
-
readNodeId
NodeId readNodeId() throws JournalException
Read aNodeIdfrom the underlying stream.- Returns:
- node id
- Throws:
JournalException- if an error occurs
-
readPropertyId
PropertyId readPropertyId() throws JournalException
Read aPropertyIdfrom the underlying stream.- Returns:
- property id
- Throws:
JournalException- if an error occurs
-
readNodeTypeDef
QNodeTypeDefinition readNodeTypeDef() throws JournalException
Read aNodeTypeDeffrom the underlying stream.- Returns:
- node type definition
- Throws:
JournalException- if an error occurs
-
readPrivilegeDef
PrivilegeDefinition readPrivilegeDef() throws JournalException
Read aPrivilegeDefinitionfrom the underlying stream.- Returns:
- privilege definition
- Throws:
JournalException- if an error occurs
-
writeByte
void writeByte(int n) throws JournalExceptionWrite a byte to the underlying stream.- Parameters:
n- byte- Throws:
JournalException- if an error occurs
-
writeChar
void writeChar(char c) throws JournalExceptionWrite a character to the underlying stream.- Parameters:
c- character- Throws:
JournalException- if an error occurs
-
writeBoolean
void writeBoolean(boolean b) throws JournalExceptionWrite a boolean from the underlying stream.- Parameters:
b- boolean- Throws:
JournalException- if an error occurs
-
writeInt
void writeInt(int n) throws JournalExceptionWrite an integer to the underlying stream.- Parameters:
n- integer- Throws:
JournalException- if an error occurs
-
writeLong
void writeLong(long n) throws JournalExceptionWrite 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 JournalExceptionWrite 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 aNameto the underlying stream.- Parameters:
name- name- Throws:
JournalException- if an error occurs
-
writePathElement
void writePathElement(Path element) throws JournalException
Write aPath.Elementto the underlying stream.- Parameters:
element- path element- Throws:
JournalException- if an error occurs
-
writePath
void writePath(Path path) throws JournalException
Write aPathto the underlying stream.- Parameters:
path- path- Throws:
JournalException- if an error occurs
-
writeNodeId
void writeNodeId(NodeId nodeId) throws JournalException
Write aNodeIdto the underlying stream.- Parameters:
nodeId- node id- Throws:
JournalException- if an error occurs
-
writePropertyId
void writePropertyId(PropertyId propertyId) throws JournalException
Write aPropertyIdto the underlying stream.- Parameters:
propertyId- property id- Throws:
JournalException- if an error occurs
-
writeNodeTypeDef
void writeNodeTypeDef(QNodeTypeDefinition ntd) throws JournalException
Write aNodeTypeDefto the underlying stream.- Parameters:
ntd- node type definition- Throws:
JournalException- if an error occurs
-
writePrivilegeDef
void writePrivilegeDef(PrivilegeDefinition privilegeDefinition) throws JournalException
Write aPrivilegeDefinitionto the underlying stream.- Parameters:
privilegeDefinition- privilege definition- Throws:
JournalException- if an error occurs
-
update
long update() throws JournalExceptionUpdate 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.
-
-