James Moger
2015-11-22 ed552ba47c02779c270ffd62841d6d1048dade70
commit | author | age
db4f6b 1 /*
JM 2  * Copyright 2013 gitblit.com.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *     http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 package com.gitblit.manager;
17
18 import java.io.File;
19 import java.util.Date;
a8100b 20 import java.util.Locale;
db4f6b 21 import java.util.Map;
JM 22 import java.util.TimeZone;
23
24 import com.gitblit.IStoredSettings;
25 import com.gitblit.models.ServerSettings;
26 import com.gitblit.models.ServerStatus;
fc3a39 27 import com.gitblit.utils.XssFilter;
c828cf 28 import com.google.inject.Injector;
db4f6b 29
e24670 30 public interface IRuntimeManager extends IManager {
db4f6b 31
c828cf 32     Injector getInjector();
JM 33
db4f6b 34     void setBaseFolder(File folder);
JM 35
36     File getBaseFolder();
37
38     /**
39      * Returns the preferred timezone for the Gitblit instance.
40      *
41      * @return a timezone
3a6499 42       * @since 1.4.0
db4f6b 43      */
JM 44     TimeZone getTimezone();
45
46     /**
a8100b 47      * Returns the fixed locale for clients, or null if clients may choose their locale
JM 48      *
49      * @return a fixed locale or null if clients are allowed to specify locale preference
50       * @since 1.5.1
51      */
52     Locale getLocale();
53
54     /**
db4f6b 55      * Determine if this Gitblit instance is running in debug mode
JM 56      *
57      * @return true if Gitblit is running in debug mode
3a6499 58       * @since 1.4.0
db4f6b 59      */
JM 60     boolean isDebugMode();
61
62     /**
63      * Returns the boot date of the Gitblit server.
64      *
65      * @return the boot date of Gitblit
3a6499 66       * @since 1.4.0
db4f6b 67      */
JM 68     Date getBootDate();
69
3a6499 70     /**
JM 71      * Returns the server status.
72      *
73      * @return the server status
74        * @since 1.4.0
75      */
db4f6b 76     ServerStatus getStatus();
JM 77
78     /**
79      * Returns the descriptions/comments of the Gitblit config settings.
80      *
81      * @return SettingsModel
3a6499 82       * @since 1.4.0
db4f6b 83      */
JM 84     ServerSettings getSettingsModel();
85
86     /**
87      * Returns the file object for the specified configuration key.
88      *
89      * @return the file
3a6499 90       * @since 1.4.0
db4f6b 91      */
JM 92     File getFileOrFolder(String key, String defaultFileOrFolder);
93
94     /**
95      * Returns the file object which may have it's base-path determined by
96      * environment variables for running on a cloud hosting service. All Gitblit
97      * file or folder retrievals are (at least initially) funneled through this
98      * method so it is the correct point to globally override/alter filesystem
99      * access based on environment or some other indicator.
100      *
101      * @return the file
3a6499 102       * @since 1.4.0
db4f6b 103      */
JM 104     File getFileOrFolder(String fileOrFolder);
105
106     /**
107      * Returns the runtime settings.
108      *
109      * @return settings
3a6499 110       * @since 1.4.0
db4f6b 111      */
JM 112     IStoredSettings getSettings();
113
114     /**
115      * Updates the runtime settings.
116      *
117      * @param settings
118      * @return true if the update succeeded
3a6499 119       * @since 1.4.0
db4f6b 120      */
JM 121     boolean updateSettings(Map<String, String> updatedSettings);
fc3a39 122
JM 123     /**
124      * Returns the HTML sanitizer used to clean user content.
125      *
126      * @return the HTML sanitizer
127      */
128     XssFilter getXssFilter();
db4f6b 129 }