Adding JMCR-Stable version
[Benchmarks_CSolver.git] / JMCR-Stable / real-world application / derby-10.3.2.1 / java / engine / org / apache / derby / iapi / services / property / PersistentSet.java
diff --git a/JMCR-Stable/real-world application/derby-10.3.2.1/java/engine/org/apache/derby/iapi/services/property/PersistentSet.java b/JMCR-Stable/real-world application/derby-10.3.2.1/java/engine/org/apache/derby/iapi/services/property/PersistentSet.java
new file mode 100644 (file)
index 0000000..cc20eea
--- /dev/null
@@ -0,0 +1,162 @@
+/*\r
+\r
+   Derby - Class org.apache.derby.iapi.services.property.PersistentSet\r
+\r
+   Licensed to the Apache Software Foundation (ASF) under one or more\r
+   contributor license agreements.  See the NOTICE file distributed with\r
+   this work for additional information regarding copyright ownership.\r
+   The ASF licenses this file to you under the Apache License, Version 2.0\r
+   (the "License"); you may not use this file except in compliance with\r
+   the License.  You may obtain a copy of the License at\r
+\r
+      http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+   Unless required by applicable law or agreed to in writing, software\r
+   distributed under the License is distributed on an "AS IS" BASIS,\r
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+   See the License for the specific language governing permissions and\r
+   limitations under the License.\r
+\r
+ */\r
+\r
+package org.apache.derby.iapi.services.property;\r
+\r
+import java.util.Properties;\r
+\r
+import java.io.Serializable;\r
+\r
+import org.apache.derby.iapi.error.StandardException;\r
+\r
+public interface PersistentSet\r
+{\r
+    /**\r
+     * Gets a value for a stored property. The returned value will be:\r
+        *\r
+        * <OL>\r
+        * <LI> the de-serialized object associated with the key\r
+        *      using setProperty if such a value is defined or\r
+        * <LI> the default de-serialized object associated with\r
+        *      the key using setPropertyDefault if such a value\r
+        *      is defined or\r
+        * <LI> null\r
+        * </OL>\r
+        *      \r
+     * <p>\r
+     * The Store provides a transaction protected list of database properties.\r
+     * Higher levels of the system can store and retrieve these properties\r
+     * once Recovery has finished. Each property is a serializable object\r
+     * and is stored/retrieved using a String key.\r
+     * <p>\r
+     *\r
+     * @param key     The "key" of the property that is being requested.\r
+     *\r
+        * @return object The requested object or null.\r
+     *\r
+        * @exception  StandardException  Standard exception policy.\r
+     **/\r
+    public Serializable getProperty(\r
+    String key) \r
+        throws StandardException;\r
+\r
+    /**\r
+     * Gets a default value for a stored property. The returned\r
+        * value will be:\r
+        *\r
+        * <OL>\r
+        * <LI> the default de-serialized object associated with\r
+        *      the key using setPropertyDefault if such a value\r
+        *      is defined or\r
+        * <LI> null\r
+        * </OL>\r
+        *      \r
+     * <p>\r
+     * The Store provides a transaction protected list of database properties.\r
+     * Higher levels of the system can store and retrieve these properties\r
+     * once Recovery has finished. Each property is a serializable object\r
+     * and is stored/retrieved using a String key.\r
+     * <p>\r
+     *\r
+     * @param key     The "key" of the property that is being requested.\r
+     *\r
+        * @return object The requested object or null.\r
+     *\r
+        * @exception  StandardException  Standard exception policy.\r
+     **/\r
+    public Serializable getPropertyDefault(\r
+    String key) \r
+        throws StandardException;\r
+\r
+\r
+    /**\r
+     * Return true if the default property is visible. A default\r
+        * is visible as long as the property is not set.\r
+     *\r
+     * @param key     The "key" of the property that is being requested.\r
+        * @exception  StandardException  Standard exception policy.\r
+     **/\r
+    public boolean propertyDefaultIsVisible(String key) throws StandardException;\r
+\r
+    /**\r
+     * Sets the Serializable object associated with a property key.\r
+     * <p>\r
+     * See the discussion of getProperty().\r
+     * <p>\r
+     * The value stored may be a Formatable object or a Serializable object\r
+        * whose class name starts with java.*. This stops arbitary objects being\r
+        * stored in the database by class name, which will cause problems in\r
+        * obfuscated/non-obfuscated systems.\r
+     *\r
+        * @param       key             The key used to lookup this property.\r
+        * @param       value   The value to be associated with this key. If null, \r
+     *                  delete the property from the properties list.\r
+          @param   dbOnlyProperty True if property is only ever searched for int the database properties.\r
+     *\r
+        * @exception  StandardException  Standard exception policy.\r
+     **/\r
+    public void        setProperty(\r
+    String          key, \r
+    Serializable    value,\r
+       boolean dbOnlyProperty) \r
+        throws StandardException;\r
+\r
+    /**\r
+     * Sets the Serializable object default value associated with a property\r
+        * key.\r
+     * <p>\r
+     * See the discussion of getProperty().\r
+     * <p>\r
+     * The value stored may be a Formatable object or a Serializable object\r
+        * whose class name starts with java.*. This stops arbitary objects being\r
+        * stored in the database by class name, which will cause problems in\r
+        * obfuscated/non-obfuscated systems.\r
+     *\r
+        * @param       key             The key used to lookup this propertyDefault.\r
+        * @param       value   The default value to be associated with this key. \r
+     *                  If null, delete the property default from the\r
+        *                  properties list.\r
+     *\r
+        * @exception  StandardException  Standard exception policy.\r
+     **/\r
+    public void        setPropertyDefault(\r
+    String          key, \r
+    Serializable    value) \r
+        throws StandardException;\r
+\r
+    /**\r
+     * Get properties that can be stored in a java.util.Properties object.\r
+     * <p>\r
+        * Get the sub-set of stored properties that can be stored in a \r
+     * java.util.Properties object. That is all the properties that have a\r
+     * value of type java.lang.String.  Changes to this properties object are\r
+     * not reflected in any persisent storage.\r
+     * <p>\r
+     * Code must use the setProperty() method call.\r
+     *\r
+        * @return The sub-set of stored properties that can be stored in a \r
+     *         java.util.Propertes object.\r
+     *\r
+        * @exception  StandardException  Standard exception policy.\r
+     **/\r
+       public Properties getProperties() \r
+        throws StandardException;\r
+}\r