org.apache.jackrabbit.core.cluster
Class ClusterRecord

java.lang.Object
  extended by org.apache.jackrabbit.core.cluster.ClusterRecord
Direct Known Subclasses:
ChangeLogRecord, LockRecord, NamespaceRecord, NodeTypeRecord, WorkspaceRecord

public abstract class ClusterRecord
extends Object

Base cluster record. Used to serialize and deserialize cluster operations using journal records.


Field Summary
protected static char END_MARKER
          End marker.
protected  Record record
          Journal record.
protected  String workspace
          Workspace name.
 
Constructor Summary
protected ClusterRecord(Record record)
          Create a new instance of this class.
protected ClusterRecord(Record record, String workspace)
          Create a new instance of this class.
 
Method Summary
 void cancelUpdate()
          Cancel updating the record.
protected abstract  void doRead()
          Deserialize this record.
protected abstract  void doWrite()
          Serialize this record.
 long getRevision()
          Return the record revision.
 String getWorkspace()
          Return the workspace name.
abstract  void process(ClusterRecordProcessor processor)
          Process this record, calling the appropriate process method.
 void read()
          Deserialize this record.
protected  void readEndMarker()
          Read end marker.
 void update()
          Update the record.
 void write()
          Serialize this record.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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 record
workspace - 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 JournalException
Deserialize this record.

Throws:
JournalException - if an error occurs

doRead

protected abstract void doRead()
                        throws JournalException
Deserialize this record. Subclass responsibility.

Throws:
JournalException - if an error occurs

write

public final void write()
                 throws JournalException
Serialize this record.

Throws:
JournalException - if an error occurs

doWrite

protected abstract void doWrite()
                         throws JournalException
Serialize this record. Subclass responsibility.

Throws:
JournalException - if an error occurs

readEndMarker

protected void readEndMarker()
                      throws JournalException
Read end marker.

Throws:
JournalException - if an error occurs

process

public abstract void process(ClusterRecordProcessor processor)
Process this record, calling the appropriate process method.

Parameters:
processor - processor

update

public void update()
            throws JournalException
Update 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


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