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

List of all members.

Public Member Functions

 ProjectNegotiation (final String negotiationID, final String sessionID, final JID peer, ISarosContext sarosContext)
abstract Map< String, String > getProjectNames ()
final String getID ()
final String getSessionID ()
final JID getPeer ()

Static Public Attributes

static final String ARCHIVE_TRANSFER_ID = "saros-dpp-pn-server-client-archive/"

Protected Member Functions

void notifyCancellation (SarosCancellationException exception)
void monitorFileTransfer (FileTransfer transfer, IProgressMonitor monitor) throws SarosCancellationException, IOException
final Packet collectPacket (PacketCollector collector, long timeout) throws SarosCancellationException
void notifyTerminated (NegotiationListener listener)

Protected Attributes

XMPPConnectionService connectionService
ITransmitter transmitter
IReceiver xmppReceiver
VCSProviderFactory vcsProviderFactory
final JID peer
FileTransferManager fileTransferManager
ISarosSessionManager sessionManager

Static Protected Attributes

static final String PATH_DELIMITER = ":"
static final long PACKET_TIMEOUT

Detailed Description

This abstract class is the superclass for OutgoingProjectNegotiation and IncomingProjectNegotiation.


Constructor & Destructor Documentation

de.fu_berlin.inf.dpp.negotiation.ProjectNegotiation.ProjectNegotiation ( final String  negotiationID,
final String  sessionID,
final JID  peer,
ISarosContext  sarosContext 
)

Member Function Documentation

final Packet de.fu_berlin.inf.dpp.negotiation.ProjectNegotiation.collectPacket ( PacketCollector  collector,
long  timeout 
) throws SarosCancellationException [protected]

Returns the next packet from a collector.

Parameters:
collectorthe collector to monitor
timeoutthe amount of time to wait for the next packet (in milliseconds)
Returns:
the collected packet or null if no packet was received
Exceptions:
SarosCancellationExceptionif the process was canceled
final String de.fu_berlin.inf.dpp.negotiation.ProjectNegotiation.getID ( )

Returns the ID of this negotiation.

Returns:
the ID
final JID de.fu_berlin.inf.dpp.negotiation.ProjectNegotiation.getPeer ( )
abstract Map<String, String> de.fu_berlin.inf.dpp.negotiation.ProjectNegotiation.getProjectNames ( ) [pure virtual]
final String de.fu_berlin.inf.dpp.negotiation.ProjectNegotiation.getSessionID ( )

Returns the ISarosSession session} id this negotiation belongs to.

Returns:
the id of the current session this negotiations belongs to
void de.fu_berlin.inf.dpp.negotiation.ProjectNegotiation.monitorFileTransfer ( FileTransfer  transfer,
IProgressMonitor  monitor 
) throws SarosCancellationException, IOException [protected]

Monitors a FileTransfer and waits until it is completed or aborted.

Parameters:
transferthe transfer to monitor
monitorthe progress monitor that is already initialized to consume 100 ticks to use for reporting progress to the user. It is the caller's responsibility to call done() on the given monitor. Accepts null, indicating that no progress should be reported and that the operation cannot be canceled.
Exceptions:
SarosCancellationExceptionif the transfer was aborted either on local side or remote side, see also LocalCancellationException and RemoteCancellationException
IOExceptionif an I/O error occurred
void de.fu_berlin.inf.dpp.negotiation.ProjectNegotiation.notifyCancellation ( SarosCancellationException  cancellationCause) [protected, virtual]

This method is called after terminateProcess decides to cancel the current process. It is up to the implementing class to forward this notification.

Parameters:
cancellationCausethe cause of the cancellation

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

void de.fu_berlin.inf.dpp.negotiation.ProjectNegotiation.notifyTerminated ( NegotiationListener  listener) [protected, virtual]

Informs the listener, that the process is terminated. Otherwise, the SessionManager would block the execution and wait until the process is terminated

Parameters:
listenerto notify

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


Member Data Documentation

final String de.fu_berlin.inf.dpp.negotiation.ProjectNegotiation.ARCHIVE_TRANSFER_ID = "saros-dpp-pn-server-client-archive/" [static]

Prefix part of the id used in the SMACK XMPP file transfer protocol.

The file transfer manager can be null if no connection was established or was lost when the class was instantiated.

Initial value:
 Long.getLong(
        "de.fu_berlin.inf.dpp.negotiation.project.PACKET_TIMEOUT", 30000L)

Timeout for all packet exchanges during the project negotiation

Delimiter for every Zip entry to delimit the project id from the path entry.

E.g: 12345:foo/bar/foobar.java

 All Classes Namespaces Files Functions Variables Enumerations