KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > derby > iapi > services > property > PersistentSet


1 /*
2
3    Derby - Class org.apache.derby.iapi.services.property.PersistentSet
4
5    Licensed to the Apache Software Foundation (ASF) under one or more
6    contributor license agreements. See the NOTICE file distributed with
7    this work for additional information regarding copyright ownership.
8    The ASF licenses this file to you under the Apache License, Version 2.0
9    (the "License"); you may not use this file except in compliance with
10    the License. You may obtain a copy of the License at
11
12       http://www.apache.org/licenses/LICENSE-2.0
13
14    Unless required by applicable law or agreed to in writing, software
15    distributed under the License is distributed on an "AS IS" BASIS,
16    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17    See the License for the specific language governing permissions and
18    limitations under the License.
19
20  */

21
22 package org.apache.derby.iapi.services.property;
23
24 import java.util.Properties JavaDoc;
25
26 import java.io.Serializable JavaDoc;
27
28 import org.apache.derby.iapi.error.StandardException;
29
30 public interface PersistentSet
31 {
32     /**
33      * Gets a value for a stored property. The returned value will be:
34      *
35      * <OL>
36      * <LI> the de-serialized object associated with the key
37      * using setProperty if such a value is defined or
38      * <LI> the default de-serialized object associated with
39      * the key using setPropertyDefault if such a value
40      * is defined or
41      * <LI> null
42      * </OL>
43      *
44      * <p>
45      * The Store provides a transaction protected list of database properties.
46      * Higher levels of the system can store and retrieve these properties
47      * once Recovery has finished. Each property is a serializable object
48      * and is stored/retrieved using a String key.
49      * <p>
50      *
51      * @param key The "key" of the property that is being requested.
52      *
53      * @return object The requested object or null.
54      *
55      * @exception StandardException Standard exception policy.
56      **/

57     public Serializable JavaDoc getProperty(
58     String JavaDoc key)
59         throws StandardException;
60
61     /**
62      * Gets a default value for a stored property. The returned
63      * value will be:
64      *
65      * <OL>
66      * <LI> the default de-serialized object associated with
67      * the key using setPropertyDefault if such a value
68      * is defined or
69      * <LI> null
70      * </OL>
71      *
72      * <p>
73      * The Store provides a transaction protected list of database properties.
74      * Higher levels of the system can store and retrieve these properties
75      * once Recovery has finished. Each property is a serializable object
76      * and is stored/retrieved using a String key.
77      * <p>
78      *
79      * @param key The "key" of the property that is being requested.
80      *
81      * @return object The requested object or null.
82      *
83      * @exception StandardException Standard exception policy.
84      **/

85     public Serializable JavaDoc getPropertyDefault(
86     String JavaDoc key)
87         throws StandardException;
88
89
90     /**
91      * Return true if the default property is visible. A default
92      * is visible as long as the property is not set.
93      *
94      * @param key The "key" of the property that is being requested.
95      * @exception StandardException Standard exception policy.
96      **/

97     public boolean propertyDefaultIsVisible(String JavaDoc key) throws StandardException;
98
99     /**
100      * Sets the Serializable object associated with a property key.
101      * <p>
102      * See the discussion of getProperty().
103      * <p>
104      * The value stored may be a Formatable object or a Serializable object
105      * whose class name starts with java.*. This stops arbitary objects being
106      * stored in the database by class name, which will cause problems in
107      * obfuscated/non-obfuscated systems.
108      *
109      * @param key The key used to lookup this property.
110      * @param value The value to be associated with this key. If null,
111      * delete the property from the properties list.
112        @param dbOnlyProperty True if property is only ever searched for int the database properties.
113      *
114      * @exception StandardException Standard exception policy.
115      **/

116     public void setProperty(
117     String JavaDoc key,
118     Serializable JavaDoc value,
119     boolean dbOnlyProperty)
120         throws StandardException;
121
122     /**
123      * Sets the Serializable object default value associated with a property
124      * key.
125      * <p>
126      * See the discussion of getProperty().
127      * <p>
128      * The value stored may be a Formatable object or a Serializable object
129      * whose class name starts with java.*. This stops arbitary objects being
130      * stored in the database by class name, which will cause problems in
131      * obfuscated/non-obfuscated systems.
132      *
133      * @param key The key used to lookup this propertyDefault.
134      * @param value The default value to be associated with this key.
135      * If null, delete the property default from the
136      * properties list.
137      *
138      * @exception StandardException Standard exception policy.
139      **/

140     public void setPropertyDefault(
141     String JavaDoc key,
142     Serializable JavaDoc value)
143         throws StandardException;
144
145     /**
146      * Get properties that can be stored in a java.util.Properties object.
147      * <p>
148      * Get the sub-set of stored properties that can be stored in a
149      * java.util.Properties object. That is all the properties that have a
150      * value of type java.lang.String. Changes to this properties object are
151      * not reflected in any persisent storage.
152      * <p>
153      * Code must use the setProperty() method call.
154      *
155      * @return The sub-set of stored properties that can be stored in a
156      * java.util.Propertes object.
157      *
158      * @exception StandardException Standard exception policy.
159      **/

160     public Properties JavaDoc getProperties()
161         throws StandardException;
162 }
163
Popular Tags