Saros
Distributed Collaborative Editing and Distributed Party Programming
de.fu_berlin.inf.dpp.negotiation.IncomingProjectNegotiation Class Reference
Inheritance diagram for de.fu_berlin.inf.dpp.negotiation.IncomingProjectNegotiation:
de.fu_berlin.inf.dpp.negotiation.ProjectNegotiation de.fu_berlin.inf.dpp.negotiation.CancelableProcess

List of all members.

Classes

class  ArchiveTransferListener

Public Member Functions

 IncomingProjectNegotiation (ISarosSession session, JID peer, String negotiationID, List< ProjectNegotiationData > projectInfos, ISarosContext sarosContext)
Map< String, String > getProjectNames ()
FileList getRemoteFileList (String projectID)
Status run (Map< String, IProject > projectMapping, final IProgressMonitor monitor, boolean useVersionControl)
boolean isPartialRemoteProject (String projectID)
synchronized boolean remoteCancel (String errorMsg)
synchronized boolean localCancel (String errorMsg, CancelOption cancelOption)
List< ProjectNegotiationDatagetProjectInfos ()
String toString ()

Protected Member Functions

void executeCancellation ()

Constructor & Destructor Documentation

de.fu_berlin.inf.dpp.negotiation.IncomingProjectNegotiation.IncomingProjectNegotiation ( ISarosSession  session,
JID  peer,
String  negotiationID,
List< ProjectNegotiationData projectInfos,
ISarosContext  sarosContext 
)

Member Function Documentation

void de.fu_berlin.inf.dpp.negotiation.IncomingProjectNegotiation.executeCancellation ( ) [protected, virtual]

This method is called after terminateProcess decides to perform a cleanup because the execution of the process was canceled. Implementing classes should try a maximum effort to revert all the changes that were made before the process was aborted.

Implements de.fu_berlin.inf.dpp.negotiation.CancelableProcess.

List<ProjectNegotiationData> de.fu_berlin.inf.dpp.negotiation.IncomingProjectNegotiation.getProjectInfos ( )
Map<String, String> de.fu_berlin.inf.dpp.negotiation.IncomingProjectNegotiation.getProjectNames ( ) [virtual]
Returns:
the names of the projects that are shared by the peer. projectID => projectName

Implements de.fu_berlin.inf.dpp.negotiation.ProjectNegotiation.

FileList de.fu_berlin.inf.dpp.negotiation.IncomingProjectNegotiation.getRemoteFileList ( String  projectID)
Parameters:
projectID
Returns:
The fileList which belongs to the project with the ID projectID from inviter
null if there isn't such a fileList
boolean de.fu_berlin.inf.dpp.negotiation.IncomingProjectNegotiation.isPartialRemoteProject ( String  projectID)
synchronized boolean de.fu_berlin.inf.dpp.negotiation.IncomingProjectNegotiation.localCancel ( String  errorMessage,
CancelOption  cancelOption 
)

Informs the current process that it should cancel its operation as soon as possible. Calling this method multiple times will NOT override the error message or the cancel option. This method will also have NO effect if a remote cancellation request was already executed.

Parameters:
errorMessagethe reason to cancel the execution in case of an error or null if this is a normal cancel request
cancelOptioneither CancelOption#NOTIFY_PEER to inform the remote side of the cancellation or CancelOption#DO_NOT_NOTIFY_PEER
Returns:
true if this request was the first cancel request, false otherwise
See also:
remoteCancel
checkCancellation
notifyCancellation

Reimplemented from de.fu_berlin.inf.dpp.negotiation.CancelableProcess.

synchronized boolean de.fu_berlin.inf.dpp.negotiation.IncomingProjectNegotiation.remoteCancel ( String  errorMessage)

Informs the current process that it should cancel its operation as soon as possible. Calling this method multiple times will NOT override the error message. This method will also have NO effect if a local cancellation request was already executed.

Parameters:
errorMessagethe reason to cancel the execution in case of an error or null if this is a cancel abort request
Returns:
true if this request was the first cancel request, false otherwise
See also:
localCancel
checkCancellation
notifyCancellation

Reimplemented from de.fu_berlin.inf.dpp.negotiation.CancelableProcess.

Status de.fu_berlin.inf.dpp.negotiation.IncomingProjectNegotiation.run ( Map< String, IProject projectMapping,
final IProgressMonitor  monitor,
boolean  useVersionControl 
)

Starts the negotiation. The negotiation can be aborted by canceling the given monitor. The execution of this method perform changes to the file system! It is the responsibility of the caller to ensure that appropriate actions are performed to avoid unintended data loss, i.e this method will do a best effort to backup altered data but no guarantee can be made in doing so!

Parameters:
projectMappingmapping from remote project ids to the target local projects
Exceptions:
IllegalArgumentExceptionif either a project id is not valid or the referenced project for that id does not exist
String de.fu_berlin.inf.dpp.negotiation.IncomingProjectNegotiation.toString ( )
 All Classes Namespaces Files Functions Variables Enumerations