PTP
Release 7.0

org.eclipse.ptp.rdt.sync.core.services
Interface ISynchronizeService

All Superinterfaces:
ISynchronizeServiceDescriptor
All Known Implementing Classes:
AbstractSynchronizeService

public interface ISynchronizeService
extends ISynchronizeServiceDescriptor

Provides synchronization services.

Since:
3.0

Method Summary
 void checkout(org.eclipse.core.resources.IProject project, SyncConfig syncConfig, org.eclipse.core.runtime.IPath[] paths)
          Replace the current contents of the given paths with the previous versions in the repository
 void checkoutRemoteCopy(org.eclipse.core.resources.IProject project, SyncConfig syncConfig, org.eclipse.core.runtime.IPath[] paths)
          Replace the current contents of the given paths with the current local copies of the remote (not necessarily the same as what is on the remote site).
 void close(org.eclipse.core.resources.IProject project)
          Close any resources (files, sockets) that were open by the sync provider for the given project.
 java.lang.String getLocation()
          Get the remote directory that will be used for synchronization
 java.util.Set<org.eclipse.core.runtime.IPath> getMergeConflictFiles(org.eclipse.core.resources.IProject project, SyncConfig syncConfig)
          Get the current list of merge-conflicted files for the passed project and build scenario
 java.lang.String[] getMergeConflictParts(org.eclipse.core.resources.IProject project, SyncConfig syncConfig, org.eclipse.core.resources.IFile file)
          Get the three parts of the merge-conflicted file (left, right, and ancestor, respectively)
 IRemoteConnection getRemoteConnection()
          Get the remote connection used by this sync service provider.
 AbstractSyncFileFilter getSyncFileFilter(org.eclipse.core.resources.IProject project)
          Get SyncFileFilter.
 void setLocation(java.lang.String location)
          Set the remote directory that will be used for synchronization
 void setMergeAsResolved(org.eclipse.core.resources.IProject project, SyncConfig syncConfig, org.eclipse.core.runtime.IPath[] paths)
          Set the given file paths as resolved (merge conflict does not exist)
 void setRemoteConnection(IRemoteConnection conn)
          set the remote connection used for synchronization
 void setSyncFileFilter(org.eclipse.core.resources.IProject project, AbstractSyncFileFilter filter)
          Set sync file filter for the given project
 void synchronize(org.eclipse.core.resources.IProject project, SyncConfig syncConfig, org.eclipse.core.resources.IResourceDelta delta, org.eclipse.core.runtime.IProgressMonitor monitor, java.util.EnumSet<SyncFlag> syncFlags)
          Perform synchronization
 
Methods inherited from interface org.eclipse.ptp.rdt.sync.core.services.ISynchronizeServiceDescriptor
getId, getName, getService
 

Method Detail

checkout

void checkout(org.eclipse.core.resources.IProject project,
              SyncConfig syncConfig,
              org.eclipse.core.runtime.IPath[] paths)
              throws org.eclipse.core.runtime.CoreException
Replace the current contents of the given paths with the previous versions in the repository

Parameters:
project -
syncConfig -
path -
Throws:
org.eclipse.core.runtime.CoreException

checkoutRemoteCopy

void checkoutRemoteCopy(org.eclipse.core.resources.IProject project,
                        SyncConfig syncConfig,
                        org.eclipse.core.runtime.IPath[] paths)
                        throws org.eclipse.core.runtime.CoreException
Replace the current contents of the given paths with the current local copies of the remote (not necessarily the same as what is on the remote site). This is useful in merge-conflict resolution.

Parameters:
project -
syncConfig -
path -
Throws:
org.eclipse.core.runtime.CoreException

close

void close(org.eclipse.core.resources.IProject project)
Close any resources (files, sockets) that were open by the sync provider for the given project. Resources not open by the provider should not be touched. This is called, for example, when a project is about to be deleted.


getLocation

java.lang.String getLocation()
Get the remote directory that will be used for synchronization

Returns:
String

getMergeConflictFiles

java.util.Set<org.eclipse.core.runtime.IPath> getMergeConflictFiles(org.eclipse.core.resources.IProject project,
                                                                    SyncConfig syncConfig)
                                                                    throws org.eclipse.core.runtime.CoreException
Get the current list of merge-conflicted files for the passed project and build scenario

Parameters:
project -
syncConfig -
Returns:
set of files as project-relative IPaths. This may be an empty set but never null.
Throws:
org.eclipse.core.runtime.CoreException - for system-level problems retrieving merge information

getMergeConflictParts

java.lang.String[] getMergeConflictParts(org.eclipse.core.resources.IProject project,
                                         SyncConfig syncConfig,
                                         org.eclipse.core.resources.IFile file)
                                         throws org.eclipse.core.runtime.CoreException
Get the three parts of the merge-conflicted file (left, right, and ancestor, respectively)

Parameters:
project -
syncConfig -
file -
Returns:
the three parts as strings. Either three strings (some may be empty) or null if file is not merge-conflicted.
Throws:
org.eclipse.core.runtime.CoreException - for system-level problems retrieving merge information

getRemoteConnection

IRemoteConnection getRemoteConnection()
Get the remote connection used by this sync service provider.

Returns:
connection

setLocation

void setLocation(java.lang.String location)
Set the remote directory that will be used for synchronization

Parameters:
location - directory path
Throws:
java.lang.RuntimeException - if already set. Changing these local parameters is not currently supported but should be possible.

setMergeAsResolved

void setMergeAsResolved(org.eclipse.core.resources.IProject project,
                        SyncConfig syncConfig,
                        org.eclipse.core.runtime.IPath[] paths)
                        throws org.eclipse.core.runtime.CoreException
Set the given file paths as resolved (merge conflict does not exist)

Parameters:
project -
syncConfig -
path -
Throws:
org.eclipse.core.runtime.CoreException - for system-level problems setting the state

setRemoteConnection

void setRemoteConnection(IRemoteConnection conn)
set the remote connection used for synchronization

Parameters:
conn - remote connection
Throws:
java.lang.RuntimeException - if already set. Changing these local parameters is not currently supported but should be possible.

synchronize

void synchronize(org.eclipse.core.resources.IProject project,
                 SyncConfig syncConfig,
                 org.eclipse.core.resources.IResourceDelta delta,
                 org.eclipse.core.runtime.IProgressMonitor monitor,
                 java.util.EnumSet<SyncFlag> syncFlags)
                 throws org.eclipse.core.runtime.CoreException
Perform synchronization

Parameters:
project - project to sync
delta - resources requiring synchronization
monitor - progress monitor for monitoring or canceling sync
syncFlags - Various flags for the sync call. For example, the sync can be forced, either to local (from remote) or to remote (from local). If forced, it is guaranteed to happen before returning. Otherwise, it may happen at any time.
Throws:
org.eclipse.core.runtime.CoreException - if synchronization fails

getSyncFileFilter

AbstractSyncFileFilter getSyncFileFilter(org.eclipse.core.resources.IProject project)
Get SyncFileFilter. Empty if not initialized before

Parameters:
project -
Returns:
file filter
Throws:
RemoteSyncException

setSyncFileFilter

void setSyncFileFilter(org.eclipse.core.resources.IProject project,
                       AbstractSyncFileFilter filter)
Set sync file filter for the given project

Parameters:
project - - cannot be null
filter - generic file filter - cannot be null

PTP
Release 7.0

Copyright (c) 2011 IBM Corporation and others. All Rights Reserved.