Saros
Distributed Collaborative Editing and Distributed Party Programming
|
TODO Review if SarosSession, ConcurrentDocumentManager, ActivitySequencer all honor start() and stop() semantics.
de.fu_berlin.inf.dpp.project.internal.SarosSession.SarosSession | ( | final String | id, |
String | nickname, | ||
int | colorID, | ||
ISarosContext | sarosContext | ||
) |
Constructor for host.
de.fu_berlin.inf.dpp.project.internal.SarosSession.SarosSession | ( | final String | id, |
JID | hostJID, | ||
String | clientNickname, | ||
String | hostNickname, | ||
int | clientColorID, | ||
int | hostColorID, | ||
ISarosContext | sarosContext | ||
) |
Constructor for client.
void de.fu_berlin.inf.dpp.project.internal.SarosSession.addActivityConsumer | ( | IActivityConsumer | consumer | ) |
Adds an IActivityConsumer so it will be called when an activity is to be executed locally.
consumer | The exec() method of this consumer will be called. "Consume" is not meant in a destructive way: all consumers will be called for every activity. |
Implements de.fu_berlin.inf.dpp.session.ISarosSession.
void de.fu_berlin.inf.dpp.project.internal.SarosSession.addActivityProducer | ( | IActivityProducer | producer | ) |
Adds an IActivityProducer so the production of its activities will be noticed.
producer | The session will register an IActivityListener on this producer. It is expected that the producer will inform that listener about new activities via created(). |
Implements de.fu_berlin.inf.dpp.session.ISarosSession.
void de.fu_berlin.inf.dpp.project.internal.SarosSession.addListener | ( | ISharedProjectListener | listener | ) |
Adds the given shared project listener. This call is ignored if the listener is already a listener of this session.
listener | The listener that is to be added. |
Implements de.fu_berlin.inf.dpp.session.ISarosSession.
void de.fu_berlin.inf.dpp.project.internal.SarosSession.addProjectMapping | ( | String | projectID, |
IProject | project | ||
) |
Stores a bidirectional mapping between project
and projectID
.
This information is necessary for receiving (unserializing) resource-related activities.
projectID | Session-wide ID of the project |
project | the local representation of the project |
Implements de.fu_berlin.inf.dpp.session.ISarosSession.
void de.fu_berlin.inf.dpp.project.internal.SarosSession.addSharedResources | ( | IProject | project, |
String | projectID, | ||
List< IResource > | dependentResources | ||
) |
Adds the specified project and/or resources to this session.
project | The project to share. |
projectID | The global project ID. |
dependentResources | The project dependent resources. |
Implements de.fu_berlin.inf.dpp.session.ISarosSession.
void de.fu_berlin.inf.dpp.project.internal.SarosSession.addUser | ( | final User | user | ) |
void de.fu_berlin.inf.dpp.project.internal.SarosSession.changeColor | ( | int | colorID | ) |
Changes the color for the current session. The color change is performed on the session host and may therefore result in a different color id.
colorID | the new color id that should be used during the session |
Implements de.fu_berlin.inf.dpp.session.ISarosSession.
void de.fu_berlin.inf.dpp.project.internal.SarosSession.disableQueuing | ( | ) |
FOR INTERNAL USE ONLY !
Disables queuing for all shared projects and flushes all queued activities.
Implements de.fu_berlin.inf.dpp.session.ISarosSession.
void de.fu_berlin.inf.dpp.project.internal.SarosSession.enableQueuing | ( | IProject | project | ) |
FOR INTERNAL USE ONLY !
Starts queuing of incoming IResourceActivity project-related activities}, since they cannot be applied before their corresponding project is received and extracted.
That queuing relies on an existing project-to-projectID mapping (see addProjectMapping(String, IProject, JID)), otherwise incoming activities cannot be queued and will be lost.
project | the project for which project-related activities should be queued |
Implements de.fu_berlin.inf.dpp.session.ISarosSession.
void de.fu_berlin.inf.dpp.project.internal.SarosSession.exec | ( | List< IActivity > | activities | ) |
7, Activity sending, Incoming activities:
The ActivitySequencer will call this function for activities received over the Network Layer.
Implements de.fu_berlin.inf.dpp.session.ISarosSession.
Object de.fu_berlin.inf.dpp.project.internal.SarosSession.getComponent | ( | Object | key | ) |
Returns the session runtime component with the given key.
key | the key of the component |
null
if the component is either not available or does not existsImplements de.fu_berlin.inf.dpp.session.ISarosSession.
ConcurrentDocumentClient de.fu_berlin.inf.dpp.project.internal.SarosSession.getConcurrentDocumentClient | ( | ) |
the concurrent document manager is responsible for all jupiter controlled documents
Implements de.fu_berlin.inf.dpp.session.ISarosSession.
ConcurrentDocumentServer de.fu_berlin.inf.dpp.project.internal.SarosSession.getConcurrentDocumentServer | ( | ) |
the concurrent document manager is responsible for all jupiter controlled documents
Implements de.fu_berlin.inf.dpp.session.ISarosSession.
User de.fu_berlin.inf.dpp.project.internal.SarosSession.getHost | ( | ) |
Returns the host of this session.
This method will always return the same value for this session
Implements de.fu_berlin.inf.dpp.session.ISarosSession.
String de.fu_berlin.inf.dpp.project.internal.SarosSession.getID | ( | ) |
Returns the id of the current session.
Implements de.fu_berlin.inf.dpp.session.ISarosSession.
User de.fu_berlin.inf.dpp.project.internal.SarosSession.getLocalUser | ( | ) |
Returns the local user of this session.
This method will always return the same value for this session
Implements de.fu_berlin.inf.dpp.session.ISarosSession.
IProject de.fu_berlin.inf.dpp.project.internal.SarosSession.getProject | ( | String | projectID | ) |
Returns the project with the given ID.
null
if no project with this ID is shared Implements de.fu_berlin.inf.dpp.session.ISarosSession.
String de.fu_berlin.inf.dpp.project.internal.SarosSession.getProjectID | ( | IProject | project | ) |
Returns the global ID of the project.
null
if this project is not shared Implements de.fu_berlin.inf.dpp.session.ISarosSession.
Map<IProject, List<IResource> > de.fu_berlin.inf.dpp.project.internal.SarosSession.getProjectResourcesMapping | ( | ) |
Returns a map with the mapping of shared resources to their project.
Implements de.fu_berlin.inf.dpp.session.ISarosSession.
Set<IProject> de.fu_berlin.inf.dpp.project.internal.SarosSession.getProjects | ( | ) |
null
but may be empty Implements de.fu_berlin.inf.dpp.session.ISarosSession.
List<User> de.fu_berlin.inf.dpp.project.internal.SarosSession.getRemoteUsers | ( | ) |
Implements de.fu_berlin.inf.dpp.session.ISarosSession.
List<User> de.fu_berlin.inf.dpp.project.internal.SarosSession.getRemoteUsersWithReadOnlyAccess | ( | ) |
Returns all users in this project which are both remotely and have Permission#READONLY_ACCESS right now.
This is a snapshot copy. This list does not change if users' Permission change.
There is no guarantee that the users in this list will be part of the project after you exit the SWT thread context.
Implements de.fu_berlin.inf.dpp.session.ISarosSession.
List<User> de.fu_berlin.inf.dpp.project.internal.SarosSession.getRemoteUsersWithWriteAccess | ( | ) |
Given a JID (resource qualified or not), will return the resource qualified JID associated with this user or null
if no user for the given JID exists in the session.
E.g:
JID rqJID = session.getResourceQualifiedJID(new JID("alice@foo.com");
System.out.println(rqJID);
Will print out something like alice@foo.com/Saros*****
jid | the JID to retrieve the resource qualified JID for |
null
if no user is found with this JID Implements de.fu_berlin.inf.dpp.session.ISarosSession.
List<IResource> de.fu_berlin.inf.dpp.project.internal.SarosSession.getSharedResources | ( | ) |
Returns all shared resources in this session.
Implements de.fu_berlin.inf.dpp.session.ISarosSession.
List<IResource> de.fu_berlin.inf.dpp.project.internal.SarosSession.getSharedResources | ( | IProject | project | ) |
Returns the shared resources of the project in this session.
project |
null
if this project is not or fully shared. Implements de.fu_berlin.inf.dpp.session.ISarosSession.
StopManager de.fu_berlin.inf.dpp.project.internal.SarosSession.getStopManager | ( | ) |
Return the stop manager of this session.
Implements de.fu_berlin.inf.dpp.session.ISarosSession.
Set<Integer> de.fu_berlin.inf.dpp.project.internal.SarosSession.getUnavailableColors | ( | ) |
Returns a snapshot of the currently unavailable (in use) color ids.
Implements de.fu_berlin.inf.dpp.session.ISarosSession.
Given a resource qualified JID, this method will return the user which has the identical ID including resource.
Use getResourceQualifiedJID(JID) in the case if you do not know the RQ-JID.
null
if not user with such a JID exists in the session Implements de.fu_berlin.inf.dpp.session.ISarosSession.
List<User> de.fu_berlin.inf.dpp.project.internal.SarosSession.getUsers | ( | ) |
Implements de.fu_berlin.inf.dpp.session.ISarosSession.
List<User> de.fu_berlin.inf.dpp.project.internal.SarosSession.getUsersWithReadOnlyAccess | ( | ) |
Returns a list of all users in this session have Permission#READONLY_ACCESS right now.
This is a snapshot copy. This list does not change if users' Permission change.
There is no guarantee that the users in this list will be part of the project after you exit the SWT thread context.
Implements de.fu_berlin.inf.dpp.session.ISarosSession.
List<User> de.fu_berlin.inf.dpp.project.internal.SarosSession.getUsersWithWriteAccess | ( | ) |
Returns a list of all users in this session which have Permission#WRITE_ACCESS right now.
This is a snapshot copy. This list does not change if users' Permission change.
There is no guarantee that the users in this list will be part of the project after you exit the SWT thread context.
Implements de.fu_berlin.inf.dpp.session.ISarosSession.
boolean de.fu_berlin.inf.dpp.project.internal.SarosSession.hasActivityConsumers | ( | ) | [package] |
This method is only meant to be used by unit tests to verify the cleanup of activity producers and consumers.
boolean de.fu_berlin.inf.dpp.project.internal.SarosSession.hasActivityProducers | ( | ) | [package] |
This method is only meant to be used by unit tests to verify the cleanup of activity producers and consumers.
boolean de.fu_berlin.inf.dpp.project.internal.SarosSession.hasExclusiveWriteAccess | ( | ) |
Implements de.fu_berlin.inf.dpp.session.ISarosSession.
boolean de.fu_berlin.inf.dpp.project.internal.SarosSession.hasWriteAccess | ( | ) |
true
if the local user has write access, false
otherwise Implements de.fu_berlin.inf.dpp.session.ISarosSession.
void de.fu_berlin.inf.dpp.project.internal.SarosSession.initiatePermissionChange | ( | final User | user, |
final Permission | newPermission | ||
) | throws CancellationException, InterruptedException |
boolean de.fu_berlin.inf.dpp.project.internal.SarosSession.isCompletelyShared | ( | IProject | project | ) |
Checks if selected project is a complete shared one or partial shared.
project |
true
if complete, false
if partial Implements de.fu_berlin.inf.dpp.session.ISarosSession.
boolean de.fu_berlin.inf.dpp.project.internal.SarosSession.isHost | ( | ) |
true
if the local user is the host of this session, false
otherwise. Implements de.fu_berlin.inf.dpp.session.ISarosSession.
boolean de.fu_berlin.inf.dpp.project.internal.SarosSession.isShared | ( | IResource | resource | ) |
true
if the given resource is currently shared in this session, false
otherwise Implements de.fu_berlin.inf.dpp.session.ISarosSession.
void de.fu_berlin.inf.dpp.project.internal.SarosSession.kickUser | ( | final User | user | ) |
void de.fu_berlin.inf.dpp.project.internal.SarosSession.removeActivityConsumer | ( | IActivityConsumer | consumer | ) |
Removes an IActivityConsumer from the session
consumer | This consumer will no longer be called when an activity is to be executed locally. |
Implements de.fu_berlin.inf.dpp.session.ISarosSession.
void de.fu_berlin.inf.dpp.project.internal.SarosSession.removeActivityProducer | ( | IActivityProducer | producer | ) |
Removes an IActivityProducer from the session.
producer | The session will unregister its IActivityListener from this producer and it is expected that the producer no longer calls created(). |
Implements de.fu_berlin.inf.dpp.session.ISarosSession.
void de.fu_berlin.inf.dpp.project.internal.SarosSession.removeListener | ( | ISharedProjectListener | listener | ) |
Removes the given shared project listener. This call is ignored if the listener does not belong to the current listeners of this session.
listener | the listener that is to be removed. |
Implements de.fu_berlin.inf.dpp.session.ISarosSession.
void de.fu_berlin.inf.dpp.project.internal.SarosSession.removeProjectMapping | ( | String | projectID, |
IProject | project | ||
) |
Removes the bidirectional mapping project
and projectId
that was created by addProjectMapping() .
TODO Why is the project parameter needed here? This forces callers to store the mapping themselves (or retrieve it just before calling this method).
projectID | Session-wide ID of the project |
project | the local representation of the project |
Implements de.fu_berlin.inf.dpp.session.ISarosSession.
void de.fu_berlin.inf.dpp.project.internal.SarosSession.removeUser | ( | final User | user | ) |
void de.fu_berlin.inf.dpp.project.internal.SarosSession.setPermission | ( | final User | user, |
final Permission | permission | ||
) |
void de.fu_berlin.inf.dpp.project.internal.SarosSession.start | ( | ) |
FOR INTERNAL USE ONLY !
Implements de.fu_berlin.inf.dpp.session.ISarosSession.
void de.fu_berlin.inf.dpp.project.internal.SarosSession.stop | ( | ) |
Stops this session and performing cleanup as necessary. All remote users will also be notified about the local session stop.
IllegalStateException | if the session is already stopped or was not started at all |
void de.fu_berlin.inf.dpp.project.internal.SarosSession.userFinishedProjectNegotiation | ( | final User | user | ) |
Informs all participants and listeners that a user now has finished the Project Negotiation.
user |
This informs all participants, that a user is now able to process IResourceActivities. After receiving this message the participants will send their awareness information.
Implements de.fu_berlin.inf.dpp.session.ISarosSession.
boolean de.fu_berlin.inf.dpp.project.internal.SarosSession.userHasProject | ( | User | user, |
IProject | project | ||
) |
Checks if the user is ready to process IResourceActivitys for a given project
Implements de.fu_berlin.inf.dpp.session.ISarosSession.
void de.fu_berlin.inf.dpp.project.internal.SarosSession.userStartedQueuing | ( | final User | user | ) |
Informs all listeners that a user now has Projects and can process IResourceActivitys.
This method may only called by the host.
user |
Updates the projects for the given user, so that host knows that he can now send ever Activity
Implements de.fu_berlin.inf.dpp.session.ISarosSession.
boolean de.fu_berlin.inf.dpp.project.internal.SarosSession.useVersionControl | ( | ) |
Returns true if VCS support is enabled for this session.
This setting can be changed in the Preferences. VCS support can be disabled during a running session, but enabling VCS support doesn't have any effect.
Implements de.fu_berlin.inf.dpp.session.ISarosSession.