You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

IRuntimeManager.java 2.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. /*
  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. import java.io.File;
  18. import java.util.Date;
  19. import java.util.Locale;
  20. import java.util.Map;
  21. import java.util.TimeZone;
  22. import com.gitblit.IStoredSettings;
  23. import com.gitblit.models.ServerSettings;
  24. import com.gitblit.models.ServerStatus;
  25. import com.google.inject.Injector;
  26. public interface IRuntimeManager extends IManager {
  27. Injector getInjector();
  28. void setBaseFolder(File folder);
  29. File getBaseFolder();
  30. /**
  31. * Returns the preferred timezone for the Gitblit instance.
  32. *
  33. * @return a timezone
  34. * @since 1.4.0
  35. */
  36. TimeZone getTimezone();
  37. /**
  38. * Returns the fixed locale for clients, or null if clients may choose their locale
  39. *
  40. * @return a fixed locale or null if clients are allowed to specify locale preference
  41. * @since 1.5.1
  42. */
  43. Locale getLocale();
  44. /**
  45. * Determine if this Gitblit instance is running in debug mode
  46. *
  47. * @return true if Gitblit is running in debug mode
  48. * @since 1.4.0
  49. */
  50. boolean isDebugMode();
  51. /**
  52. * Returns the boot date of the Gitblit server.
  53. *
  54. * @return the boot date of Gitblit
  55. * @since 1.4.0
  56. */
  57. Date getBootDate();
  58. /**
  59. * Returns the server status.
  60. *
  61. * @return the server status
  62. * @since 1.4.0
  63. */
  64. ServerStatus getStatus();
  65. /**
  66. * Returns the descriptions/comments of the Gitblit config settings.
  67. *
  68. * @return SettingsModel
  69. * @since 1.4.0
  70. */
  71. ServerSettings getSettingsModel();
  72. /**
  73. * Returns the file object for the specified configuration key.
  74. *
  75. * @return the file
  76. * @since 1.4.0
  77. */
  78. File getFileOrFolder(String key, String defaultFileOrFolder);
  79. /**
  80. * Returns the file object which may have it's base-path determined by
  81. * environment variables for running on a cloud hosting service. All Gitblit
  82. * file or folder retrievals are (at least initially) funneled through this
  83. * method so it is the correct point to globally override/alter filesystem
  84. * access based on environment or some other indicator.
  85. *
  86. * @return the file
  87. * @since 1.4.0
  88. */
  89. File getFileOrFolder(String fileOrFolder);
  90. /**
  91. * Returns the runtime settings.
  92. *
  93. * @return settings
  94. * @since 1.4.0
  95. */
  96. IStoredSettings getSettings();
  97. /**
  98. * Updates the runtime settings.
  99. *
  100. * @param settings
  101. * @return true if the update succeeded
  102. * @since 1.4.0
  103. */
  104. boolean updateSettings(Map<String, String> updatedSettings);
  105. }