Class ClusterRecord
- java.lang.Object
-
- org.apache.jackrabbit.core.cluster.ClusterRecord
-
- Direct Known Subclasses:
ChangeLogRecord,LockRecord,NamespaceRecord,NodeTypeRecord,PrivilegeRecord,WorkspaceRecord
public abstract class ClusterRecord extends Object
Base cluster record. Used to serialize and deserialize cluster operations using journal records.
-
-
Field Summary
Fields Modifier and Type Field Description protected static charEND_MARKEREnd marker.protected RecordrecordJournal record.protected StringworkspaceWorkspace name.
-
Constructor Summary
Constructors Modifier Constructor Description protectedClusterRecord(Record record)Create a new instance of this class.protectedClusterRecord(Record record, String workspace)Create a new instance of this class.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidcancelUpdate()Cancel updating the record.protected abstract voiddoRead()Deserialize this record.protected abstract voiddoWrite()Serialize this record.longgetRevision()Return the record revision.StringgetWorkspace()Return the workspace name.abstract voidprocess(ClusterRecordProcessor processor)Process this record, calling the appropriateprocessmethod.voidread()Deserialize this record.protected voidreadEndMarker()Read end marker.voidupdate()Update the record.voidwrite()Serialize this record.
-
-
-
Field Detail
-
END_MARKER
protected static final char END_MARKER
End marker.- See Also:
- Constant Field Values
-
record
protected final Record record
Journal record.
-
workspace
protected String workspace
Workspace name.
-
-
Constructor Detail
-
ClusterRecord
protected ClusterRecord(Record record, String workspace)
Create a new instance of this class.- Parameters:
record- journal recordworkspace- workspace
-
ClusterRecord
protected ClusterRecord(Record record)
Create a new instance of this class. Used for records that do not have a workspace name.- Parameters:
record- journal record
-
-
Method Detail
-
read
public final void read() throws JournalExceptionDeserialize this record.- Throws:
JournalException- if an error occurs
-
doRead
protected abstract void doRead() throws JournalExceptionDeserialize this record. Subclass responsibility.- Throws:
JournalException- if an error occurs
-
write
public final void write() throws JournalExceptionSerialize this record.- Throws:
JournalException- if an error occurs
-
doWrite
protected abstract void doWrite() throws JournalExceptionSerialize this record. Subclass responsibility.- Throws:
JournalException- if an error occurs
-
readEndMarker
protected void readEndMarker() throws JournalExceptionRead end marker.- Throws:
JournalException- if an error occurs
-
process
public abstract void process(ClusterRecordProcessor processor)
Process this record, calling the appropriateprocessmethod.- Parameters:
processor- processor
-
update
public void update() throws JournalExceptionUpdate the record.- Throws:
JournalException- if an error occurs- See Also:
Record.update()
-
cancelUpdate
public void cancelUpdate()
Cancel updating the record.- See Also:
Record.cancelUpdate()
-
getRevision
public long getRevision()
Return the record revision.- Returns:
- record revision
- See Also:
Record.getRevision()
-
getWorkspace
public String getWorkspace()
Return the workspace name.- Returns:
- workspace name
-
-