Saros
Distributed Collaborative Editing and Distributed Party Programming
de.fu_berlin.inf.dpp.stf.client.util.Util Class Reference

List of all members.

Static Public Member Functions

static void closeUnnecessaryViews (AbstractTester tester) throws RemoteException
static void openSarosView (AbstractTester tester) throws RemoteException
static void setUpSessionWithProjectAndFile (String projectName, String path, String content, AbstractTester inviter, AbstractTester...invitees) throws Exception
static void setUpSessionWithJavaProjectAndClass (String projectName, String packageName, String className, AbstractTester inviter, AbstractTester...invitees) throws Exception
static void setUpSessionWithJavaProjects (Map< String, List< String >> projectsPkgsClasses, AbstractTester inviter, AbstractTester...invitees)
static void createProjectWithEmptyFile (String projectName, String path, AbstractTester...testers) throws Exception
static void addProjectToSessionSequentially (String projectName, TypeOfCreateProject projectType, AbstractTester inviter, AbstractTester...invitees) throws Exception
static void buildSessionSequentially (String projectName, TypeOfCreateProject projectType, AbstractTester inviter, AbstractTester...invitees) throws Exception
static void buildSessionConcurrently (final String projectName, final TypeOfCreateProject projectType, AbstractTester inviter, AbstractTester...invitees) throws Exception
static void buildFileSessionConcurrently (final String projectName, String[] files, final TypeOfCreateProject projectType, AbstractTester inviter, AbstractTester...invitees) throws Exception
static void activateFollowMode (final AbstractTester followedParticipant, AbstractTester...participants) throws Exception
static void addTestersToContactList (AbstractTester tester, AbstractTester...testers) throws Exception
static void removeTestersFromContactList (AbstractTester tester, AbstractTester...testers) throws Exception
static void addTestersToSession (final String projectName, final TypeOfCreateProject projectType, AbstractTester inviter, AbstractTester...invitees) throws Exception
static String[] getBaseJID (AbstractTester...tester)
static JID[] getJID (AbstractTester...tester)
static void grantWriteAccess (AbstractTester host, AbstractTester...testers) throws Exception
static void stopFollowModeSequentially (AbstractTester...testers) throws Exception
static void stopFollowModeConcurrently (AbstractTester...testers) throws Exception
static void reBuildSession (String projectName, AbstractTester inviter, AbstractTester...invitees) throws Exception
static String classPathToFilePath (String projectName, String pkg, String className)
static< T > List< T > workAll (List< Callable< T >> tasks)
static< T > List< T > workAll (List< Callable< T >> tasks, int numberOfThreads)
static boolean joinAll (long timeout, Thread...threads)

Member Function Documentation

static void de.fu_berlin.inf.dpp.stf.client.util.Util.activateFollowMode ( final AbstractTester  followedParticipant,
AbstractTester...  participants 
) throws Exception [static]

Activates the Follow mode feature. Activating Follow mode when the followed participant has no open editors results in failure of this method.

Parameters:
followedParticipantthe participant to follow e.g ALICE
participantsthe list of participants who want to activate Follow mode e.g BOB, CARL
Exceptions:
TimeoutExceptionif the follow participant has no editor open or the editor activity was not received yet
IllegalStateExceptionif the followed participant or one of the participants is not connected or not in a session
Exceptionfor any other (internal) failure
static void de.fu_berlin.inf.dpp.stf.client.util.Util.addProjectToSessionSequentially ( String  projectName,
TypeOfCreateProject  projectType,
AbstractTester  inviter,
AbstractTester...  invitees 
) throws Exception [static]

Adds a project to the current session. This is done sequentially, so the project is send to the invitees one after another.

Note: Adding a project that is already shared or does not exist results in unexpected behavior.

Note: there is no guarantee that the project and its files are already shared after this method returns

Parameters:
projectNamethe name of the project
projectTypethe type of project that should be used on the invitee side e.g new, use existing ...
invitere.g. ALICE
inviteese.g. BOB, CARL
Exceptions:
IllegalStateExceptionif the inviter or one of the invitee is not connected or is not in a session
Exceptionfor any other (internal) failure
static void de.fu_berlin.inf.dpp.stf.client.util.Util.addTestersToContactList ( AbstractTester  tester,
AbstractTester...  testers 
) throws Exception [static]

Adds testers to the contact list of the tester. All testers will have the tester added to their contact list as well.

Parameters:
testerthe tester who wants to add testers to his contact list e.g ALICE
testersthe testers to add, e.g BOB, CARL
Exceptions:
IllegalStateExceptionif the tester or one of the testers is not connected
Exceptionfor any other (internal) failure
static void de.fu_berlin.inf.dpp.stf.client.util.Util.addTestersToSession ( final String  projectName,
final TypeOfCreateProject  projectType,
AbstractTester  inviter,
AbstractTester...  invitees 
) throws Exception [static]

Adds testers to the current session.

Note: there is no guarantee that the project and its files are already shared after this method returns

Parameters:
projectNamethe name of the project which must be shared in the current session
projectTypethe type of project that should be used on the invitee side e.g new, use existing ...
inviterthe test who must be host of the current session
inviteesthe testers you want to invite to your session
Exceptions:
IllegalStateExceptionif the inviter or one of the invitees is not connected, one of the invitee is already in a session or the inviter is not host
Exceptionfor any other (internal) failure
static void de.fu_berlin.inf.dpp.stf.client.util.Util.buildFileSessionConcurrently ( final String  projectName,
String[]  files,
final TypeOfCreateProject  projectType,
AbstractTester  inviter,
AbstractTester...  invitees 
) throws Exception [static]

Establish a Saros session with specific files of a project. All invitees are invited simultaneously.

Note: Establishing session with a project that is already shared or does not exist results in unexpected behavior.

Note: there is no guarantee that the project and its files are already shared after this method returns

Parameters:
projectNamethe name of the project to share
filesthe files of the project to share
projectTypethe type of project that should be used on the invitee side e.g new, use existing ...
invitere.g. ALICE
inviteese.g. BOB, CARL
Exceptions:
IllegalStateExceptionif the inviter or one of the invitee is not connected or is already in a session
Exceptionfor any other (internal) failure
static void de.fu_berlin.inf.dpp.stf.client.util.Util.buildSessionConcurrently ( final String  projectName,
final TypeOfCreateProject  projectType,
AbstractTester  inviter,
AbstractTester...  invitees 
) throws Exception [static]

Establish a Saros session with the given invitees. All invitees are invited simultaneously.

Note: Establishing session with a project that is already shared or does not exist results in unexpected behavior.

Note: there is no guarantee that the project and its files are already shared after this method returns

Parameters:
projectNamethe name of the project to share
projectTypethe type of project that should be used on the invitee side e.g new, use existing ...
invitere.g. ALICE
inviteese.g. BOB, CARL
Exceptions:
IllegalStateExceptionif the inviter or one of the invitee is not connected or is already in a session
Exceptionfor any other (internal) failure
static void de.fu_berlin.inf.dpp.stf.client.util.Util.buildSessionSequentially ( String  projectName,
TypeOfCreateProject  projectType,
AbstractTester  inviter,
AbstractTester...  invitees 
) throws Exception [static]

Establish a Saros session with the given invitees. Every invitee is invited one bye one.

Note: Establishing session with a project that is already shared or does not exist results in unexpected behavior.

Note: there is no guarantee that the project and its files are already shared after this method returns

Parameters:
projectNamethe name of the project to share
projectTypethe type of project that should be used on the invitee side e.g new, use existing ...
invitere.g. ALICE
inviteese.g. BOB, CARL
Exceptions:
IllegalStateExceptionif the inviter or one of the invitee is not connected or is already in a session
Exceptionfor any other (internal) failure
static String de.fu_berlin.inf.dpp.stf.client.util.Util.classPathToFilePath ( String  projectName,
String  pkg,
String  className 
) [static]

Converts a class path of and Eclipse JDT project to its real path.
E.g project name = foo, pkg = my.foo, className = HelloWorld will be converted to foo/src/my/foo/HelloWorld.java

Parameters:
projectNamethe name of an Eclipse project
pkga java package name
classNamea class name
Returns:
the path to that class
static void de.fu_berlin.inf.dpp.stf.client.util.Util.closeUnnecessaryViews ( AbstractTester  tester) throws RemoteException [static]

Closes the following views:

  1. Problems
  2. Javadoc
  3. Declaration
  4. Task List
  5. Outline
Parameters:
testerthe remote tester e.g ALICE
static void de.fu_berlin.inf.dpp.stf.client.util.Util.createProjectWithEmptyFile ( String  projectName,
String  path,
AbstractTester...  testers 
) throws Exception [static]

Creates a project with an empty file for every tester in his workspace. The project and the file must not exist.

Parameters:
projectNamethe name of the project
paththe path of the file e.g. foo/bar/readme.txt
testerse.g. ALICE, CARL
Exceptions:
Exceptionif a (internal) failure occurs
static String [] de.fu_berlin.inf.dpp.stf.client.util.Util.getBaseJID ( AbstractTester...  tester) [static]

Returns the base part of the JID from the tester.

Parameters:
testera list of tester
Returns:
the base part JIDs of the tester in the same order as in the tester list
static JID [] de.fu_berlin.inf.dpp.stf.client.util.Util.getJID ( AbstractTester...  tester) [static]

Returns the JID from the tester.

Parameters:
testera list of tester
Returns:
the JIDs of the tester in the same order as in the tester list
static void de.fu_berlin.inf.dpp.stf.client.util.Util.grantWriteAccess ( AbstractTester  host,
AbstractTester...  testers 
) throws Exception [static]

Grants write access to the given testers.

Parameters:
hostthe host of the current session, e.g ALICE
testerstesters that are in the current session and should gain write access, e.g BOB, CARL
Exceptions:
IllegalStateExceptionif the host or one of the participants is not connected or is not in a session or the host is not host of the current session host
Exceptionfor any other (internal) failure
static boolean de.fu_berlin.inf.dpp.stf.client.util.Util.joinAll ( long  timeout,
Thread...  threads 
) [static]

Waits until all threads terminate.

Parameters:
timeouthow long to wait in milliseconds until timeout
threadsthe threads to observe
Returns:
true if all threads terminated, false if the timeout is exceeded
static void de.fu_berlin.inf.dpp.stf.client.util.Util.openSarosView ( AbstractTester  tester) throws RemoteException [static]

Opens the Saros view

Parameters:
testerthe remote tester e.g. ALICE
static void de.fu_berlin.inf.dpp.stf.client.util.Util.reBuildSession ( String  projectName,
AbstractTester  inviter,
AbstractTester...  invitees 
) throws Exception [static]

Rebuilds a session if necessary with the given testers. If the project does not exists on the inviter side an empty non Java Project will be created. Participants that are already (in a different) session will not be invited.

Note: there is no guarantee that the project and its files are already shared after this method returns

Note: calling this method with always different project names during a session will result in unexpected behavior

Parameters:
projectNamethe name of the project
invitere.g. ALICE
inviteese.g. BOB, CARL
Exceptions:
IllegalStateExceptionif the host or one of the participants is not connected
Exceptionfor any other (internal) failure
static void de.fu_berlin.inf.dpp.stf.client.util.Util.removeTestersFromContactList ( AbstractTester  tester,
AbstractTester...  testers 
) throws Exception [static]

Removes the given testers from the contact list of the tester. All testers will have the tester removed from their contact list as well.

Parameters:
testerthe tester who wants to remove testers from his contact list e.g ALICE
testersthe testers to remove, e.g BOB, CARL
Exceptions:
IllegalStateExceptionif the tester or one of the testers is not connected
Exceptionfor any other (internal) failure
static void de.fu_berlin.inf.dpp.stf.client.util.Util.setUpSessionWithJavaProjectAndClass ( String  projectName,
String  packageName,
String  className,
AbstractTester  inviter,
AbstractTester...  invitees 
) throws Exception [static]

A convenient function to quickly build a session with a java project and a class. The project is created by this method so it must not exist before. The invitiees are invited concurrently.

Note: there is no guarantee that the project and its files are already shared after this method returns

Parameters:
projectNamethe name of the project
packageNamethe name of the package
classNamethe name of the class without .java or .class suffix
invitere.g. ALICE
inviteese.g. BOB, CARL
Exceptions:
IllegalStateExceptionif the inviter or one of the invitee is not connected or is already in a session
Exceptionfor any other (internal) failure
static void de.fu_berlin.inf.dpp.stf.client.util.Util.setUpSessionWithJavaProjects ( Map< String, List< String >>  projectsPkgsClasses,
AbstractTester  inviter,
AbstractTester...  invitees 
) [static]
static void de.fu_berlin.inf.dpp.stf.client.util.Util.setUpSessionWithProjectAndFile ( String  projectName,
String  path,
String  content,
AbstractTester  inviter,
AbstractTester...  invitees 
) throws Exception [static]

A convenient function to quickly build a session with a project and a file. The project is created by this method so it must not exist before. The invitiees are invited concurrently.

Note: there is no guarantee that the project and its files are already shared after this method returns

Parameters:
projectNamethe name of the project
paththe path of the file e.g. foo/bar/readme.txt
contentthe content of the file
invitere.g. ALICE
inviteese.g. BOB, CARL
Exceptions:
IllegalStateExceptionif the inviter or one of the invitee is not connected or is already in a session
Exceptionfor any other (internal) failure
static void de.fu_berlin.inf.dpp.stf.client.util.Util.stopFollowModeConcurrently ( AbstractTester...  testers) throws Exception [static]

Stops the follow mode feature. This is done concurrently for all given testers.

Parameters:
testerstesters that are currently in the a session where follow mode should been stopped
Exceptions:
IllegalStateExceptionif one of the testers is not connected or not in a session
Exceptionfor any other (internal) failure
static void de.fu_berlin.inf.dpp.stf.client.util.Util.stopFollowModeSequentially ( AbstractTester...  testers) throws Exception [static]

Stops the follow mode feature for all given testers.

Parameters:
testerstesters that are currently in the a session where follow mode should been stopped
Exceptions:
IllegalStateExceptionif one of the testers is not connected or not in a session
Exceptionfor any other (internal) failure
static <T> List<T> de.fu_berlin.inf.dpp.stf.client.util.Util.workAll ( List< Callable< T >>  tasks,
int  numberOfThreads 
) [static]

Invokes all callable tasks in the list and returns when all tasks completed.

Parameters:
<T>
tasksa list containing callable tasks
numberOfThreadsthe number of threads to use to execute the tasks
Returns:
a list with the results of all tasks
static <T> List<T> de.fu_berlin.inf.dpp.stf.client.util.Util.workAll ( List< Callable< T >>  tasks) [static]

Invokes all callable tasks in the list and returns when all tasks completed.

Parameters:
<T>
tasksa list containing callable tasks
Returns:
a list with the results of all tasks
 All Classes Namespaces Files Functions Variables Enumerations