Saros
Distributed Collaborative Editing and Distributed Party Programming
|
Public Member Functions | |
synchronized void | addProject (String id, IProject project, boolean isPartially) |
synchronized void | removeProject (String id) |
synchronized void | addResources (IProject project, Collection<?extends IResource > resources) |
synchronized void | removeResources (IProject project, Collection<?extends IResource > resources) |
synchronized void | removeAndAddResources (IProject project, Collection<?extends IResource > resourcesToRemove, Collection<?extends IResource > resourcesToAdd) |
synchronized String | getID (IProject project) |
synchronized IProject | getProject (String id) |
synchronized boolean | isShared (IResource resource) |
synchronized Set< IProject > | getProjects () |
synchronized List< IResource > | getPartiallySharedResources () |
synchronized int | size () |
synchronized Map< IProject, List< IResource > > | getProjectResourceMapping () |
synchronized boolean | isCompletelyShared (IProject project) |
synchronized boolean | isPartiallyShared (IProject project) |
synchronized boolean | userHasProject (User user, IProject project) |
synchronized void | addMissingProjectsToUser (User user) |
void | userLeft (User user) |
Package Functions | |
SarosProjectMapper () |
This class is responsible for mapping global project IDs to local IProject projects}.
The IDs are used to identify shared projects across the network, even when the local names of shared projects are different. The ID is determined by the project/file-host.
de.fu_berlin.inf.dpp.project.internal.SarosProjectMapper.SarosProjectMapper | ( | ) | [package] |
synchronized void de.fu_berlin.inf.dpp.project.internal.SarosProjectMapper.addMissingProjectsToUser | ( | User | user | ) |
Adds all missing projects to the projects of the given user. This should be called once the user started queuing.
user |
synchronized void de.fu_berlin.inf.dpp.project.internal.SarosProjectMapper.addProject | ( | String | id, |
IProject | project, | ||
boolean | isPartially | ||
) |
Adds a project to the currently shared projects.
It is possible to "upgrade" a partially shared project to a completely shared project by just adding the same project with the same ID again that must now marked as not partially shared.
id | the ID for the project |
project | the project to add |
isPartially | true if the project should be treated as a partially shared project, false if it should be treated as completely shared |
NullPointerException | if the id or project is null |
IllegalStateException | if the id is already in use or the project was already added |
synchronized void de.fu_berlin.inf.dpp.project.internal.SarosProjectMapper.addResources | ( | IProject | project, |
Collection<?extends IResource > | resources | ||
) |
Adds the given resources to a partially shared project.
project | a project that was added as a partially shared project |
resources | the resources to add |
synchronized String de.fu_berlin.inf.dpp.project.internal.SarosProjectMapper.getID | ( | IProject | project | ) |
Returns the project ID for the shared project.
project | the project to lookup the ID for |
null
if the project is not shared synchronized List<IResource> de.fu_berlin.inf.dpp.project.internal.SarosProjectMapper.getPartiallySharedResources | ( | ) |
Returns all resources from all partially shared projects.
synchronized IProject de.fu_berlin.inf.dpp.project.internal.SarosProjectMapper.getProject | ( | String | id | ) |
Returns the shared project for the given ID.
id |
null
if no shared project is registered with this ID synchronized Map<IProject, List<IResource> > de.fu_berlin.inf.dpp.project.internal.SarosProjectMapper.getProjectResourceMapping | ( | ) |
Returns a mapping for each shared project and its containing resources. The resource list is always null
for completely shared projects.
synchronized Set<IProject> de.fu_berlin.inf.dpp.project.internal.SarosProjectMapper.getProjects | ( | ) |
Returns the currently shared projects.
synchronized boolean de.fu_berlin.inf.dpp.project.internal.SarosProjectMapper.isCompletelyShared | ( | IProject | project | ) |
Checks if a project is completely shared.
project | the project to check |
true
if the project is completely shared, false
if the project is not or partially shared synchronized boolean de.fu_berlin.inf.dpp.project.internal.SarosProjectMapper.isPartiallyShared | ( | IProject | project | ) |
Checks if a project is partially shared.
project | the project to check |
true
if the project is partially shared, false
if the project is not or completely shared synchronized boolean de.fu_berlin.inf.dpp.project.internal.SarosProjectMapper.isShared | ( | IResource | resource | ) |
Returns if the given resource is included in one of the currently shared projects.
resource |
synchronized void de.fu_berlin.inf.dpp.project.internal.SarosProjectMapper.removeAndAddResources | ( | IProject | project, |
Collection<?extends IResource > | resourcesToRemove, | ||
Collection<?extends IResource > | resourcesToAdd | ||
) |
Atomically removes and adds resources. The resources to remove will be removed first before the resources to add will be added.
project | a project that was added as a partially shared project |
resourcesToRemove | the resources to remove |
resourcesToAdd | the resources to add |
synchronized void de.fu_berlin.inf.dpp.project.internal.SarosProjectMapper.removeProject | ( | String | id | ) |
Removes a project from the currently shared projects. Does nothing if the project is not shared.
id | the id of the project to remove |
synchronized void de.fu_berlin.inf.dpp.project.internal.SarosProjectMapper.removeResources | ( | IProject | project, |
Collection<?extends IResource > | resources | ||
) |
Removes the given resources from a partially shared project.
project | a project that was added as a partially shared project |
resources | the resources to remove |
synchronized int de.fu_berlin.inf.dpp.project.internal.SarosProjectMapper.size | ( | ) |
Returns the current amount of shared projects.
synchronized boolean de.fu_berlin.inf.dpp.project.internal.SarosProjectMapper.userHasProject | ( | User | user, |
IProject | project | ||
) |
Checks if the given user already has the given project.
user | The user to be checked |
project | The project to be checked |
void de.fu_berlin.inf.dpp.project.internal.SarosProjectMapper.userLeft | ( | User | user | ) |
Removes the user-project mapping of the user that left the session.