Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'target_explorer/plugins/org.eclipse.tcf.te.runtime.persistence/src/org/eclipse/tcf/te/runtime/persistence/interfaces/IPersistenceDelegate.java')
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.runtime.persistence/src/org/eclipse/tcf/te/runtime/persistence/interfaces/IPersistenceDelegate.java65
1 files changed, 65 insertions, 0 deletions
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.runtime.persistence/src/org/eclipse/tcf/te/runtime/persistence/interfaces/IPersistenceDelegate.java b/target_explorer/plugins/org.eclipse.tcf.te.runtime.persistence/src/org/eclipse/tcf/te/runtime/persistence/interfaces/IPersistenceDelegate.java
new file mode 100644
index 000000000..915680503
--- /dev/null
+++ b/target_explorer/plugins/org.eclipse.tcf.te.runtime.persistence/src/org/eclipse/tcf/te/runtime/persistence/interfaces/IPersistenceDelegate.java
@@ -0,0 +1,65 @@
+/*******************************************************************************
+ * Copyright (c) 2011 Wind River Systems, Inc. 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
+ *
+ * Contributors:
+ * Wind River Systems - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.tcf.te.runtime.persistence.interfaces;
+
+import java.io.IOException;
+import java.net.URI;
+import java.util.Map;
+
+import org.eclipse.tcf.te.runtime.interfaces.extensions.IExecutableExtension;
+
+/**
+ * Interface to be implemented by persistence delegates.
+ */
+public interface IPersistenceDelegate extends IExecutableExtension {
+
+ /**
+ * Writes the given data to the given persistence storage.
+ * <p>
+ * The persistence storage location is defined by the specified URI reference. The exact
+ * interpretation and semantic of the URI reference is up to the persistence delegate
+ * contributor.
+ *
+ * @param uri The persistence storage location URI reference. Must not be <code>null</code>.
+ * @param data The data. Must not be <code>null</code>.
+ *
+ * @throws IOException - if the operation fails
+ */
+ public void write(URI uri, Map<String, Object> data) throws IOException;
+
+ /**
+ * Reads the data from the given persistence storage.
+ * <p>
+ * The persistence storage location is defined by the specified URI reference. The exact
+ * interpretation and semantic of the URI reference is up to the persistence delegate
+ * contributor.
+ *
+ * @param uri The persistence storage location URI reference. Must not be <code>null</code>.
+ * @return The data.
+ *
+ * @throws IOException - if the operation fails
+ */
+ public Map<String, Object> read(URI uri) throws IOException;
+
+ /**
+ * Deletes the given persistence storage.
+ * <p>
+ * The persistence storage location is defined by the specified URI reference. The exact
+ * interpretation and semantic of the URI reference is up to the persistence delegate
+ * contributor.
+ *
+ * @param uri The persistence storage location URI reference. Must not be <code>null</code>.
+ * @return <code>True</code> if the persistence storage is successfully deleted;
+ * <code>false</code> otherwise.
+ *
+ * @throws IOException - if the operation fails
+ */
+ public boolean delete(URI uri) throws IOException;
+}

Back to the top