Bug 285992 - [api] Un-deprecate or fix RemoteFileSecurityException
Summary: [api] Un-deprecate or fix RemoteFileSecurityException
Status: ASSIGNED
Alias: None
Product: Target Management
Classification: Tools
Component: RSE (show other bugs)
Version: 3.1   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: dsdp.tm.rse-inbox CLA
QA Contact: Martin Oberhuber CLA
URL:
Whiteboard:
Keywords: api
Depends on: 226374
Blocks:
  Show dependency tree
 
Reported: 2009-08-07 09:09 EDT by Martin Oberhuber CLA
Modified: 2012-11-19 04:56 EST (History)
11 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Oberhuber CLA 2009-08-07 09:09:19 EDT
+++ This bug was initially created as a clone of Bug #226374 +++

In bug 226374, we introduced some new default SystemMessageException children for general situations (such as network I/O problem) that can occur in any subsystem. RemoteFileSecurityException was deprecated at that time, in favor of the new SystemRemoteSecurityException which is generic and doesn't cover files only.

Problem is that as of today, in RSE we have *no single use* of SystemRemoteSecurityException, but 33 occurrences of RemoteFileSecurityException (not counting comments and import statements).

Existing service implementations throw that exception to indicate issues such as cannot write file / cannot create folder, and - more importantly - framework code checks for that particular kind of exception to test such special conditions.

In other words, clients which do migrate to the newer SystemRemoteSecurityException class are at risk of not being handled properly by the framework; and, if our services start throwing SystemRemoteSecurityException rather than the existing RemoteFileSecurityException, we are at risk of client software not understanding the errors that we throw properly.

Suggested Solution:
-------------------
In order to ensure compatibility, we need to be able to handle the older and newer exception kinds semantically the same way. I therefore propose creating a new interface - ISystemRemoteSecurityException - which is implemented by both the older and the newer concrete exception class. That way, our framework code can check for the interface and thus treat both exceptions the same way.

I think we also need to accept the fact that IRemoteFileSecurityException is a de-facto standard out there so we cannot remove it easily. At least as of today (RSE 3.1), clients are better off throwing the old one than the new one, since the new one is nowhere handled. I'm thus afraid we'll need to un-deprecate it, unless somebody has a smart idea how to deal with exceptions in a compatible way.

Time Plan:
----------
In order to show what we're up to, I propose un-deprecating RemoteFileSecurityException in 3.1.1 already. For the improved solution using a common API Interface, we'll need until we can add API in 3.2.

Comments welcome...
Comment 1 Martin Oberhuber CLA 2009-08-07 09:13:18 EDT
I should also mention that from the 33 occurrences of RemoteFileSecurityException, there are 12 cases in catch() clauses which would all need to be extended to similarly deal with SystemRemoteSecurityException:

RemoteFileExportOperation.java - org.eclipse.rse.importexport/src/org/eclipse/rse/internal/importexport/files
RemoteFileImportOperation.java - org.eclipse.rse.importexport/src/org/eclipse/rse/internal/importexport/files
RemoteFileSecurityException.java - org.eclipse.rse.services/src/org/eclipse/rse/services/files
SystemFilePropertyPage.java - org.eclipse.rse.files.ui/src/org/eclipse/rse/internal/files/ui/propertypages
SystemNewFileWizard.java - org.eclipse.rse.files.ui/src/org/eclipse/rse/internal/files/ui/wizards
SystemNewFolderWizard.java - org.eclipse.rse.files.ui/src/org/eclipse/rse/internal/files/ui/wizards
SystemUniversalTempFileListener.java - org.eclipse.rse.files.ui/src/org/eclipse/rse/files/ui/resources
SystemUploadConflictAction.java - org.eclipse.rse.files.ui/src/org/eclipse/rse/internal/files/ui/actions
UniFilePlus.java - org.eclipse.rse.importexport/src/org/eclipse/rse/internal/importexport/files
UniversalFileTransferUtility.java - org.eclipse.rse.files.ui/src/org/eclipse/rse/files/ui/resources