Saros
Distributed Collaborative Editing and Distributed Party Programming
de.fu_berlin.inf.dpp.project.SarosSessionManager Class Reference
Inheritance diagram for de.fu_berlin.inf.dpp.project.SarosSessionManager:
de.fu_berlin.inf.dpp.session.ISarosSessionManager

List of all members.

Public Member Functions

 SarosSessionManager (XMPPConnectionService connectionService, SarosSessionObservable sarosSessionObservable, SessionNegotiationObservable currentSessionNegotiations, ProjectNegotiationObservable currentProjectNegotiations, ITransmitter transmitter, IReceiver receiver, 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 user)
void sessionStarting (ISarosSession sarosSession)
void sessionStarted (ISarosSession sarosSession)
void projectAdded (String projectID)

Detailed Description

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.

Author:
rdjemili

Constructor & Destructor Documentation

de.fu_berlin.inf.dpp.project.SarosSessionManager.SarosSessionManager ( XMPPConnectionService  connectionService,
SarosSessionObservable  sarosSessionObservable,
SessionNegotiationObservable  currentSessionNegotiations,
ProjectNegotiationObservable  currentProjectNegotiations,
ITransmitter  transmitter,
IReceiver  receiver,
Preferences  preferences 
)

Member Function Documentation

void de.fu_berlin.inf.dpp.project.SarosSessionManager.addResourcesToSession ( Map< IProject, List< IResource >>  projectResourcesMapping)

Adds project resources to an existing session.

Parameters:
projectResourcesMapping

Implements de.fu_berlin.inf.dpp.session.ISarosSessionManager.

void de.fu_berlin.inf.dpp.project.SarosSessionManager.addSarosSessionListener ( ISarosSessionListener  listener)

Add the given session listener.

Parameters:
listenerthe listener that is to be added.

Implements de.fu_berlin.inf.dpp.session.ISarosSessionManager.

ISarosSession de.fu_berlin.inf.dpp.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.

Deprecated:
Error prone method, which produces NPE if not handled correctly. Will soon get removed.

Implements de.fu_berlin.inf.dpp.session.ISarosSessionManager.

void de.fu_berlin.inf.dpp.project.SarosSessionManager.incomingProjectReceived ( JID  from,
List< ProjectNegotiationData projectInfos,
String  processID 
)

This method is called when a new project was added to the session

Parameters:
fromThe one who added the project.
projectInfoswhat projects where added (FileList, projectName etc.) see: ProjectNegotiationData
processIDID of the exchanging process

Implements de.fu_berlin.inf.dpp.session.ISarosSessionManager.

void de.fu_berlin.inf.dpp.project.SarosSessionManager.invitationReceived ( JID  from,
String  sessionID,
String  invitationID,
String  version,
String  description 
)

Handles the negotiation process for a received invitation.

Parameters:
fromthe sender of this invitation
sessionIDthe unique session ID of the inviter side
invitationIDa unique identifier for the negotiation process
versionremote Saros version of the inviter side
descriptionwhat this session invitation is about
Deprecated:
will be removed from the interface - do not use in new code

Implements de.fu_berlin.inf.dpp.session.ISarosSessionManager.

void de.fu_berlin.inf.dpp.project.SarosSessionManager.invite ( Collection< JID jidsToInvite,
String  description 
)

Invites users to the shared project.

Parameters:
jidsToInvitethe JIDs of the users that should be invited.

Implements de.fu_berlin.inf.dpp.session.ISarosSessionManager.

void de.fu_berlin.inf.dpp.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.

Parameters:
toInvitethe JID of the user that is to be invited.

Implements de.fu_berlin.inf.dpp.session.ISarosSessionManager.

ISarosSession de.fu_berlin.inf.dpp.project.SarosSessionManager.joinSession ( String  id,
JID  host,
String  clientNickname,
String  hostNickname,
int  clientColor,
int  hostColor 
)
void de.fu_berlin.inf.dpp.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.project.SarosSessionManager.projectAdded ( String  projectID)

Call this when a new project was added.

Parameters:
projectIDTODO

Implements de.fu_berlin.inf.dpp.session.ISarosSessionManager.

void de.fu_berlin.inf.dpp.project.SarosSessionManager.removeSarosSessionListener ( ISarosSessionListener  listener)

Removes the given session listener.

Parameters:
listenerthe listener that is to be removed.

Implements de.fu_berlin.inf.dpp.session.ISarosSessionManager.

void de.fu_berlin.inf.dpp.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.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.project.SarosSessionManager.setNegotiationHandler ( INegotiationHandler  handler)
void de.fu_berlin.inf.dpp.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.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.

Parameters:
userJID of session participant to share projects with

Implements de.fu_berlin.inf.dpp.session.ISarosSessionManager.

void de.fu_berlin.inf.dpp.project.SarosSessionManager.stopSarosSession ( )
 All Classes Namespaces Files Functions Variables Enumerations