Saros
Distributed Collaborative Editing and Distributed Party Programming
|
Public Member Functions | |
SarosSessionManager (XMPPConnectionService connectionService, SarosSessionObservable sarosSessionObservable, SessionIDObservable sessionID, SessionNegotiationObservable currentSessionNegotiations, ProjectNegotiationObservable currentProjectNegotiations, Preferences preferences) | |
void | setNegotiationHandler (INegotiationHandler handler) |
void | startSession (final Map< IProject, List< IResource >> projectResourcesMapping) |
ISarosSession | joinSession (String id, JID host, String clientNickname, String hostNickname, int clientColor, int hostColor) |
void | stopSarosSession () |
ISarosSession | getSarosSession () |
void | invitationReceived (JID from, String sessionID, String invitationID, String version, String description) |
void | incomingProjectReceived (JID from, List< ProjectNegotiationData > projectInfos, String processID) |
void | invite (JID toInvite, String description) |
void | invite (Collection< JID > jidsToInvite, String description) |
void | addResourcesToSession (Map< IProject, List< IResource >> projectResourcesMapping) |
void | startSharingProjects (JID user) |
void | addSarosSessionListener (ISarosSessionListener listener) |
void | removeSarosSessionListener (ISarosSessionListener listener) |
void | postOutgoingInvitationCompleted (IProgressMonitor monitor, User newUser) |
void | sessionStarting (ISarosSession sarosSession) |
void | sessionStarted (ISarosSession sarosSession) |
void | projectAdded (String projectID) |
The SessionManager is responsible for initiating new Saros sessions and for reacting to invitations. The user can be only part of one session at most.
de.fu_berlin.inf.dpp.core.project.SarosSessionManager.SarosSessionManager | ( | XMPPConnectionService | connectionService, |
SarosSessionObservable | sarosSessionObservable, | ||
SessionIDObservable | sessionID, | ||
SessionNegotiationObservable | currentSessionNegotiations, | ||
ProjectNegotiationObservable | currentProjectNegotiations, | ||
Preferences | preferences | ||
) |
void de.fu_berlin.inf.dpp.core.project.SarosSessionManager.addResourcesToSession | ( | Map< IProject, List< IResource >> | projectResourcesMapping | ) |
Adds project resources to an existing session.
projectResourcesMapping |
Implements de.fu_berlin.inf.dpp.session.ISarosSessionManager.
void de.fu_berlin.inf.dpp.core.project.SarosSessionManager.addSarosSessionListener | ( | ISarosSessionListener | listener | ) |
Add the given session listener.
listener | the listener that is to be added. |
Implements de.fu_berlin.inf.dpp.session.ISarosSessionManager.
ISarosSession de.fu_berlin.inf.dpp.core.project.SarosSessionManager.getSarosSession | ( | ) |
This method and the sarosSessionObservable are dangerous to use. The session might be in the process of being destroyed while you call this method. The caller needs to save the returned value to a local variable and do a null check. For new code you should consider being scoped by the SarosSession and get the SarosSession in the constructor.
Implements de.fu_berlin.inf.dpp.session.ISarosSessionManager.
void de.fu_berlin.inf.dpp.core.project.SarosSessionManager.incomingProjectReceived | ( | JID | from, |
List< ProjectNegotiationData > | projectInfos, | ||
String | processID | ||
) |
This method is called when a new project was added to the session
from | The one who added the project. |
projectInfos | what projects where added (FileList, projectName etc.) see: ProjectNegotiationData |
processID | ID of the exchanging process |
Implements de.fu_berlin.inf.dpp.session.ISarosSessionManager.
void de.fu_berlin.inf.dpp.core.project.SarosSessionManager.invitationReceived | ( | JID | from, |
String | sessionID, | ||
String | invitationID, | ||
String | version, | ||
String | description | ||
) |
Handles the negotiation process for a received invitation.
from | the sender of this invitation |
sessionID | the unique session ID of the inviter side |
invitationID | a unique identifier for the negotiation process |
version | remote Saros version of the inviter side |
description | what this session invitation is about |
Implements de.fu_berlin.inf.dpp.session.ISarosSessionManager.
void de.fu_berlin.inf.dpp.core.project.SarosSessionManager.invite | ( | Collection< JID > | jidsToInvite, |
String | description | ||
) |
Invites users to the shared project.
jidsToInvite | the JIDs of the users that should be invited. |
Implements de.fu_berlin.inf.dpp.session.ISarosSessionManager.
void de.fu_berlin.inf.dpp.core.project.SarosSessionManager.invite | ( | JID | toInvite, |
String | description | ||
) |
Invites a user to a running session. Does nothing if no session is running, the user is already part of the session or is currently in the invitation process.
toInvite | the JID of the user that is to be invited. |
Implements de.fu_berlin.inf.dpp.session.ISarosSessionManager.
ISarosSession de.fu_berlin.inf.dpp.core.project.SarosSessionManager.joinSession | ( | String | id, |
JID | host, | ||
String | clientNickname, | ||
String | hostNickname, | ||
int | clientColor, | ||
int | hostColor | ||
) |
void de.fu_berlin.inf.dpp.core.project.SarosSessionManager.postOutgoingInvitationCompleted | ( | IProgressMonitor | monitor, |
User | newUser | ||
) |
Call this on the host after the invitation was accepted and has been completed.
Implements de.fu_berlin.inf.dpp.session.ISarosSessionManager.
void de.fu_berlin.inf.dpp.core.project.SarosSessionManager.projectAdded | ( | String | projectID | ) |
Call this when a new project was added.
projectID | TODO |
Implements de.fu_berlin.inf.dpp.session.ISarosSessionManager.
void de.fu_berlin.inf.dpp.core.project.SarosSessionManager.removeSarosSessionListener | ( | ISarosSessionListener | listener | ) |
Removes the given session listener.
listener | the listener that is to be removed. |
Implements de.fu_berlin.inf.dpp.session.ISarosSessionManager.
void de.fu_berlin.inf.dpp.core.project.SarosSessionManager.sessionStarted | ( | ISarosSession | sarosSession | ) |
Call this after a ISarosSession has been started.
Implements de.fu_berlin.inf.dpp.session.ISarosSessionManager.
void de.fu_berlin.inf.dpp.core.project.SarosSessionManager.sessionStarting | ( | ISarosSession | sarosSession | ) |
Call this before a ISarosSession is started.
Implements de.fu_berlin.inf.dpp.session.ISarosSessionManager.
void de.fu_berlin.inf.dpp.core.project.SarosSessionManager.setNegotiationHandler | ( | INegotiationHandler | handler | ) |
void de.fu_berlin.inf.dpp.core.project.SarosSessionManager.startSession | ( | final Map< IProject, List< IResource >> | projectResourcesMapping | ) |
3, Invitation Process:
This class manages the current Saros session.
Saros makes a distinction between a session and a shared project. A session is an on-line collaboration between users which allows users to carry out activities. The main activity is to share projects. Hence, before you share a project, a session has to be started and all users added to it.
(At the moment, this separation is invisible to the user. He/she must share a project in order to start a session.)
void de.fu_berlin.inf.dpp.core.project.SarosSessionManager.startSharingProjects | ( | JID | user | ) |
Will start sharing all projects of the current session with a participant. This should be called after a the invitation to a session was completed successfully.
user | JID of session participant to share projects with |
Implements de.fu_berlin.inf.dpp.session.ISarosSessionManager.
void de.fu_berlin.inf.dpp.core.project.SarosSessionManager.stopSarosSession | ( | ) |