~ubuntu-branches/debian/sid/subversion/sid

« back to all changes in this revision

Viewing changes to subversion/bindings/javahl/src/org/apache/subversion/javahl/ISVNConfig.java

  • Committer: Package Import Robot
  • Author(s): James McCoy
  • Date: 2015-08-07 21:32:47 UTC
  • mfrom: (0.2.15) (4.1.7 experimental)
  • Revision ID: package-import@ubuntu.com-20150807213247-ozyewtmgsr6tkewl
Tags: 1.9.0-1
* Upload to unstable
* New upstream release.
  + Security fixes
    - CVE-2015-3184: Mixed anonymous/authenticated path-based authz with
      httpd 2.4
    - CVE-2015-3187: svn_repos_trace_node_locations() reveals paths hidden
      by authz
* Add >= 2.7 requirement for python-all-dev Build-Depends, needed to run
  tests.
* Remove Build-Conflicts against ruby-test-unit.  (Closes: #791844)
* Remove patches/apache_module_dependency in favor of expressing the
  dependencies in authz_svn.load/dav_svn.load.
* Build-Depend on apache2-dev (>= 2.4.16) to ensure ap_some_authn_required()
  is available when building mod_authz_svn and Depend on apache2-bin (>=
  2.4.16) for runtime support.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/**
 
2
 * @copyright
 
3
 * ====================================================================
 
4
 *    Licensed to the Apache Software Foundation (ASF) under one
 
5
 *    or more contributor license agreements.  See the NOTICE file
 
6
 *    distributed with this work for additional information
 
7
 *    regarding copyright ownership.  The ASF licenses this file
 
8
 *    to you under the Apache License, Version 2.0 (the
 
9
 *    "License"); you may not use this file except in compliance
 
10
 *    with 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,
 
15
 *    software distributed under the License is distributed on an
 
16
 *    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 
17
 *    KIND, either express or implied.  See the License for the
 
18
 *    specific language governing permissions and limitations
 
19
 *    under the License.
 
20
 * ====================================================================
 
21
 * @endcopyright
 
22
 */
 
23
 
 
24
package org.apache.subversion.javahl;
 
25
 
 
26
import org.apache.subversion.javahl.types.Tristate;
 
27
 
 
28
/**
 
29
 * Interface for manipulating the in-memory configuration info.
 
30
 * @since 1.9
 
31
 */
 
32
public interface ISVNConfig
 
33
{
 
34
    /**
 
35
     * Returns a reference to the "config" configuration category.
 
36
     */
 
37
    Category config();
 
38
 
 
39
    /*
 
40
     * The following constants are section and option names from the
 
41
     * "config" configuration file.
 
42
     */
 
43
    public static final String SECTION_AUTH          = "auth";
 
44
    public static final String PASSWORD_STORES           = "password-stores";
 
45
    public static final String KWALLET_WALLET            = "kwallet-wallet";
 
46
    public static final String KWALLET_SVN_APPLICATION_NAME_WITH_PID = "kwallet-svn-application-name-with-pid";
 
47
    public static final String SSL_CLIENT_CERT_FILE_PROMPT = "ssl-client-cert-file-prompt";
 
48
 
 
49
    public static final String SECTION_HELPERS       = "helpers";
 
50
    public static final String EDITOR_CMD                = "editor-cmd";
 
51
    public static final String DIFF_CMD                  = "diff-cmd";
 
52
    public static final String DIFF_EXTENSIONS           = "diff-extensions";
 
53
    public static final String DIFF3_CMD                 = "diff3-cmd";
 
54
    public static final String DIFF3_HAS_PROGRAM_ARG     = "diff3-has-program-arg";
 
55
    public static final String MERGE_TOOL_CMD            = "merge-tool-cmd";
 
56
 
 
57
    public static final String SECTION_MISCELLANY    = "miscellany";
 
58
    public static final String GLOBAL_IGNORES            = "global-ignores";
 
59
    public static final String LOG_ENCODING              = "log-encoding";
 
60
    public static final String USE_COMMIT_TIMES          = "use-commit-times";
 
61
    public static final String ENABLE_AUTO_PROPS         = "enable-auto-props";
 
62
    public static final String ENABLE_MAGIC_FILE         = "enable-magic-file";
 
63
    public static final String NO_UNLOCK                 = "no-unlock";
 
64
    public static final String MIMETYPES_FILE            = "mime-types-file";
 
65
    public static final String PRESERVED_CF_EXTS         = "preserved-conflict-file-exts";
 
66
    public static final String INTERACTIVE_CONFLICTS     = "interactive-conflicts";
 
67
    public static final String MEMORY_CACHE_SIZE         = "memory-cache-size";
 
68
    public static final String DIFF_IGNORE_CONTENT_TYPE  = "diff-ignore-content-type";
 
69
 
 
70
    public static final String SECTION_TUNNELS       = "tunnels";
 
71
 
 
72
    public static final String SECTION_AUTO_PROPS    = "auto-props";
 
73
 
 
74
    public static final String SECTION_WORKING_COPY  = "working-copy";
 
75
    public static final String SQLITE_EXCLUSIVE          = "exclusive-locking";
 
76
    public static final String SQLITE_EXCLUSIVE_CLIENTS  = "exclusive-locking-clients";
 
77
    public static final String SQLITE_BUSY_TIMEOUT       = "busy-timeout";
 
78
 
 
79
    /**
 
80
     * Returns a reference to the "servers" configuration category.
 
81
     */
 
82
    Category servers();
 
83
 
 
84
    /*
 
85
     * The following constants are section and option names from the
 
86
     * "servers" configuration file.
 
87
     */
 
88
    public static final String SECTION_GROUPS        = "groups";
 
89
    public static final String SECTION_GLOBAL        = "global";
 
90
 
 
91
    public static final String HTTP_PROXY_HOST           = "http-proxy-host";
 
92
    public static final String HTTP_PROXY_PORT           = "http-proxy-port";
 
93
    public static final String HTTP_PROXY_USERNAME       = "http-proxy-username";
 
94
    public static final String HTTP_PROXY_PASSWORD       = "http-proxy-password";
 
95
    public static final String HTTP_PROXY_EXCEPTIONS     = "http-proxy-exceptions";
 
96
    public static final String HTTP_TIMEOUT              = "http-timeout";
 
97
    public static final String HTTP_COMPRESSION          = "http-compression";
 
98
    public static final String NEON_DEBUG_MASK           = "neon-debug-mask";
 
99
    public static final String HTTP_AUTH_TYPES           = "http-auth-types";
 
100
    public static final String SSL_AUTHORITY_FILES       = "ssl-authority-files";
 
101
    public static final String SSL_TRUST_DEFAULT_CA      = "ssl-trust-default-ca";
 
102
    public static final String SSL_CLIENT_CERT_FILE      = "ssl-client-cert-file";
 
103
    public static final String SSL_CLIENT_CERT_PASSWORD  = "ssl-client-cert-password";
 
104
    public static final String SSL_PKCS11_PROVIDER       = "ssl-pkcs11-provider";
 
105
    public static final String HTTP_LIBRARY              = "http-library";
 
106
    public static final String STORE_PASSWORDS           = "store-passwords";
 
107
    public static final String STORE_PLAINTEXT_PASSWORDS = "store-plaintext-passwords";
 
108
    public static final String STORE_AUTH_CREDS          = "store-auth-creds";
 
109
    public static final String STORE_SSL_CLIENT_CERT_PP  = "store-ssl-client-cert-pp";
 
110
    public static final String STORE_SSL_CLIENT_CERT_PP_PLAINTEXT = "store-ssl-client-cert-pp-plaintext";
 
111
    public static final String USERNAME                  = "username";
 
112
    public static final String HTTP_BULK_UPDATES         = "http-bulk-updates";
 
113
    public static final String HTTP_MAX_CONNECTIONS      = "http-max-connections";
 
114
    public static final String HTTP_CHUNKED_REQUESTS     = "http-chunked-requests";
 
115
    public static final String SERF_LOG_COMPONENTS       = "serf-log-components";
 
116
    public static final String SERF_LOG_LEVEL            = "serf-log-level";
 
117
 
 
118
    /**
 
119
     * "true" value in configuration. One of the values returned by
 
120
     * {@link Category#getYesNoAsk}.
 
121
     */
 
122
    public static final String TRUE = "TRUE";
 
123
 
 
124
    /**
 
125
     * "false" value in configuration. One of the values returned by
 
126
     * {@link Category#getYesNoAsk}.
 
127
     */
 
128
    public static final String FALSE = "FALSE";
 
129
 
 
130
    /**
 
131
     * "ask" value in configuration. One of the values returned by
 
132
     * {@link Category#getYesNoAsk}.
 
133
     */
 
134
    public static final String ASK = "ASK";
 
135
 
 
136
    /**
 
137
     * Interface for reading and modifying configuration
 
138
     * categories. Returned by {@link #config()} and
 
139
     * {@link #servers()}.
 
140
     */
 
141
    public interface Category
 
142
    {
 
143
        /**
 
144
         * Returns the value of a configuration option.
 
145
         * @param section      The section name
 
146
         * @param option       The option name
 
147
         * @param defaultValue Return this if the option was not found.
 
148
         */
 
149
        String get(String section,
 
150
                   String option,
 
151
                   String defaultValue);
 
152
 
 
153
        /**
 
154
         * Returns the boolean value of a configuration option. The
 
155
         * recognized representations are 'true'/'false', 'yes'/'no',
 
156
         * 'on'/'off', '1'/'0'; case does not matter.
 
157
         * @throws ClientException if the value cannot be parsed.
 
158
         * @see #get(String,String,String)
 
159
         */
 
160
        boolean get(String section,
 
161
                    String option,
 
162
                    boolean defaultValue)
 
163
            throws ClientException;
 
164
 
 
165
        /**
 
166
         * Returns the long integer value of a configuration option.
 
167
         * @see #get(String,String,boolean)
 
168
         */
 
169
        long get(String section,
 
170
                 String option,
 
171
                 long defaultValue)
 
172
            throws ClientException;
 
173
 
 
174
        /**
 
175
         * Returns the {@link Tristate} value of a configuration option.
 
176
         * @param unknown The value used for {@link Tristate#Unknown}.
 
177
         * @see #get(String,String,boolean)
 
178
         */
 
179
        Tristate get(String section,
 
180
                     String option,
 
181
                     String unknown,
 
182
                     Tristate defaultValue)
 
183
            throws ClientException;
 
184
 
 
185
        /**
 
186
         * Check that the configuration option's value is true, false
 
187
         * or "ask". The boolean representations are the same as those
 
188
         * understood by {@link #get(String,String,boolean)}. If the
 
189
         * option is not found, the default value will be parsed
 
190
         * instead.
 
191
         * @return {@link ISVNConfig#TRUE}, {@link ISVNConfig#FALSE}
 
192
         *         or {@link ISVNConfig#ASK}
 
193
         * @throws ClientException if the either the value or the
 
194
         *         default cannot be parsed.
 
195
         */
 
196
        String getYesNoAsk(String section,
 
197
                           String option,
 
198
                           String defaultValue)
 
199
            throws ClientException;
 
200
 
 
201
        /**
 
202
         * Set the value of a configuration option.
 
203
         * @param section  The section name
 
204
         * @param option   The option name
 
205
         * @param value    The value to set the option to; passing
 
206
         *                 <code>null</code> will delete the option.
 
207
         */
 
208
        void set(String section,
 
209
                 String option,
 
210
                 String value);
 
211
 
 
212
        /**
 
213
         * Set the value of a configuration option to represent a boolean.
 
214
         * @see #set(String,String,String)
 
215
         */
 
216
        void set(String section,
 
217
                 String option,
 
218
                 boolean value);
 
219
 
 
220
        /**
 
221
         * Set the value of a configuration option to represent a long integer.
 
222
         * @see #set(String,String,String)
 
223
         */
 
224
        void set(String section,
 
225
                 String option,
 
226
                 long value);
 
227
 
 
228
        /**
 
229
         * @return the names of all the sections in the
 
230
         * configuration category.
 
231
         */
 
232
        Iterable<String> sections();
 
233
 
 
234
        /**
 
235
         * Call <code>handler</code> once for each option in the
 
236
         * configuration category.
 
237
         */
 
238
        void enumerate(String section, Enumerator handler);
 
239
    }
 
240
 
 
241
    /**
 
242
     * Interface for {@link Category#enumerate} callback handlers.
 
243
     */
 
244
    public interface Enumerator
 
245
    {
 
246
        void option(String name, String value);
 
247
    }
 
248
}