Saros
Distributed Collaborative Editing and Distributed Party Programming
|
Central part of an SXE session that maintains the document.
To its functionalities belongs:
de.fu_berlin.inf.dpp.whiteboard.sxe.SXEController.SXEController | ( | ISXERecordFactory | factory | ) |
boolean de.fu_berlin.inf.dpp.whiteboard.sxe.SXEController.apply | ( | RecordDataObject | rdo | ) | [protected] |
This method attempts to convert a RecordDataObject to the corresponding record that will be applied then.
If a RecordDataObject is not casual ready (parent, target or predecessor SetRecord is missing), it will be queued. The only exception are SetRecords during start synchronization where missing records (==version) are expected due to possible previous conflicts.
rdo |
boolean de.fu_berlin.inf.dpp.whiteboard.sxe.SXEController.apply | ( | IRecord | record | ) | [protected] |
Attempts to apply the passed record. If successful it will apply all queued records that became casual ready now.
record |
void de.fu_berlin.inf.dpp.whiteboard.sxe.SXEController.applyLocallyAndsentConflictingSetRecord | ( | SetRecord | toConflict | ) | [protected] |
This method sends a SetRecord to all peers that conflicts with the provided one so that this will be reverted to a previous version. This may be necessary, if due to concurrent SetRecords the XML document would not be well-formed anymore due to a circular relationship.
toConflict |
void de.fu_berlin.inf.dpp.whiteboard.sxe.SXEController.applyNullRecord | ( | SetRecord | toConflict | ) | [protected] |
void de.fu_berlin.inf.dpp.whiteboard.sxe.SXEController.applyQueuedRecords | ( | IRecord | cause | ) | [protected] |
Checks whether the provided record makes any queue record casual ready.
cause |
void de.fu_berlin.inf.dpp.whiteboard.sxe.SXEController.clear | ( | ) |
void de.fu_berlin.inf.dpp.whiteboard.sxe.SXEController.commitRecords | ( | List< IRecord > | recordsToSend | ) |
Pack the records in a message and send it to all peers in the session
recordsToSend |
void de.fu_berlin.inf.dpp.whiteboard.sxe.SXEController.dispose | ( | ) |
final void de.fu_berlin.inf.dpp.whiteboard.sxe.SXEController.executeAndCommit | ( | List< IRecord > | records | ) |
This method is to be used by commands to apply locally created records.
It will apply them, notify local listeners and if applying was successful transmit them to the peers.
records |
void de.fu_berlin.inf.dpp.whiteboard.sxe.SXEController.executeRemoteRecords | ( | SXEMessage | message | ) |
Attempts to apply the records of a remote message
message | message containing records to apply |
DocumentRecord de.fu_berlin.inf.dpp.whiteboard.sxe.SXEController.getDocumentRecord | ( | ) |
ISXERecordFactory de.fu_berlin.inf.dpp.whiteboard.sxe.SXEController.getRecordFactory | ( | ) |
SXESession de.fu_berlin.inf.dpp.whiteboard.sxe.SXEController.getSession | ( | ) |
State de.fu_berlin.inf.dpp.whiteboard.sxe.SXEController.getState | ( | ) |
ISXETransmitter de.fu_berlin.inf.dpp.whiteboard.sxe.SXEController.getTransmitter | ( | ) |
boolean de.fu_berlin.inf.dpp.whiteboard.sxe.SXEController.handleVersionDiff | ( | SetRecord | r, |
boolean | startSync | ||
) | [protected] |
Method to take actions if a remote SetRecord has wrong version.
This may be expected behavior:
During start synchronization SetRecords may be missing (received version is too big) because they were discarded remotely due to previous conflicts.
In a session, there may arise conflicts (received version is too small).
Everything else is an error, while no action has to be taken during start synchronization but remote records must be queued to wait for the SetRecord with the missing version to arrive.
r | |
startSync |
void de.fu_berlin.inf.dpp.whiteboard.sxe.SXEController.initDocument | ( | ) | [protected] |
void de.fu_berlin.inf.dpp.whiteboard.sxe.SXEController.initNetwork | ( | ISXETransmitter | transmitter | ) |
boolean de.fu_berlin.inf.dpp.whiteboard.sxe.SXEController.isConnected | ( | ) |
String de.fu_berlin.inf.dpp.whiteboard.sxe.SXEController.prefix | ( | ) |
void de.fu_berlin.inf.dpp.whiteboard.sxe.SXEController.setDisconnected | ( | ) |
void de.fu_berlin.inf.dpp.whiteboard.sxe.SXEController.startSession | ( | SXEMessage | message | ) |
Accepts a remote state and applies it to this controller, discarding the previous content.
Queues messages will be applied afterwards and the lists is cleared.
message | the state message |
void de.fu_berlin.inf.dpp.whiteboard.sxe.SXEController.startSession | ( | ) |
Initializes the session as host and starts to receive records from NOW.
boolean de.fu_berlin.inf.dpp.whiteboard.sxe.SXEController.switchToConnectingState | ( | SXESession | session | ) |
Attempts to change the state to State#CONNECTING. If successful, this will initialize to receive remote records from NOW.
session |
List<SXEMessage> de.fu_berlin.inf.dpp.whiteboard.sxe.SXEController.queuedMessagesWhileSynchronizing = new LinkedList<SXEMessage>() [protected] |
a factory to create custom record instances
SXESession de.fu_berlin.inf.dpp.whiteboard.sxe.SXEController.session = null [protected] |
MappedList<SetRecord> de.fu_berlin.inf.dpp.whiteboard.sxe.SXEController.unappliedBigVersionSetRecords = new MappedList<SetRecord>() [protected] |
A predecessor of these SetRecords is missing
MappedList<RecordDataObject> de.fu_berlin.inf.dpp.whiteboard.sxe.SXEController.unappliedMissingTargetRecords = new MappedList<RecordDataObject>() [protected] |
A target of a record is missing and it is supposed to be "on the way"