Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Dykstal2008-04-08 02:41:22 +0000
committerDavid Dykstal2008-04-08 02:41:22 +0000
commit5c9058e0f4baab46d8eebc0aec735e37474f3135 (patch)
tree0d20c5df2a81824137189ee5a8acd68c6bb57d24
parent77e0b0e35b6773d86cab6cedbb2ceaf262c7967a (diff)
downloadorg.eclipse.tm-5c9058e0f4baab46d8eebc0aec735e37474f3135.tar.gz
org.eclipse.tm-5c9058e0f4baab46d8eebc0aec735e37474f3135.tar.xz
org.eclipse.tm-5c9058e0f4baab46d8eebc0aec735e37474f3135.zip
[225988][api]need API to mark persisted profiles as migrated so they do not continue to be migrated
https://bugs.eclipse.org/bugs/show_bug.cgi?id=225988
-rw-r--r--rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/IRSECoreStatusCodes.java58
-rw-r--r--rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/internal/persistence/PFWorkspaceAnchor.java9
-rw-r--r--rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/internal/persistence/PropertyFileProvider.java25
-rw-r--r--rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/internal/persistence/RSEPersistenceManager.java17
-rw-r--r--rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/internal/persistence/SerializingProvider.java36
-rw-r--r--rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/internal/persistence/dom/RSEDOMImporter.java8
-rw-r--r--rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/persistence/IRSEPersistenceManager.java25
-rw-r--r--rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/persistence/IRSEPersistenceProvider.java41
8 files changed, 199 insertions, 20 deletions
diff --git a/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/IRSECoreStatusCodes.java b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/IRSECoreStatusCodes.java
new file mode 100644
index 000000000..6ec61238b
--- /dev/null
+++ b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/IRSECoreStatusCodes.java
@@ -0,0 +1,58 @@
+/*********************************************************************************
+ * Copyright (c) 2008 IBM Corporation. All rights reserved.
+ * This program and the accompanying materials are made available under the terms
+ * of the Eclipse Public License v1.0 which accompanies this distribution, and is
+ * available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * David Dykstal (IBM) - [225988] need API to mark persisted profiles as migrated
+ *********************************************************************************/
+
+package org.eclipse.rse.core;
+
+/**
+ * Codes for use in constructing IStatus objects.
+ * These are unique across org.eclipse.rse.core
+ * @since 3.0
+ */
+public interface IRSECoreStatusCodes {
+
+ /*
+ * General codes (1 to 100)
+ */
+
+ /**
+ * A code used for constructing IStatus objects.
+ * Value 1. An exception occurred during the operation.
+ * @since 3.0
+ */
+ public static final int EXCEPTION_OCCURRED = 1;
+
+ /**
+ * A code used for constructing IStatus objects.
+ * Value 2. An invalid format was encountered operation.
+ * The object in question must be assumed to be corrupted.
+ * @since 3.0
+ */
+ public static final int INVALID_FORMAT = 2;
+
+ /*
+ * Persistence manager and provider codes (101 to 200)
+ */
+
+ /**
+ * A code used for constructing IStatus objects.
+ * Value 101. A persistent form of a profile is not found.
+ * @since 3.0
+ */
+ public static final int PROFILE_NOT_FOUND = 101;
+
+ /**
+ * A code used for constructing IStatus objects.
+ * Value 102.
+ * The marking of profiles as migrated is not supported by this provider.
+ * @since 3.0
+ */
+ public static final int MIGRATION_NOT_SUPPORTED = 102;
+
+}
diff --git a/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/internal/persistence/PFWorkspaceAnchor.java b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/internal/persistence/PFWorkspaceAnchor.java
index 60ea64744..7aa927150 100644
--- a/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/internal/persistence/PFWorkspaceAnchor.java
+++ b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/internal/persistence/PFWorkspaceAnchor.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007 IBM Corporation and others.
+ * Copyright (c) 2007, 2008 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -7,8 +7,8 @@
*
* Contributors:
* IBM Corporation - initial API and implementation
- * David Dykstal (IBM) - [189858] delayed the creation of the remote systems project by
- * using handle-only operations.
+ * David Dykstal (IBM) - [189858] delayed the creation of the remote systems project by using handle-only operations.
+ * David Dykstal (IBM) - [225988] need API to mark persisted profiles as migrated
*******************************************************************************/
package org.eclipse.rse.internal.persistence;
@@ -27,6 +27,7 @@ import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.rse.core.IRSECoreStatusCodes;
import org.eclipse.rse.core.RSECorePlugin;
import org.eclipse.rse.core.SystemResourceManager;
import org.eclipse.rse.internal.core.RSECoreMessages;
@@ -66,7 +67,7 @@ class PFWorkspaceAnchor implements PFPersistenceAnchor {
try {
profileFolder.delete(IResource.FORCE, monitor);
} catch (CoreException e) {
- result = new Status(IStatus.ERROR, null, 0, RSECoreMessages.PropertyFileProvider_UnexpectedException, e);
+ result = new Status(IStatus.ERROR, RSECorePlugin.PLUGIN_ID, IRSECoreStatusCodes.EXCEPTION_OCCURRED, RSECoreMessages.PropertyFileProvider_UnexpectedException, e);
}
}
return result;
diff --git a/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/internal/persistence/PropertyFileProvider.java b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/internal/persistence/PropertyFileProvider.java
index c267da0c3..bb1d5c079 100644
--- a/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/internal/persistence/PropertyFileProvider.java
+++ b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/internal/persistence/PropertyFileProvider.java
@@ -14,6 +14,7 @@
* Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType
* David Dykstal (IBM) - [188863] fix job conflict problems for save jobs, ignore bad profiles on restore
* David Dykstal (IBM) - [189274] provide import and export operations for profiles
+ * David Dykstal (IBM) - [225988] need API to mark persisted profiles as migrated
********************************************************************************/
package org.eclipse.rse.internal.persistence;
@@ -40,7 +41,9 @@ import java.util.regex.Pattern;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.rse.core.IRSECoreStatusCodes;
import org.eclipse.rse.core.RSECorePlugin;
import org.eclipse.rse.internal.core.RSECoreMessages;
import org.eclipse.rse.logging.Logger;
@@ -223,6 +226,28 @@ public class PropertyFileProvider implements IRSEPersistenceProvider, IRSEImport
return providerId;
}
+ /* (non-Javadoc)
+ * @see org.eclipse.rse.persistence.IRSEPersistenceProvider#setMigratedMark(java.lang.String, boolean)
+ */
+ public IStatus setMigrationMark(String profileName, boolean migrated) {
+ String message = "PropertyFileProvider does not support profile migration"; //$NON-NLS-1$
+ return new Status(IStatus.ERROR, RSECorePlugin.PLUGIN_ID, IRSECoreStatusCodes.MIGRATION_NOT_SUPPORTED, message, null);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.rse.persistence.IRSEPersistenceProvider#supportsMigration()
+ */
+ public boolean supportsMigration() {
+ return false;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.rse.persistence.IRSEPersistenceProvider#getMigratedProfileNames()
+ */
+ public String[] getMigratedProfileNames() {
+ return new String[0];
+ }
+
/**
* Checks a profile name for validity. Currently all names are valid except for completely blank names.
* @param profileName the name to check
diff --git a/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/internal/persistence/RSEPersistenceManager.java b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/internal/persistence/RSEPersistenceManager.java
index 744817c12..d93a7017f 100644
--- a/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/internal/persistence/RSEPersistenceManager.java
+++ b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/internal/persistence/RSEPersistenceManager.java
@@ -18,6 +18,7 @@
* Martin Oberhuber (Wind River) - [196919] Fix deadlock with workspace operations
* Martin Oberhuber (Wind River) - [202416] Protect against NPEs when importing DOM
* David Dykstal (IBM) - [189274] provide import and export operations for profiles
+ * David Dykstal (IBM) - [225988] need API to mark persisted profiles as migrated
********************************************************************************/
package org.eclipse.rse.internal.persistence;
@@ -39,6 +40,7 @@ import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.Preferences;
+import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.rse.core.IRSEPreferenceNames;
import org.eclipse.rse.core.RSECorePlugin;
@@ -178,6 +180,14 @@ public class RSEPersistenceManager implements IRSEPersistenceManager {
* @see org.eclipse.rse.persistence.IRSEPersistenceManager#migrateProfile(org.eclipse.rse.core.model.ISystemProfile, org.eclipse.rse.persistence.IRSEPersistenceProvider)
*/
public void migrateProfile(ISystemProfile profile, IRSEPersistenceProvider persistenceProvider) {
+ migrateProfile(profile, persistenceProvider, true);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.rse.persistence.IRSEPersistenceManager#migrateProfile(org.eclipse.rse.core.model.ISystemProfile, org.eclipse.rse.persistence.IRSEPersistenceProvider, boolean)
+ */
+ public IStatus migrateProfile(ISystemProfile profile, IRSEPersistenceProvider persistenceProvider, boolean delete) {
+ IStatus result = Status.OK_STATUS;
IRSEPersistenceProvider oldProvider = profile.getPersistenceProvider();
oldProvider = (oldProvider == null) ? getDefaultPersistenceProvider() : oldProvider;
IRSEPersistenceProvider newProvider = persistenceProvider;
@@ -186,8 +196,13 @@ public class RSEPersistenceManager implements IRSEPersistenceManager {
String profileName = profile.getName();
profile.setPersistenceProvider(newProvider);
profile.commit();
- deleteProfile(oldProvider, profileName);
+ if (delete) {
+ deleteProfile(oldProvider, profileName);
+ } else {
+ result = oldProvider.setMigrationMark(profileName, true);
+ }
}
+ return result;
}
/* (non-Javadoc)
diff --git a/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/internal/persistence/SerializingProvider.java b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/internal/persistence/SerializingProvider.java
index 668e374e2..da24f8a2b 100644
--- a/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/internal/persistence/SerializingProvider.java
+++ b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/internal/persistence/SerializingProvider.java
@@ -1,5 +1,5 @@
/********************************************************************************
- * Copyright (c) 2006, 2007 IBM Corporation and others. All rights reserved.
+ * Copyright (c) 2006, 2008 IBM Corporation and others. All rights reserved.
* This program and the accompanying materials are made available under the terms
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html
@@ -13,6 +13,7 @@
* Contributors:
* Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType
* David Dykstal (IBM) - [191130] use explicit getRemoteSystemsProject(boolean) method
+ * David Dykstal (IBM) - [225988] need API to mark persisted profiles as migrated
********************************************************************************/
package org.eclipse.rse.internal.persistence;
@@ -32,10 +33,13 @@ import org.eclipse.core.resources.IFolder;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.ILog;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.rse.core.IRSECoreStatusCodes;
+import org.eclipse.rse.core.RSECorePlugin;
import org.eclipse.rse.core.SystemResourceManager;
import org.eclipse.rse.internal.core.RSECoreMessages;
import org.eclipse.rse.persistence.IRSEPersistenceProvider;
@@ -81,8 +85,9 @@ public class SerializingProvider implements IRSEPersistenceProvider {
}
}
} catch (CoreException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
+ IStatus status = new Status(IStatus.ERROR, RSECorePlugin.PLUGIN_ID, IRSECoreStatusCodes.EXCEPTION_OCCURRED, "Unexpected CoreException", e); //$NON-NLS-1$
+ ILog log = RSECorePlugin.getDefault().getLog();
+ log.log(status);
}
String[] result = new String[names.size()];
names.toArray(result);
@@ -96,7 +101,6 @@ public class SerializingProvider implements IRSEPersistenceProvider {
RSEDOM dom = null;
IFile profileFile = getProfileFile(profileName, monitor);
if (profileFile.exists()) {
- //System.out.println("loading "+ profileFile.getLocation().toOSString() + "..."); // DWD debugging
try {
InputStream iStream = profileFile.getContents();
@@ -142,7 +146,6 @@ public class SerializingProvider implements IRSEPersistenceProvider {
IFile profileFile = getProfileFile(dom.getName(), monitor);
File osFile = profileFile.getLocation().toFile();
- // System.out.println("saving "+ osFile.getAbsolutePath() + "..."); // DWD debugging
try {
OutputStream oStream = new FileOutputStream(osFile);
ObjectOutputStream outStream = new ObjectOutputStream(oStream);
@@ -172,13 +175,34 @@ public class SerializingProvider implements IRSEPersistenceProvider {
try {
profileFile.delete(IResource.FORCE | IResource.KEEP_HISTORY, monitor);
} catch (CoreException e) {
- result = new Status(IStatus.ERROR, null, 0, RSECoreMessages.SerializingProvider_UnexpectedException, e);
+ result = new Status(IStatus.ERROR, null, IRSECoreStatusCodes.EXCEPTION_OCCURRED, RSECoreMessages.SerializingProvider_UnexpectedException, e);
}
}
return result;
}
/* (non-Javadoc)
+ * @see org.eclipse.rse.persistence.IRSEPersistenceProvider#supportsMigration()
+ */
+ public boolean supportsMigration() {
+ return false;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.rse.persistence.IRSEPersistenceProvider#setMigratedMark(java.lang.String, boolean)
+ */
+ public IStatus setMigrationMark(String profileName, boolean migrated) {
+ return new Status(IStatus.ERROR, RSECorePlugin.PLUGIN_ID, IRSECoreStatusCodes.MIGRATION_NOT_SUPPORTED, "Profile migration is not supported by the serializing provider.", null); //$NON-NLS-1$
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.rse.persistence.IRSEPersistenceProvider#getMigratedProfileNames()
+ */
+ public String[] getMigratedProfileNames() {
+ return new String[0];
+ }
+
+ /* (non-Javadoc)
* @see org.eclipse.rse.persistence.IRSEPersistenceProvider#setProperties(java.util.Properties)
*/
public void setProperties(Properties properties) {
diff --git a/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/internal/persistence/dom/RSEDOMImporter.java b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/internal/persistence/dom/RSEDOMImporter.java
index 13715d8d5..e25776f02 100644
--- a/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/internal/persistence/dom/RSEDOMImporter.java
+++ b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/internal/persistence/dom/RSEDOMImporter.java
@@ -19,6 +19,7 @@
* David McKnight (IBM) - [217715] [api] RSE property sets should support nested property sets
* David Dykstal (IBM) - [197036] respond to removal of SystemProfile.createHost()
* David Dykstal (IBM) - [217556] remove service subsystem types
+ * David Dykstal (IBM) - [225988] need API to mark persisted profiles as migrated
********************************************************************************/
package org.eclipse.rse.internal.persistence.dom;
@@ -26,6 +27,7 @@ package org.eclipse.rse.internal.persistence.dom;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.rse.core.IRSECoreRegistry;
+import org.eclipse.rse.core.IRSECoreStatusCodes;
import org.eclipse.rse.core.IRSESystemType;
import org.eclipse.rse.core.RSECorePlugin;
import org.eclipse.rse.core.filters.ISystemFilter;
@@ -581,12 +583,12 @@ public class RSEDOMImporter {
private void logException(Exception e) {
RSECorePlugin.getDefault().getLog().log(
- new Status(IStatus.ERROR, RSECorePlugin.getDefault().getBundle().getSymbolicName(), -1, e.getMessage(), e));
+ new Status(IStatus.ERROR, RSECorePlugin.getDefault().getBundle().getSymbolicName(), IRSECoreStatusCodes.EXCEPTION_OCCURRED, e.getMessage(), e));
}
private void logWarning(String msg) {
RSECorePlugin.getDefault().getLog().log(
- new Status(IStatus.WARNING, RSECorePlugin.getDefault().getBundle().getSymbolicName(), -1, "RSEDOMImporter: "+msg, null)); //$NON-NLS-1$
+ new Status(IStatus.WARNING, RSECorePlugin.getDefault().getBundle().getSymbolicName(), 0, "RSEDOMImporter: "+msg, null)); //$NON-NLS-1$
}
private void logNullAttribute(RSEDOMNode node, String attributeName) {
@@ -603,7 +605,7 @@ public class RSEDOMImporter {
}
msg.append(node.getName()==null ? "null" : node.getName()); //$NON-NLS-1$
RSECorePlugin.getDefault().getLog().log(
- new Status(IStatus.WARNING, RSECorePlugin.getDefault().getBundle().getSymbolicName(), -1, msg.toString(), null));
+ new Status(IStatus.WARNING, RSECorePlugin.getDefault().getBundle().getSymbolicName(), 0, msg.toString(), null));
}
} \ No newline at end of file
diff --git a/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/persistence/IRSEPersistenceManager.java b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/persistence/IRSEPersistenceManager.java
index 5d0e8735b..3cf900a61 100644
--- a/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/persistence/IRSEPersistenceManager.java
+++ b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/persistence/IRSEPersistenceManager.java
@@ -14,10 +14,12 @@
* Contributors:
* David Dykstal (IBM) - 142806: refactoring persistence framework
* David Dykstal (IBM) - [cleanup] adding noimplement tag
+ * David Dykstal (IBM) - [225988] need API to mark persisted profiles as migrated
*******************************************************************************/
package org.eclipse.rse.persistence;
+import org.eclipse.core.runtime.IStatus;
import org.eclipse.rse.core.model.ISystemProfile;
/**
@@ -76,13 +78,30 @@ public interface IRSEPersistenceManager {
public void deleteProfile(IRSEPersistenceProvider persistenceProvider, String profileName);
/**
- * Migrates a profile to a new persistence provider. It will delete the persistent form known to its previous
- * persistence provider. If the new provider and the previous provider are the same this does nothing.
+ * Migrates a profile to a new persistence provider.
+ * It will delete the persistent form known to its previous persistence provider.
+ * If the new provider and the previous provider are the same this does nothing.
+ * Exactly the same as <code>migrateProfile(profile, persistenceProvider, true);</code>
* @param profile the system profile to be migrated
* @param persistenceProvider the persistence provider to which this profile will be migrated.
*/
public void migrateProfile(ISystemProfile profile, IRSEPersistenceProvider persistenceProvider);
-
+
+ /**
+ * Migrates a profile to a new persistence provider.
+ * It will mark the persistent form known to its previous
+ * persistence provider as migrated. This may, in fact, result
+ * in the persistent form of this profile being deleted.
+ * If the new provider and the previous provider are the same this does nothing.
+ * @param profile the system profile to be migrated
+ * @param persistenceProvider the persistence provider to which this profile will be migrated.
+ * @param delete true if the persistent form of this profile is to be deleted from the old provider,
+ * false if the persistent form of the profile is to be marked as migrated.
+ * @return an IStatus indicating the success of the migration.
+ * @since org.eclipse.rse.core 2.1
+ */
+ public IStatus migrateProfile(ISystemProfile profile, IRSEPersistenceProvider persistenceProvider, boolean delete);
+
/**
* Register the persistence provider to be used when saving and restoring RSE doms.
* The provider is registered under the provided id.
diff --git a/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/persistence/IRSEPersistenceProvider.java b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/persistence/IRSEPersistenceProvider.java
index 6cf319a47..b304c1597 100644
--- a/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/persistence/IRSEPersistenceProvider.java
+++ b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/persistence/IRSEPersistenceProvider.java
@@ -1,5 +1,5 @@
/********************************************************************************
- * Copyright (c) 2006, 2007 IBM Corporation. All rights reserved.
+ * Copyright (c) 2006, 2008 IBM Corporation. All rights reserved.
* This program and the accompanying materials are made available under the terms
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html
@@ -13,6 +13,7 @@
* Contributors:
* David Dykstal (IBM) - 177329: added getSaveJob so that the persistence provider
* determines the job characteristics.
+ * David Dykstal (IBM) - [225988] need API to mark persisted profiles as migrated
********************************************************************************/
package org.eclipse.rse.persistence;
@@ -22,6 +23,7 @@ import java.util.Properties;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.rse.core.IRSECoreStatusCodes;
import org.eclipse.rse.persistence.dom.RSEDOM;
/**
@@ -35,7 +37,7 @@ import org.eclipse.rse.persistence.dom.RSEDOM;
* of the DOM and should only be used by the persistence manager.
*/
public interface IRSEPersistenceProvider {
-
+
/**
* Sets the properties for this provider. This must be done immediately
* after the provider is instantiated. The persistence manager will
@@ -76,6 +78,8 @@ public interface IRSEPersistenceProvider {
/**
* @return The names of the profiles that have been saved by this persistence provider.
+ * Profiles that have been marked as migrated are not returned in this list.
+ * This may be an empty array but will never be null.
*/
public String[] getSavedProfileNames();
@@ -87,5 +91,36 @@ public interface IRSEPersistenceProvider {
* @return the IStatus indicating the operations success.
*/
public IStatus deleteProfile(String profileName, IProgressMonitor monitor);
-
+
+ /**
+ * Sets the migration state of a profile.
+ * @param profileName the name of the profile of which to set the migration state
+ * @param migrated true if the profile is to be marked as migrated, false if it is to be marked as normal.
+ * Normal profiles are returned in {@link #getSavedProfileNames()}, migrated profiles are returned
+ * in {@link #getMigratedProfileNames()}.
+ * @return a status representing the resulting state of the migration. An OK status
+ * indicates a successful marking. An ERROR status indicates an unsuccessful marking.
+ * @see IRSECoreStatusCodes
+ * @since org.eclipse.rse.core 3.0
+ */
+ public IStatus setMigrationMark(String profileName, boolean migrated);
+
+ /**
+ * @return The names of the profiles that have been migrated by this persistence provider.
+ * The names of profiles that have been marked as migrated are returned in this list.
+ * The appearance of a profile name in this list implies that the profile may be
+ * unmigrated by this provider by using {@link #setMigrationMark(String, boolean)}.
+ * This may be an empty array but will never be null.
+ * @since org.eclipse.rse.core 3.0
+ */
+ public String[] getMigratedProfileNames();
+
+ /**
+ * Indicates whether or not this persistence provider supports migration.
+ * @return true if the provider supports marking of the persistence form of profiles
+ * as migrated, false otherwise.
+ * @since org.eclipse.rse.core 3.0
+ */
+ public boolean supportsMigration();
+
} \ No newline at end of file

Back to the top