1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-20 07:25:23 +02:00

[211472] [api][breaking] IRemoteObjectResolver.getObjectWithAbsoluteName() needs a progress monitor

This commit is contained in:
David McKnight 2007-11-29 17:10:12 +00:00
parent 77a094ca8a
commit 789d7a59e8
3 changed files with 27 additions and 4 deletions

View file

@ -12,10 +12,12 @@
* *
* Contributors: * Contributors:
* Martin Oberhuber (Wind River) - [182454] improve getAbsoluteName() documentation * Martin Oberhuber (Wind River) - [182454] improve getAbsoluteName() documentation
* David McKnight (IBM) - [211472] [api][breaking] IRemoteObjectResolver.getObjectWithAbsoluteName() needs a progress monitor
********************************************************************************/ ********************************************************************************/
package org.eclipse.rse.core.subsystems; package org.eclipse.rse.core.subsystems;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.rse.services.clientserver.messages.SystemMessageException; import org.eclipse.rse.services.clientserver.messages.SystemMessageException;
/** /**
@ -70,6 +72,7 @@ public interface IRemoteObjectResolver {
* *
* @param key the unique id of the remote object. * @param key the unique id of the remote object.
* Must not be <code>null</code>. * Must not be <code>null</code>.
* @param monitor the progress monitor
* @return the remote object instance, or <code>null</code> if no * @return the remote object instance, or <code>null</code> if no
* object is found with the given id. * object is found with the given id.
* @throws Exception in case an error occurs contacting the remote * @throws Exception in case an error occurs contacting the remote
@ -81,5 +84,13 @@ public interface IRemoteObjectResolver {
* to ignore these exceptions and treat them as if the remote * to ignore these exceptions and treat them as if the remote
* object were simply not there. * object were simply not there.
*/ */
public Object getObjectWithAbsoluteName(String key, IProgressMonitor monitor) throws Exception;
/**
* @deprecated - use getObjectwithAbsoluteName(String key, IProgressMonitor monitor)
* @param key
* @return
* @throws Exception
*/
public Object getObjectWithAbsoluteName(String key) throws Exception; public Object getObjectWithAbsoluteName(String key) throws Exception;
} }

View file

@ -22,6 +22,7 @@
* Rupen Mardirossian (IBM) - [204307] listFolders now deals with a null parameter for fileNameFilter preventing NPE * Rupen Mardirossian (IBM) - [204307] listFolders now deals with a null parameter for fileNameFilter preventing NPE
* David McKnight (IBM) - [207178] changing list APIs for file service and subsystems * David McKnight (IBM) - [207178] changing list APIs for file service and subsystems
* David McKnight (IBM) - [210109] store constants in IFileService rather than IFileServiceConstants * David McKnight (IBM) - [210109] store constants in IFileService rather than IFileServiceConstants
* David McKnight (IBM) - [211472] [api][breaking] IRemoteObjectResolver.getObjectWithAbsoluteName() needs a progress monitor
*******************************************************************************/ *******************************************************************************/
package org.eclipse.rse.subsystems.files.core.subsystems; package org.eclipse.rse.subsystems.files.core.subsystems;
@ -1027,6 +1028,7 @@ public abstract class RemoteFileSubSystem extends SubSystem implements IRemoteFi
* a file, this is simply a wrapper to getRemoteFileObject(). * a file, this is simply a wrapper to getRemoteFileObject().
* *
* @see SubSystem#getObjectWithAbsoluteName(String) * @see SubSystem#getObjectWithAbsoluteName(String)
* @param monitor the progress monitor
* @param key the unique id of the remote object. * @param key the unique id of the remote object.
* Must not be <code>null</code>. * Must not be <code>null</code>.
* @return the remote object instance, or <code>null</code> if no * @return the remote object instance, or <code>null</code> if no
@ -1040,9 +1042,9 @@ public abstract class RemoteFileSubSystem extends SubSystem implements IRemoteFi
* to ignore these exceptions and treat them as if the remote * to ignore these exceptions and treat them as if the remote
* object were simply not there. * object were simply not there.
*/ */
public Object getObjectWithAbsoluteName(String key) throws Exception public Object getObjectWithAbsoluteName(String key, IProgressMonitor monitor) throws Exception
{ {
Object filterRef = super.getObjectWithAbsoluteName(key); Object filterRef = super.getObjectWithAbsoluteName(key, monitor);
if (filterRef != null) { if (filterRef != null) {
return filterRef; return filterRef;
} }
@ -1051,7 +1053,7 @@ public abstract class RemoteFileSubSystem extends SubSystem implements IRemoteFi
// if not, the key must be for a file // if not, the key must be for a file
if (key.lastIndexOf(IHostSearchResult.SEARCH_RESULT_DELIMITER) < 0) { if (key.lastIndexOf(IHostSearchResult.SEARCH_RESULT_DELIMITER) < 0) {
IRemoteFile remoteFile = getRemoteFileObject(key, new NullProgressMonitor()); IRemoteFile remoteFile = getRemoteFileObject(key, monitor);
if (remoteFile != null) { if (remoteFile != null) {
return remoteFile; return remoteFile;

View file

@ -26,6 +26,7 @@
* Xuan Chen (IBM) - [187342] Open in New Window expand failed error when not connected * Xuan Chen (IBM) - [187342] Open in New Window expand failed error when not connected
* David McKnight (IBM) - [186363] remove deprecated calls in checkIsConnected * David McKnight (IBM) - [186363] remove deprecated calls in checkIsConnected
* David McKnight (IBM) - [186363] get rid of obsolete calls to SubSystem.connect() * David McKnight (IBM) - [186363] get rid of obsolete calls to SubSystem.connect()
* David McKnight (IBM) - [211472] [api][breaking] IRemoteObjectResolver.getObjectWithAbsoluteName() needs a progress monitor
********************************************************************************/ ********************************************************************************/
package org.eclipse.rse.core.subsystems; package org.eclipse.rse.core.subsystems;
@ -781,6 +782,7 @@ public abstract class SubSystem extends RSEModelObject
* *
* @param key the unique id of the remote object. * @param key the unique id of the remote object.
* Must not be <code>null</code>. * Must not be <code>null</code>.
* @param monitor the progress monitor
* @return the remote object instance, or <code>null</code> if no * @return the remote object instance, or <code>null</code> if no
* object is found with the given id. * object is found with the given id.
* @throws Exception in case an error occurs contacting the remote * @throws Exception in case an error occurs contacting the remote
@ -792,13 +794,21 @@ public abstract class SubSystem extends RSEModelObject
* to ignore these exceptions and treat them as if the remote * to ignore these exceptions and treat them as if the remote
* object were simply not there. * object were simply not there.
*/ */
public Object getObjectWithAbsoluteName(String key) throws Exception public Object getObjectWithAbsoluteName(String key, IProgressMonitor monitor) throws Exception
{ {
// by default, the subsystem will attempt to find a filter reference for the key. // by default, the subsystem will attempt to find a filter reference for the key.
// Return null when no such filter is found. // Return null when no such filter is found.
return getFilterReferenceWithAbsoluteName(key); return getFilterReferenceWithAbsoluteName(key);
} }
/**
* @deprecated use getObjectWithAbsoluteName(String key, IProgressMonitor monitor)
*/
public Object getObjectWithAbsoluteName(String key) throws Exception
{
return getObjectWithAbsoluteName(key, new NullProgressMonitor());
}
/** /**
* Return the filter reference that corresponds to the specified key. If there * Return the filter reference that corresponds to the specified key. If there
* @param key the absolute name for an object. * @param key the absolute name for an object.