001/*
002// This software is subject to the terms of the Eclipse Public License v1.0
003// Agreement, available at the following URL:
004// http://www.eclipse.org/legal/epl-v10.html.
005// You must accept the terms of that agreement to use this software.
006//
007// Copyright (C) 2003-2005 Julian Hyde
008// Copyright (C) 2005-2012 Pentaho
009// All Rights Reserved.
010*/
011package mondrian.rolap;
012
013import java.lang.ref.SoftReference;
014
015/**
016 * <code>RolapConnectionProperties</code> enumerates the allowable values of
017 * keywords in a Mondrian connect string.
018 *
019 * <p><b>Note to developers</b>: If you add or modify a connection-string
020 * property, you must also modify the
021 * <a target="_top"
022 * href="{@docRoot}/../configuration.html#Connect_string_properties">
023 * Configuration Specification</a>.
024 *
025 * @author jhyde, Mar 18, 2003
026 */
027public enum RolapConnectionProperties {
028    /**
029     * The "Provider" property must have the value <code>"Mondrian"</code>.
030     */
031    Provider,
032
033    /**
034     * The "Jdbc" property is the URL of the JDBC database where the data is
035     * stored. You must specify either {@link #DataSource} or {@code #Jdbc}.
036     */
037    Jdbc,
038
039    /**
040     * The "JdbcDrivers" property is a comma-separated list of JDBC driver
041     * classes, for example,
042     * <code>"sun.jdbc.odbc.JdbcOdbcDriver,oracle.jdbc.OracleDriver"</code>.
043     */
044    JdbcDrivers,
045
046    /**
047     * The "JdbcUser" property is the name of the user to log on to the JDBC
048     * database. (You don't need to specify this parameter if it is already
049     * specified in the JDBC URL.)
050     */
051    JdbcUser,
052
053    /**
054     * The "JdbcPassword" property is the password to log on to the JDBC
055     * database. (You don't need to specify this parameter if it is already
056     * specified in the JDBC URL.)
057     */
058    JdbcPassword,
059
060    /**
061     * The "Catalog" property is the URL of the catalog, an XML file which
062     * describes the schema: cubes, hierarchies, and so forth.
063     * Catalogs are described in <a target="_top"
064     * href="{@docRoot}/../schema.html">the Schema Guide</a>.
065     * See also {@link #CatalogContent}.
066     */
067    Catalog,
068
069    /**
070     * The "CatalogContent" property is an XML string representing the schema:
071     * cubes, hierarchies, and so forth.
072     * Catalogs are described in <a target="_top"
073     * href="{@docRoot}/../schema.html">the Schema Guide</a>.
074     *
075     * <p>When using this property, quote its value with either single or
076     * double quotes, then escape all occurrences of that character within the
077     * catalog content by using double single/double quotes. ie:
078     *
079     * <p>&nbsp;&nbsp;CatalogContent="&lt;Schema name=""My Schema""/&gt;"
080     *
081     * <p>See also {@link #Catalog}.
082     */
083    CatalogContent,
084
085    /**
086     * The "CatalogName" property is not used. If, in future, we support
087     * multiple catalogs, this property will specify which catalog to use.
088     * See also {@link #Catalog}.
089     */
090    CatalogName,
091
092    /**
093     * The "DataSource" property is the name of a data source class. It must
094     * implement the {@link javax.sql.DataSource} interface.
095     * You must specify either {@code DataSource} or {@link #Jdbc}.
096     */
097    DataSource,
098
099    /**
100     * The "PoolNeeded" property tells Mondrian whether to add a layer of
101     * connection pooling.
102     *
103     * <p>If no value is specified, we assume that:<ul>
104     * <li>connections created via the {@link #Jdbc} property are not pooled,
105     *     and therefore need to be pooled,
106     * <li>connections created via the {@link #DataSource} are already pooled.
107     * </ul>
108     */
109    PoolNeeded,
110
111    /**
112     * The "Role" property is the name of the {@link mondrian.olap.Role role}
113     * to adopt. If not specified, the connection uses a role which has access
114     * to every object in the schema.
115     */
116    Role,
117
118    /**
119     * Allows to work with dynamically changing schema. If this property is set
120     * to <code>true</code> and schema content has changed (previous checksum
121     * doesn't equal with current), schema would be reloaded. Could be used in
122     * combination with <code>DynamicSchemaProcessor</code> property
123     */
124    UseContentChecksum,
125
126    /**
127     * The "UseSchemaPool" property disables the schema cache. If false, the
128     * schema is not shared with connections which have a textually identical
129     * schema. Default is "true".
130     */
131    UseSchemaPool,
132
133    /**
134     * The name of a class implementing the
135     * {@link mondrian.spi.DynamicSchemaProcessor} interface.
136     * A dynamic schema processor is called at runtime in order to modify the
137     * schema content.
138     */
139    DynamicSchemaProcessor,
140
141    /**
142     * The "Locale" property is the requested Locale for the
143     * LocalizingDynamicSchemaProcessor.  Example values are "en",
144     * "en_US", "hu". If Locale is not specified, then the name of system's
145     * default will be used, as per {@link java.util.Locale#getDefault()}.
146     */
147    Locale,
148
149    /**
150     * The name of a class implementing the
151     * {@link mondrian.spi.DataSourceChangeListener} interface.
152     * A data source change listener is used to flush the cache of
153     * mondrian every time the datasource is changed.
154     */
155    DataSourceChangeListener,
156
157    /**
158     * The "Ignore" property is a boolean value. If true, mondrian ignores
159     * warnings and non-fatal errors while loading the schema. The resulting
160     * errors can be obtained by calling
161     * {@link mondrian.olap.Schema#getWarnings}.
162     */
163    Ignore,
164
165    /**
166     * The "Instance" property is the unique identifier of a mondrian server
167     * running in the current JVM. If there are multiple mondrian servers, it
168     * ensures that the connection belongs to the correct one.
169     */
170    Instance,
171
172    /**
173     * The "JdbcConnectionUuid" property is the unique identifier for the
174     * underlying JDBC connection. If defined, Mondrian will assume that two
175     * connections bearing the same JdbcConnectionUuid point to identical
176     * databases without looking at any other properties.
177     */
178    JdbcConnectionUuid,
179
180    /**
181     * The "PinSchemaTimeout" defines how much time must Mondrian
182     * keep a hard reference to schema objects within the pool of schemas.
183     *
184     * <p>After the timeout is reached, the hard reference will be cleared
185     * and the schema will be made a candidate for garbage collection. If the
186     * timeout wasn't reached yet and a second query requires the same schema,
187     * the timeout will be re-computed from the time of the second access and
188     * a new hard reference is established until the new timer reaches its end.
189     *
190     * <p>If the timeout is equal to zero, the schema will get
191     * pinned permanently. It is inadvisable to use this mode when using
192     * a DynamicSchemaProcessor at the risk of filling up the memory.
193     *
194     * <p>If the timeout is a negative value, the reference will behave
195     * the same as a {@link SoftReference}. This is the default behavior.
196     *
197     * <p>The timeout value must be provided as a String representing
198     * both the time value and the time unit. For example, 1 second is
199     * represented as "1s". Valid time units are [d, h, m, s, ms],
200     * representing respectively days, hours, minutes, seconds and
201     * milliseconds.
202     *
203     * <p>Defaults to "-1s".
204     */
205    PinSchemaTimeout;
206
207    /**
208     * Any property beginning with this value will be added to the
209     * JDBC connection properties, after removing this prefix. This
210     * allows you to specify connection properties without a URL.
211     */
212    public static final String JdbcPropertyPrefix = "jdbc.";
213
214}
215
216// End RolapConnectionProperties.java