Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorslewis2008-05-13 20:31:33 +0000
committerslewis2008-05-13 20:31:33 +0000
commite1a1e18d4b3dc3a4904d9c0f3457d94d237d5501 (patch)
tree0532e943907efc83ffbac75936629db6bfa12575
parentbee746ba02e9db5f6ee02e2496e0c577c8b61a72 (diff)
downloadorg.eclipse.ecf-e1a1e18d4b3dc3a4904d9c0f3457d94d237d5501.tar.gz
org.eclipse.ecf-e1a1e18d4b3dc3a4904d9c0f3457d94d237d5501.tar.xz
org.eclipse.ecf-e1a1e18d4b3dc3a4904d9c0f3457d94d237d5501.zip
Refactoring of IIDStore API
-rw-r--r--framework/bundles/org.eclipse.ecf.storage/src/org/eclipse/ecf/storage/IDEntry.java5
-rw-r--r--framework/bundles/org.eclipse.ecf.storage/src/org/eclipse/ecf/storage/INamespaceEntry.java20
2 files changed, 22 insertions, 3 deletions
diff --git a/framework/bundles/org.eclipse.ecf.storage/src/org/eclipse/ecf/storage/IDEntry.java b/framework/bundles/org.eclipse.ecf.storage/src/org/eclipse/ecf/storage/IDEntry.java
index 373a4584e..cc6067a32 100644
--- a/framework/bundles/org.eclipse.ecf.storage/src/org/eclipse/ecf/storage/IDEntry.java
+++ b/framework/bundles/org.eclipse.ecf.storage/src/org/eclipse/ecf/storage/IDEntry.java
@@ -50,7 +50,8 @@ public class IDEntry implements IIDEntry {
return prefs.parent().name() + ":" + prefs.name(); //$NON-NLS-1$
}
- private ISecurePreferences getRoot() {
+ private ISecurePreferences getNamespaceRoot() {
+ // The namespace root is the parent of our parent (which is the namespace)
return prefs.parent().parent();
}
@@ -67,7 +68,7 @@ public class IDEntry implements IIDEntry {
throw new IDStoreException("Associate ID not well-formed"); //$NON-NLS-1$
try {
String namespaceName = name.substring(0, index);
- ISecurePreferences namespacePrefs = getPreferences(getRoot(), namespaceName);
+ ISecurePreferences namespacePrefs = getPreferences(getNamespaceRoot(), namespaceName);
if (namespacePrefs == null)
throw new IDStoreException(NLS.bind("Cannot find Namespace {0}", namespaceName)); //$NON-NLS-1$
String idName = name.substring(index + 1);
diff --git a/framework/bundles/org.eclipse.ecf.storage/src/org/eclipse/ecf/storage/INamespaceEntry.java b/framework/bundles/org.eclipse.ecf.storage/src/org/eclipse/ecf/storage/INamespaceEntry.java
index fb65874da..ce088dc04 100644
--- a/framework/bundles/org.eclipse.ecf.storage/src/org/eclipse/ecf/storage/INamespaceEntry.java
+++ b/framework/bundles/org.eclipse.ecf.storage/src/org/eclipse/ecf/storage/INamespaceEntry.java
@@ -14,14 +14,32 @@ package org.eclipse.ecf.storage;
import org.eclipse.equinox.security.storage.ISecurePreferences;
/**
- *
+ * Namespace entry for {@link IIDStore}. Instances of this class are created/returned via
+ * calls to {@link IIDStore#getNamespaceEntries()} or {@link IIDStore#getNamespaceEntry(org.eclipse.ecf.core.identity.Namespace)}.
*/
public interface INamespaceEntry {
+ /**
+ * Get the underlying {@link ISecurePreferences} node that represents this {@link INamespaceEntry}
+ * in the storage.
+ *
+ * @return {@link ISecurePreferences} that represents this IIDEntry in the underlying storage. Will
+ * not return <code>null</code>.
+ */
public ISecurePreferences getPreferences();
+ /**
+ * Get the {@link IIDEntry}s for this namespace that are currently stored.
+ *
+ * @return IIDEntry array of for the IDs that are stored for this Namespace. Will not return <code>null</code>.
+ */
public IIDEntry[] getIDEntries();
+ /**
+ * Delete this {@link INamespaceEntry} from the {@link IIDStore}. Note that this <b>will</b> also delete
+ * all ID entries underneath this Namespace, and so should be used with caution.
+ *
+ */
public void delete();
}

Back to the top