Adding JMCR-Stable version
[Benchmarks_CSolver.git] / JMCR-Stable / real-world application / MyDerby-10.3 / java / engine / org / apache / derby / iapi / reference / Attribute.java
diff --git a/JMCR-Stable/real-world application/MyDerby-10.3/java/engine/org/apache/derby/iapi/reference/Attribute.java b/JMCR-Stable/real-world application/MyDerby-10.3/java/engine/org/apache/derby/iapi/reference/Attribute.java
new file mode 100644 (file)
index 0000000..2d56b78
--- /dev/null
@@ -0,0 +1,276 @@
+/*\r
+\r
+   Derby - Class org.apache.derby.iapi.reference.Attribute\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.reference;\r
+\r
+\r
+/**\r
+       List of all connection (JDBC) attributes by the system.\r
+\r
+\r
+       <P>\r
+       This class exists for two reasons\r
+       <Ol>\r
+       <LI> To act as the internal documentation for the attributes. \r
+       <LI> To remove the need to declare a java static field for the attributes\r
+       name in the protocol/implementation class. This reduces the footprint as\r
+       the string is final and thus can be included simply as a String constant pool entry.\r
+       </OL>\r
+       <P>\r
+       This class should not be shipped with the product.\r
+\r
+       <P>\r
+       This class has no methods, all it contains are String's which by\r
+       are public, static and final since they are declared in an interface.\r
+    \r
+    <P>\r
+    At some point this class should be replaced by\r
+    org.apache.derby.shared.common.reference.Attribute.\r
+    The issue is that this class is used by ij to check attributes,\r
+    ij uses reflection on this class to get the list of valid attributes.\r
+    The expanded class in shared has the client attributes as well.\r
+    Ideally ij would work of an explicit list of attributes and not\r
+    infer the set from reflection. See DERBY-1151\r
+*/\r
+\r
+public interface Attribute {\r
+\r
+       /**\r
+               Not an attribute but the root for the JDBC URL that Derby supports.\r
+       */\r
+       String PROTOCOL = "jdbc:derby:";\r
+               \r
+       /**\r
+        * The SQLJ protocol for getting the default connection\r
+        * for server side jdbc\r
+        */\r
+       String SQLJ_NESTED = "jdbc:default:connection";\r
+\r
+       \r
+       // Network Protocols.  These need to be rejected by the embedded driver.\r
+       \r
+       /**\r
+        * The protocol for Derby Network Client \r
+        */ \r
+       String DNC_PROTOCOL = "jdbc:derby://";\r
+       \r
+       /** \r
+        * The protocol for the IBM Universal JDBC Driver \r
+        * \r
+        */\r
+       String JCC_PROTOCOL = "jdbc:derby:net:";\r
+       \r
+       \r
+       /**\r
+               Attribute name to encrypt the database on disk.\r
+               If set to true, all user data is stored encrypted on disk.\r
+        */\r
+       String DATA_ENCRYPTION = "dataEncryption";\r
+\r
+       /**\r
+               If dataEncryption is true, use this attribute to pass in the \r
+               secret key.  The secret key must be at least 8 characters long.\r
+               This key must not be stored persistently in cleartext anywhere. \r
+        */\r
+\r
+       String BOOT_PASSWORD = "bootPassword";\r
+\r
+    /**\r
+           The attribute that is used to chage the secret key of an encrypted\r
+        database. The secret key must be at least 8 characters long.\r
+               This key must not be stored persistently in cleartext anywhere. \r
+        */\r
+\r
+       String NEW_BOOT_PASSWORD = "newBootPassword";\r
+\r
+\r
+\r
+       /**\r
+               The attribute that is used for the database name, from\r
+               the JDBC notion of jdbc:<subprotocol>:<subname>\r
+       */\r
+       String DBNAME_ATTR = "databaseName";\r
+\r
+       /**\r
+               The attribute that is used to request a shutdown.\r
+       */\r
+       String SHUTDOWN_ATTR = "shutdown";\r
+\r
+       /**\r
+               The attribute that is used to request a database create.\r
+       */\r
+       String CREATE_ATTR = "create";\r
+\r
+       /**\r
+               The attribute that is used to set the user name.\r
+       */\r
+       String USERNAME_ATTR = "user";\r
+\r
+\r
+       /**\r
+               The attribute that is used to set the user password.\r
+       */\r
+       String PASSWORD_ATTR = "password";\r
+\r
+\r
+       /**\r
+               The attribute that is used to set the connection's DRDA ID.\r
+       */\r
+       String DRDAID_ATTR = "drdaID";\r
+\r
+       /**\r
+               The attribute that is used to allow upgrade.\r
+       */\r
+       String UPGRADE_ATTR = "upgrade";\r
+\r
+       /**\r
+               Put the log on a different device.\r
+        */\r
+       String LOG_DEVICE = "logDevice";\r
+\r
+       /**\r
+               Set the territory for the database.\r
+       */\r
+       String TERRITORY = "territory";\r
+\r
+    /**\r
+        Attribute for encrypting a database.\r
+        Specifies the cryptographic services provider.\r
+    */\r
+    String CRYPTO_PROVIDER = "encryptionProvider";\r
+\r
+    /**\r
+        Attribute for encrypting a database.\r
+        Specifies the cryptographic algorithm.\r
+    */\r
+    String CRYPTO_ALGORITHM = "encryptionAlgorithm";\r
+\r
+    /**\r
+        Attribute for encrypting a database.\r
+        Specifies the key length in bytes for the specified cryptographic algorithm.\r
+    */\r
+       String CRYPTO_KEY_LENGTH = "encryptionKeyLength";\r
+\r
+       /**\r
+        Attribute for encrypting a database.\r
+        Specifies the actual key. When this is specified\r
+               all the supplied crypto information is stored\r
+               external to the database, ie by the application.\r
+       */\r
+       String CRYPTO_EXTERNAL_KEY = "encryptionKey";\r
+\r
+\r
+    /**\r
+           The attribute that is used to chage the encryption \r
+        key of an encrypted database. When this is specified\r
+        all the supplied crypto information is stored\r
+        external to the database, ie by the application.\r
+       */\r
+       String NEW_CRYPTO_EXTERNAL_KEY = "newEncryptionKey";\r
+\r
+\r
+       /**\r
+          One can encrypt the database with an encryption key at create time.\r
+          For security reasons, this key is not made persistent in the database.\r
+\r
+          But it is necessary to verify the encryption key whenever booting the database  \r
+          before we access the data/logs to avoid the risk of corrupting the database because\r
+          of a wrong encryption key.\r
+\r
+          This attribute refers to the name of the file where encrypted data is stored for\r
+          verification of encryption key.\r
+        */\r
+       String CRYPTO_EXTERNAL_KEY_VERIFY_FILE = "verifyKey.dat";\r
+\r
+       \r
+       /**\r
+        *      This attribute is used to request to  create a database from backup.\r
+        *  This will throw error if a database with same already exists at the \r
+        *  location where we tring to create.\r
+        */\r
+       String CREATE_FROM = "createFrom";\r
+\r
+       /**\r
+        *      This attribute is used to request a database restore from backup.\r
+        *  It must be used only when the active database is corrupted,\r
+        *      because it will cleanup the existing database and replace \r
+        *      it from the backup.\r
+        */\r
+       String RESTORE_FROM = "restoreFrom";\r
+\r
+       /**\r
+               The attribute that is used to request a roll-forward recovery of the database.\r
+       */\r
+       String ROLL_FORWARD_RECOVERY_FROM = "rollForwardRecoveryFrom";\r
+\r
+    /**\r
+     * securityMechanism sets the DRDA mechanism in-use for the client.\r
+     * Internal only.\r
+     */\r
+    String CLIENT_SECURITY_MECHANISM = "securityMechanism";\r
+\r
+    /**\r
+     * Internal attributes. Mainly used by DRDA and Derby BUILTIN\r
+     * authentication provider in some security mechanism context\r
+     * (SECMEC_USRSSBPWD).\r
+     *\r
+     * DRDA_SECTKN_IN is the random client seed (RDs)\r
+     * DRDA_SECTKN_OUT is the random server seed (RDr)\r
+     */\r
+    String DRDA_SECTKN_IN = "drdaSecTokenIn";\r
+    String DRDA_SECTKN_OUT = "drdaSecTokenOut";\r
+    /**\r
+     * Internal attribute which holds the value of the securityMechanism\r
+     * attribute specified by the client. Used for passing information about\r
+     * which security mechanism to use from the network server to the embedded\r
+     * driver. Use another name than "securityMechanism" in order to prevent\r
+     * confusion if an attempt is made to establish an embedded connection with\r
+     * securityMechanism specified (see DERBY-3025).\r
+     */\r
+    String DRDA_SECMEC = "drdaSecMec";\r
+\r
+       /**\r
+        * Internal attribute. Used to always allow soft upgrade for\r
+        * authentication purposes in a two phase hard upgrade (to check\r
+        * database owner power before proceeding.  The purpose is to\r
+        * avoid failing soft upgrade due to a feature being set but not\r
+        * supported until after hard upgrade has taken place (e.g. during\r
+        * hard upgrade from 10.1 -> 10.3 or higher if\r
+        * derby.database.sqlAuthorization is set,\r
+        * cf. DD_Version#checkVersion).\r
+        */\r
+        String SOFT_UPGRADE_NO_FEATURE_CHECK = "softUpgradeNoFeatureCheck";\r
+\r
+       /**\r
+               Optional JDBC url attribute (at the database create time only) It can \r
+               be set to one of the following 2 values\r
+               1) UCS_BASIC (This means codepoint based collation. This will also be \r
+               the default collation used by Derby if no collation attribute is \r
+               specified on the JDBC url at the database create time. This collation \r
+               is what Derby 10.2 and prior have supported)\r
+               2)TERRITORY_BASED (the collation will be based on language \r
+               region specified by the exisiting Derby attribute called territory. \r
+               If the territory attribute is not specified at the database create \r
+               time, Derby will use java.util.Locale.getDefault to determine the \r
+               territory for the newly created database. \r
+       */\r
+       String COLLATION = "collation";\r
+}\r