James Moger
2014-04-17 3a649921c7772abf1414eca08276ab18beac9bcc
Update javadoc
12 files modified
231 ■■■■■ changed files
src/main/java/com/gitblit/IUserService.java 10 ●●●●● patch | view | raw | blame | history
src/main/java/com/gitblit/manager/IAuthenticationManager.java 13 ●●●●● patch | view | raw | blame | history
src/main/java/com/gitblit/manager/IFederationManager.java 18 ●●●●● patch | view | raw | blame | history
src/main/java/com/gitblit/manager/IGitblit.java 9 ●●●●● patch | view | raw | blame | history
src/main/java/com/gitblit/manager/IManager.java 12 ●●●●● patch | view | raw | blame | history
src/main/java/com/gitblit/manager/INotificationManager.java 4 ●●●● patch | view | raw | blame | history
src/main/java/com/gitblit/manager/IPluginManager.java 20 ●●●●● patch | view | raw | blame | history
src/main/java/com/gitblit/manager/IProjectManager.java 4 ●●●● patch | view | raw | blame | history
src/main/java/com/gitblit/manager/IRepositoryManager.java 45 ●●●●● patch | view | raw | blame | history
src/main/java/com/gitblit/manager/IRuntimeManager.java 15 ●●●●● patch | view | raw | blame | history
src/main/java/com/gitblit/manager/IUserManager.java 1 ●●●● patch | view | raw | blame | history
src/main/java/com/gitblit/tickets/ITicketService.java 80 ●●●●● patch | view | raw | blame | history
src/main/java/com/gitblit/IUserService.java
@@ -46,6 +46,7 @@
     *
     * @param model
     * @return cookie value
      * @since 0.5.0
     */
    String getCookie(UserModel model);
@@ -54,6 +55,7 @@
     *
     * @param cookie
     * @return a user object or null
      * @since 0.5.0
     */
    UserModel getUserModel(char[] cookie);
@@ -62,6 +64,7 @@
     *
     * @param username
     * @return a user object or null
      * @since 0.5.0
     */
    UserModel getUserModel(String username);
@@ -70,6 +73,7 @@
     *
     * @param model
     * @return true if update is successful
      * @since 0.5.0
     */
    boolean updateUserModel(UserModel model);
@@ -91,6 +95,7 @@
     * @param model
     *            the user object to use for username
     * @return true if update is successful
      * @since 0.5.0
     */
    boolean updateUserModel(String username, UserModel model);
@@ -99,6 +104,7 @@
     *
     * @param model
     * @return true if successful
      * @since 0.5.0
     */
    boolean deleteUserModel(UserModel model);
@@ -107,6 +113,7 @@
     *
     * @param username
     * @return true if successful
      * @since 0.5.0
     */
    boolean deleteUser(String username);
@@ -114,6 +121,7 @@
     * Returns the list of all users available to the login service.
     *
     * @return list of all usernames
      * @since 0.5.0
     */
    List<String> getAllUsernames();
@@ -227,6 +235,7 @@
     * @param oldRole
     * @param newRole
     * @return true if successful
      * @since 0.5.0
     */
    boolean renameRepositoryRole(String oldRole, String newRole);
@@ -235,6 +244,7 @@
     *
     * @param role
     * @return true if successful
      * @since 0.5.0
     */
    boolean deleteRepositoryRole(String role);
src/main/java/com/gitblit/manager/IAuthenticationManager.java
@@ -31,6 +31,7 @@
     *
     * @param httpRequest
     * @return a user object or null
     * @since 1.4.0
     */
    UserModel authenticate(HttpServletRequest httpRequest);
@@ -40,6 +41,7 @@
     * @param username
     * @param key
     * @return a user object or null
*      * @since 1.5.0
     */
    UserModel authenticate(String username, SshKey key);
@@ -52,6 +54,7 @@
     * @param httpRequest
     * @param requiresCertificate
     * @return a user object or null
     * @since 1.4.0
     */
    UserModel authenticate(HttpServletRequest httpRequest, boolean requiresCertificate);
@@ -62,6 +65,7 @@
     * @param username
     * @param password
     * @return a user object or null
     * @since 1.4.0
     */
    UserModel authenticate(String username, char[] password);
@@ -70,6 +74,7 @@
     *
     * @param request
     * @return the Gitblit cookie for the request or null if not found
     * @since 1.4.0
     */
    String getCookie(HttpServletRequest request);
@@ -78,6 +83,7 @@
     *
     * @param response
     * @param user
     * @since 1.4.0
     */
    void setCookie(HttpServletResponse response, UserModel user);
@@ -85,6 +91,7 @@
     * Logout a user.
     *
     * @param user
     * @since 1.4.0
     */
    void logout(HttpServletResponse response, UserModel user);
@@ -92,7 +99,7 @@
     * Does the user service support changes to credentials?
     *
     * @return true or false
     * @since 1.0.0
     * @since 1.4.0
     */
    boolean supportsCredentialChanges(UserModel user);
@@ -101,6 +108,7 @@
     *
     * @param user
     * @return true if the user service supports display name changes
     * @since 1.4.0
     */
    boolean supportsDisplayNameChanges(UserModel user);
@@ -109,6 +117,7 @@
     *
     * @param user
     * @return true if the user service supports email address changes
     * @since 1.4.0
     */
    boolean supportsEmailAddressChanges(UserModel user);
@@ -117,6 +126,7 @@
     *
     * @param user
     * @return true if the user service supports team membership changes
     * @since 1.4.0
     */
    boolean supportsTeamMembershipChanges(UserModel user);
@@ -125,6 +135,7 @@
     *
     * @param user
     * @return true if the team memberships can be changed
     * @since 1.4.0
     */
    boolean supportsTeamMembershipChanges(TeamModel team);
src/main/java/com/gitblit/manager/IFederationManager.java
@@ -36,6 +36,7 @@
     * Gitblit is running on a cloud service and may return an adjusted path.
     *
     * @return the proposals folder path
     * @since 1.4.0
     */
    File getProposalsFolder();
@@ -45,6 +46,7 @@
     * Returns the federation user account.
     *
     * @return the federation user account
     * @since 1.4.0
     */
    UserModel getFederationUser();
@@ -53,6 +55,7 @@
     *
     * @param httpRequest
     * @return the federation user, if authenticated
     * @since 1.4.0
     */
    UserModel authenticate(HttpServletRequest httpRequest);
@@ -61,6 +64,7 @@
     * try to pull.
     *
     * @return list of registered gitblit instances
     * @since 1.4.0
     */
    List<FederationModel> getFederationRegistrations();
@@ -70,6 +74,7 @@
     * @param name
     *            the name of the registration
     * @return a federation registration
     * @since 1.4.0
     */
    FederationModel getFederationRegistration(String url, String name);
@@ -77,6 +82,7 @@
     * Returns the list of federation sets.
     *
     * @return list of federation sets
     * @since 1.4.0
     */
    List<FederationSet> getFederationSets(String gitblitUrl);
@@ -84,6 +90,7 @@
     * Returns the list of possible federation tokens for this Gitblit instance.
     *
     * @return list of federation tokens
     * @since 1.4.0
     */
    List<String> getFederationTokens();
@@ -92,6 +99,7 @@
     *
     * @param type
     * @return a federation token
     * @since 1.4.0
     */
    String getFederationToken(FederationToken type);
@@ -100,6 +108,7 @@
     *
     * @param value
     * @return a federation token
     * @since 1.4.0
     */
    String getFederationToken(String value);
@@ -110,6 +119,7 @@
     * @param req
     * @param token
     * @return true if the request can be executed
     * @since 1.4.0
     */
    boolean validateFederationRequest(FederationRequest req, String token);
@@ -121,6 +131,7 @@
     * @param registration
     *            the registration from the pulling Gitblit instance
     * @return true if acknowledged
     * @since 1.4.0
     */
    boolean acknowledgeFederationStatus(String identification, FederationModel registration);
@@ -128,6 +139,7 @@
     * Returns the list of registration results.
     *
     * @return the list of registration results
     * @since 1.4.0
     */
    List<FederationModel> getFederationResultRegistrations();
@@ -141,6 +153,7 @@
     *            the url of your gitblit instance to send an email to
     *            administrators
     * @return true if the proposal was submitted
     * @since 1.4.0
     */
    boolean submitFederationProposal(FederationProposal proposal, String gitblitUrl);
@@ -148,6 +161,7 @@
     * Returns the list of pending federation proposals
     *
     * @return list of federation proposals
     * @since 1.4.0
     */
    List<FederationProposal> getPendingFederationProposals();
@@ -159,6 +173,7 @@
     * @param token
     *            the federation token
     * @return a map of <cloneurl, RepositoryModel>
     * @since 1.4.0
     */
    Map<String, RepositoryModel> getRepositories(String gitblitUrl, String token);
@@ -169,6 +184,7 @@
     *            the url of this Gitblit instance
     * @param token
     * @return a potential proposal
     * @since 1.4.0
     */
    FederationProposal createFederationProposal(String gitblitUrl, String token);
@@ -177,6 +193,7 @@
     *
     * @param token
     * @return the specified proposal or null
     * @since 1.4.0
     */
    FederationProposal getPendingFederationProposal(String token);
@@ -186,6 +203,7 @@
     * @param a
     *            proposal
     * @return true if the proposal was deleted
     * @since 1.4.0
     */
    boolean deletePendingFederationProposal(FederationProposal proposal);
src/main/java/com/gitblit/manager/IGitblit.java
@@ -46,6 +46,7 @@
     * @param user
     * @param repository
     * @return a list of repository urls
     * @since 1.4.0
     */
    List<RepositoryUrl> getRepositoryUrls(HttpServletRequest request, UserModel user, RepositoryModel repository);
@@ -55,6 +56,7 @@
     * @param user
     * @param isCreate
     * @throws GitBlitException
     * @since 1.4.0
     */
    void addUser(UserModel user) throws GitBlitException;
@@ -65,6 +67,7 @@
     * @param username
     * @param user
     * @throws GitBlitException
     * @since 1.4.0
     */
    void reviseUser(String username, UserModel user) throws GitBlitException;
@@ -73,6 +76,7 @@
     *
     * @param team
     * @param isCreate
     * @since 1.4.0
     */
    void addTeam(TeamModel team) throws GitBlitException;
@@ -81,6 +85,7 @@
     *
     * @param teamname
     * @param team
     * @since 1.4.0
     */
    void reviseTeam(String teamname, TeamModel team) throws GitBlitException;
@@ -93,6 +98,7 @@
     * @param user
     * @return the repository model of the fork, if successful
     * @throws GitBlitException
     * @since 1.4.0
     */
    RepositoryModel fork(RepositoryModel repository, UserModel user) throws GitBlitException;
@@ -101,6 +107,7 @@
     * repository url panel;
     *
     * @return a collection of client applications
     * @since 1.4.0
     */
    Collection<GitClientApplication> getClientApplications();
@@ -108,6 +115,7 @@
     * Returns the ticket service.
     *
     * @return a ticket service
     * @since 1.4.0
     */
    ITicketService getTicketService();
@@ -115,6 +123,7 @@
     * Returns the SSH public key manager.
     *
     * @return the SSH public key manager
     * @since 1.5.0
     */
    IPublicKeyManager getPublicKeyManager();
src/main/java/com/gitblit/manager/IManager.java
@@ -17,8 +17,20 @@
public interface IManager {
    /**
     * Start the manager.
     *
     * @return the manager
      * @since 1.4.0
     */
    IManager start();
    /**
     * Stop the manager.
     *
     * @return the manager
      * @since 1.4.0
     */
    IManager stop();
}
src/main/java/com/gitblit/manager/INotificationManager.java
@@ -26,6 +26,7 @@
     *
     * @param subject
     * @param message
      * @since 1.4.0
     */
    void sendMailToAdministrators(String subject, String message);
@@ -35,6 +36,7 @@
     * @param subject
     * @param message
     * @param toAddresses
      * @since 1.4.0
     */
    void sendMail(String subject, String message, Collection<String> toAddresses);
@@ -44,6 +46,7 @@
     * @param subject
     * @param message
     * @param toAddresses
      * @since 1.4.0
     */
    void sendHtmlMail(String subject, String message, Collection<String> toAddresses);
@@ -52,6 +55,7 @@
     *
     * @param mailing
     * @return the mail message object
      * @since 1.4.0
     */
    void send(Mailing mailing);
src/main/java/com/gitblit/manager/IPluginManager.java
@@ -32,16 +32,19 @@
     * Returns the system version.
     *
     * @return the system version
      * @since 1.5.0
     */
    Version getSystemVersion();
    /**
     * Starts all plugins.
      * @since 1.5.0
     */
    void startPlugins();
    /**
     * Stops all plugins.
      * @since 1.5.0
     */
    void stopPlugins();
@@ -50,6 +53,7 @@
     *
     * @param pluginId
     * @return the state of the plugin
      * @since 1.5.0
     */
    PluginState startPlugin(String pluginId);
@@ -58,6 +62,7 @@
     *
     * @param pluginId
     * @return the state of the plugin
      * @since 1.5.0
     */
    PluginState stopPlugin(String pluginId);
@@ -66,6 +71,7 @@
     *
     * @param type
     * @return a list of extensions the plugin provides
      * @since 1.5.0
     */
    List<Class<?>> getExtensionClasses(String pluginId);
@@ -74,6 +80,7 @@
     *
     * @param type
     * @return a list of extension instances
      * @since 1.5.0
     */
    <T> List<T> getExtensions(Class<T> type);
@@ -81,6 +88,7 @@
     * Returns the list of all resolved plugins.
     *
     * @return a list of resolved plugins
      * @since 1.5.0
     */
    List<PluginWrapper> getPlugins();
@@ -89,6 +97,7 @@
     *
     * @param pluginId
     * @return the plugin wrapper
      * @since 1.5.0
     */
    PluginWrapper getPlugin(String pluginId);
@@ -97,6 +106,7 @@
     *
     * @param clazz extension point class to retrieve extension for
     * @return PluginWrapper that loaded the given class
      * @since 1.5.0
     */
    PluginWrapper whichPlugin(Class<?> clazz);
@@ -105,6 +115,7 @@
     *
     * @param pluginId
     * @return true if successful
      * @since 1.5.0
     */
    boolean disablePlugin(String pluginId);
@@ -113,6 +124,7 @@
     *
     * @param pluginId
     * @return true if successful
      * @since 1.5.0
     */
    boolean enablePlugin(String pluginId);
@@ -121,6 +133,7 @@
     *
     * @param pluginId
     * @return true if successful
      * @since 1.5.0
     */
    boolean uninstallPlugin(String pluginId);
@@ -128,6 +141,7 @@
     * Refresh the plugin registry.
     *
     * @param verifyChecksum
      * @since 1.5.0
     */
    boolean refreshRegistry(boolean verifyChecksum);
@@ -136,6 +150,7 @@
     *
     * @param url
     * @param verifyChecksum
      * @since 1.5.0
     */
    boolean installPlugin(String url, boolean verifyChecksum) throws IOException;
@@ -147,6 +162,7 @@
     * @param verifyChecksum
     * @return true if the upgrade has been successful
     * @throws IOException
      * @since 1.5.0
     */
    boolean upgradePlugin(String pluginId, String url, boolean verifyChecksum) throws IOException;
@@ -154,6 +170,7 @@
     * The list of all registered plugins.
     *
     * @return a list of registered plugins
      * @since 1.5.0
     */
    List<PluginRegistration> getRegisteredPlugins();
@@ -162,6 +179,7 @@
     *
     * @param state
     * @return the list of plugins that match the install state
      * @since 1.5.0
     */
    List<PluginRegistration> getRegisteredPlugins(InstallState state);
@@ -170,6 +188,7 @@
     *
     * @param idOrName
     * @return a plugin registration or null
      * @since 1.5.0
     */
    PluginRegistration lookupPlugin(String idOrName);
@@ -179,6 +198,7 @@
     * @param idOrName
     * @param version (use null for the current version)
     * @return the identified plugin version or null
      * @since 1.5.0
     */
    PluginRelease lookupRelease(String idOrName, String version);
}
src/main/java/com/gitblit/manager/IProjectManager.java
@@ -29,6 +29,7 @@
     * @param user
     * @param includeUsers
     * @return list of projects that are accessible to the user
      * @since 1.4.0
     */
    List<ProjectModel> getProjectModels(UserModel user, boolean includeUsers);
@@ -38,6 +39,7 @@
     * @param name
     * @param user
     * @return a project model, or null if it does not exist
      * @since 1.4.0
     */
    ProjectModel getProjectModel(String name, UserModel user);
@@ -46,6 +48,7 @@
     *
     * @param name a project name
     * @return a project model or null if the project does not exist
      * @since 1.4.0
     */
    ProjectModel getProjectModel(String name);
@@ -57,6 +60,7 @@
     * @param repositoryModels
     * @param includeUsers
     * @return a list of project models
      * @since 1.4.0
     */
    List<ProjectModel> getProjectModels(List<RepositoryModel> repositoryModels, boolean includeUsers);
src/main/java/com/gitblit/manager/IRepositoryManager.java
@@ -37,6 +37,7 @@
     * Gitblit is running on a cloud service and may return an adjusted path.
     *
     * @return the repositories folder path
      * @since 1.4.0
     */
    File getRepositoriesFolder();
@@ -45,6 +46,7 @@
     * Gitblit is running on a cloud service and may return an adjusted path.
     *
     * @return the Groovy hook scripts folder path
      * @since 1.4.0
     */
    File getHooksFolder();
@@ -53,6 +55,7 @@
     * Gitblit is running on a cloud service and may return an adjusted path.
     *
     * @return the Groovy grapes folder path
      * @since 1.4.0
     */
    File getGrapesFolder();
@@ -60,6 +63,7 @@
     * Returns the most recent change date of any repository served by Gitblit.
     *
     * @return a date
      * @since 1.4.0
     */
    Date getLastActivityDate();
@@ -69,6 +73,7 @@
     *
     * @param user
     * @return the effective list of permissions for the user
      * @since 1.4.0
     */
    List<RegistrantAccessPermission> getUserAccessPermissions(UserModel user);
@@ -79,6 +84,7 @@
     *
     * @param repository
     * @return a list of RegistrantAccessPermissions
      * @since 1.4.0
     */
    List<RegistrantAccessPermission> getUserAccessPermissions(RepositoryModel repository);
@@ -88,6 +94,7 @@
     * @param repository
     * @param permissions
     * @return true if the user models have been updated
      * @since 1.4.0
     */
    boolean setUserAccessPermissions(RepositoryModel repository, Collection<RegistrantAccessPermission> permissions);
@@ -98,6 +105,7 @@
     * @see IUserService.getUsernamesForRepositoryRole(String)
     * @param repository
     * @return list of all usernames that have an access permission for the repository
      * @since 1.4.0
     */
    List<String> getRepositoryUsers(RepositoryModel repository);
@@ -108,6 +116,7 @@
     *
     * @param repository
     * @return a list of RegistrantAccessPermissions
      * @since 1.4.0
     */
    List<RegistrantAccessPermission> getTeamAccessPermissions(RepositoryModel repository);
@@ -117,6 +126,7 @@
     * @param repository
     * @param permissions
     * @return true if the team models have been updated
      * @since 1.4.0
     */
    boolean setTeamAccessPermissions(RepositoryModel repository, Collection<RegistrantAccessPermission> permissions);
@@ -127,6 +137,7 @@
     * @see IUserService.getTeamnamesForRepositoryRole(String)
     * @param repository
     * @return list of all teamnames with explicit access permissions to the repository
      * @since 1.4.0
     */
    List<String> getRepositoryTeams(RepositoryModel repository);
@@ -135,11 +146,14 @@
     * configured to cache the repository list.
     *
     * @param model
      * @since 1.4.0
     */
    void addToCachedRepositoryList(RepositoryModel model);
    /**
     * Resets the repository list cache.
     *
      * @since 1.4.0
     *
     */
    void resetRepositoryListCache();
@@ -149,6 +163,7 @@
     * does not consider user access permissions.
     *
     * @return list of all repositories
      * @since 1.4.0
     */
    List<String> getRepositoryList();
@@ -157,6 +172,7 @@
     *
     * @param repositoryName
     * @return repository or null
      * @since 1.4.0
     */
    Repository getRepository(String repositoryName);
@@ -166,6 +182,7 @@
     * @param repositoryName
     * @param logError
     * @return repository or null
      * @since 1.4.0
     */
    Repository getRepository(String repositoryName, boolean logError);
@@ -174,6 +191,7 @@
     *
     * @param user
     * @return list of repository models accessible to user
      * @since 1.4.0
     */
    List<RepositoryModel> getRepositoryModels(UserModel user);
@@ -184,6 +202,7 @@
     * @param user
     * @param repositoryName
     * @return repository model or null
      * @since 1.4.0
     */
    RepositoryModel getRepositoryModel(UserModel user, String repositoryName);
@@ -193,6 +212,7 @@
     *
     * @param repositoryName
     * @return repository model or null
      * @since 1.4.0
     */
    RepositoryModel getRepositoryModel(String repositoryName);
@@ -201,6 +221,7 @@
     *
     * @param repository
     * @return the star count
      * @since 1.4.0
     */
    long getStarCount(RepositoryModel repository);
@@ -209,6 +230,7 @@
     *
     * @param n
     * @return true if the repository exists
      * @since 1.4.0
     */
    boolean hasRepository(String repositoryName);
@@ -218,6 +240,7 @@
     * @param n
     * @param caseInsensitive
     * @return true if the repository exists
      * @since 1.4.0
     */
    boolean hasRepository(String repositoryName, boolean caseSensitiveCheck);
@@ -228,6 +251,7 @@
     * @param username
     * @param origin
     * @return true the if the user has a fork
      * @since 1.4.0
     */
    boolean hasFork(String username, String origin);
@@ -238,6 +262,7 @@
     * @param username
     * @param origin
     * @return the name of the user's fork, null otherwise
      * @since 1.4.0
     */
    String getFork(String username, String origin);
@@ -247,6 +272,7 @@
     *
     * @param repository
     * @return a ForkModel
      * @since 1.4.0
     */
    ForkModel getForkNetwork(String repository);
@@ -258,6 +284,7 @@
     *
     * @param model
     * @return size in bytes of the repository
      * @since 1.4.0
     */
    long updateLastChangeFields(Repository r, RepositoryModel model);
@@ -270,6 +297,7 @@
     * @param model
     * @param repository
     * @return a new array list of metrics
      * @since 1.4.0
     */
    List<Metric> getRepositoryDefaultMetrics(RepositoryModel model, Repository repository);
@@ -286,6 +314,7 @@
     * @param repository
     * @param isCreate
     * @throws GitBlitException
      * @since 1.4.0
     */
    void updateRepositoryModel(String repositoryName, RepositoryModel repository, boolean isCreate)
            throws GitBlitException;
@@ -297,6 +326,7 @@
     *            the Git repository
     * @param repository
     *            the Gitblit repository model
      * @since 1.4.0
     */
    void updateConfiguration(Repository r, RepositoryModel repository);
@@ -306,6 +336,7 @@
     *
     * @param model
     * @return true if successful
      * @since 1.4.0
     */
    boolean deleteRepositoryModel(RepositoryModel model);
@@ -315,6 +346,7 @@
     *
     * @param repositoryName
     * @return true if successful
      * @since 1.4.0
     */
    boolean deleteRepository(String repositoryName);
@@ -323,6 +355,7 @@
     * .groovy extension
     *
     * @return list of available hook scripts
      * @since 1.4.0
     */
    List<String> getAllScripts();
@@ -333,6 +366,7 @@
     * @param repository
     *            if null only the globally specified scripts are returned
     * @return a list of scripts
      * @since 1.4.0
     */
    List<String> getPreReceiveScriptsInherited(RepositoryModel repository);
@@ -344,6 +378,7 @@
     * @param repository
     *            optional parameter
     * @return list of available hook scripts
      * @since 1.4.0
     */
    List<String> getPreReceiveScriptsUnused(RepositoryModel repository);
@@ -354,6 +389,7 @@
     * @param repository
     *            if null only the globally specified scripts are returned
     * @return a list of scripts
      * @since 1.4.0
     */
    List<String> getPostReceiveScriptsInherited(RepositoryModel repository);
@@ -365,6 +401,7 @@
     * @param repository
     *            optional parameter
     * @return list of available hook scripts
      * @since 1.4.0
     */
    List<String> getPostReceiveScriptsUnused(RepositoryModel repository);
@@ -375,13 +412,15 @@
     * @param page
     * @param pageSize
     * @param repositories
     * @return
     * @return a list of search results
      * @since 1.4.0
     */
    List<SearchResult> search(String query, int page, int pageSize, List<String> repositories);
    /**
     *
     * @return true if we are running the gc executor
      * @since 1.4.0
     */
    boolean isCollectingGarbage();
@@ -390,18 +429,21 @@
     *
     * @param repositoryName
     * @return true if actively collecting garbage
      * @since 1.4.0
     */
    boolean isCollectingGarbage(String repositoryName);
    /**
     * Ensures that all cached repositories are completely closed and their resources
     * are properly released.
      * @since 1.4.0
     */
    void closeAll();
    /**
     * Ensures that a cached repository is completely closed and it's resources
     * are properly released.
      * @since 1.4.0
     */
    void close(String repository);
@@ -410,6 +452,7 @@
     *
     * @param repository
     * @return true if the repository is idle
      * @since 1.4.0
     */
    boolean isIdle(Repository repository);
}
src/main/java/com/gitblit/manager/IRuntimeManager.java
@@ -34,6 +34,7 @@
     * Returns the preferred timezone for the Gitblit instance.
     *
     * @return a timezone
      * @since 1.4.0
     */
    TimeZone getTimezone();
@@ -42,6 +43,7 @@
     * or if it is merely a repository viewer.
     *
     * @return true if Gitblit is serving repositories
      * @since 1.4.0
     */
    boolean isServingRepositories();
@@ -49,6 +51,7 @@
     * Determine if this Gitblit instance is running in debug mode
     *
     * @return true if Gitblit is running in debug mode
      * @since 1.4.0
     */
    boolean isDebugMode();
@@ -56,15 +59,23 @@
     * Returns the boot date of the Gitblit server.
     *
     * @return the boot date of Gitblit
      * @since 1.4.0
     */
    Date getBootDate();
    /**
     * Returns the server status.
     *
     * @return the server status
       * @since 1.4.0
     */
    ServerStatus getStatus();
    /**
     * Returns the descriptions/comments of the Gitblit config settings.
     *
     * @return SettingsModel
      * @since 1.4.0
     */
    ServerSettings getSettingsModel();
@@ -72,6 +83,7 @@
     * Returns the file object for the specified configuration key.
     *
     * @return the file
      * @since 1.4.0
     */
    File getFileOrFolder(String key, String defaultFileOrFolder);
@@ -83,6 +95,7 @@
     * access based on environment or some other indicator.
     *
     * @return the file
      * @since 1.4.0
     */
    File getFileOrFolder(String fileOrFolder);
@@ -90,6 +103,7 @@
     * Returns the runtime settings.
     *
     * @return settings
      * @since 1.4.0
     */
    IStoredSettings getSettings();
@@ -98,6 +112,7 @@
     *
     * @param settings
     * @return true if the update succeeded
      * @since 1.4.0
     */
    boolean updateSettings(Map<String, String> updatedSettings);
}
src/main/java/com/gitblit/manager/IUserManager.java
@@ -24,6 +24,7 @@
     *
     * @param username
     * @return true if the specified username represents an internal account
      * @since 1.4.0
     */
    boolean isInternalAccount(String username);
src/main/java/com/gitblit/tickets/ITicketService.java
@@ -167,13 +167,13 @@
    /**
     * Start the service.
     *
     * @since 1.4.0
     */
    public abstract ITicketService start();
    /**
     * Stop the service.
     *
     * @since 1.4.0
     */
    public final ITicketService stop() {
        indexer.close();
@@ -185,7 +185,7 @@
    /**
     * Creates a ticket notifier.  The ticket notifier is not thread-safe!
     *
     * @since 1.4.0
     */
    public TicketNotifier createNotifier() {
        return new TicketNotifier(
@@ -200,6 +200,7 @@
     * Returns the ready status of the ticket service.
     *
     * @return true if the ticket service is ready
     * @since 1.4.0
     */
    public boolean isReady() {
        return true;
@@ -210,6 +211,7 @@
     *
     * @param repository
     * @return true if patchsets are being accepted
     * @since 1.4.0
     */
    public boolean isAcceptingNewPatchsets(RepositoryModel repository) {
        return isReady()
@@ -224,6 +226,7 @@
     *
     * @param repository
     * @return true if tickets are being accepted
     * @since 1.4.0
     */
    public boolean isAcceptingNewTickets(RepositoryModel repository) {
        return isReady()
@@ -237,6 +240,7 @@
     *
     * @param repository
     * @return true if tickets are allowed to be updated
     * @since 1.4.0
     */
    public boolean isAcceptingTicketUpdates(RepositoryModel repository) {
        return isReady()
@@ -249,6 +253,7 @@
     * Returns true if the repository has any tickets
     * @param repository
     * @return true if the repository has tickets
     * @since 1.4.0
     */
    public boolean hasTickets(RepositoryModel repository) {
        return indexer.hasTickets(repository);
@@ -256,11 +261,13 @@
    /**
     * Closes any open resources used by this service.
     * @since 1.4.0
     */
    protected abstract void close();
    /**
     * Reset all caches in the service.
     * @since 1.4.0
     */
    public final synchronized void resetCaches() {
        ticketsCache.invalidateAll();
@@ -269,10 +276,15 @@
        resetCachesImpl();
    }
    /**
     * Reset all caches in the service.
     * @since 1.4.0
     */
    protected abstract void resetCachesImpl();
    /**
     * Reset any caches for the repository in the service.
     * @since 1.4.0
     */
    public final synchronized void resetCaches(RepositoryModel repository) {
        List<TicketKey> repoKeys = new ArrayList<TicketKey>();
@@ -287,6 +299,12 @@
        resetCachesImpl(repository);
    }
    /**
     * Reset the caches for the specified repository.
     *
     * @param repository
     * @since 1.4.0
     */
    protected abstract void resetCachesImpl(RepositoryModel repository);
@@ -295,6 +313,7 @@
     *
     * @param repository
     * @return the list of labels
     * @since 1.4.0
     */
    public List<TicketLabel> getLabels(RepositoryModel repository) {
        String key = repository.name;
@@ -327,6 +346,7 @@
     * @param repository
     * @param label
     * @return a TicketLabel
     * @since 1.4.0
     */
    public TicketLabel getLabel(RepositoryModel repository, String label) {
        for (TicketLabel tl : getLabels(repository)) {
@@ -346,6 +366,7 @@
     * @param milestone
     * @param createdBy
     * @return the label
     * @since 1.4.0
     */
    public synchronized TicketLabel createLabel(RepositoryModel repository, String label, String createdBy) {
        TicketLabel lb = new TicketMilestone(label);
@@ -370,6 +391,7 @@
     * @param label
     * @param createdBy
     * @return true if the update was successful
     * @since 1.4.0
     */
    public synchronized boolean updateLabel(RepositoryModel repository, TicketLabel label, String createdBy) {
        Repository db = null;
@@ -396,6 +418,7 @@
     * @param newName
     * @param createdBy
     * @return true if the rename was successful
     * @since 1.4.0
     */
    public synchronized boolean renameLabel(RepositoryModel repository, String oldName, String newName, String createdBy) {
        if (StringUtils.isEmpty(newName)) {
@@ -433,6 +456,7 @@
     * @param label
     * @param createdBy
     * @return true if the delete was successful
     * @since 1.4.0
     */
    public synchronized boolean deleteLabel(RepositoryModel repository, String label, String createdBy) {
        if (StringUtils.isEmpty(label)) {
@@ -459,6 +483,7 @@
     *
     * @param repository
     * @return the list of milestones
     * @since 1.4.0
     */
    public List<TicketMilestone> getMilestones(RepositoryModel repository) {
        String key = repository.name;
@@ -500,6 +525,7 @@
     * @param repository
     * @param status
     * @return the list of milestones
     * @since 1.4.0
     */
    public List<TicketMilestone> getMilestones(RepositoryModel repository, Status status) {
        List<TicketMilestone> matches = new ArrayList<TicketMilestone>();
@@ -517,6 +543,7 @@
     * @param repository
     * @param milestone
     * @return the milestone or null if it does not exist
     * @since 1.4.0
     */
    public TicketMilestone getMilestone(RepositoryModel repository, String milestone) {
        for (TicketMilestone ms : getMilestones(repository)) {
@@ -536,6 +563,7 @@
     * @param milestone
     * @param createdBy
     * @return the milestone
     * @since 1.4.0
     */
    public synchronized TicketMilestone createMilestone(RepositoryModel repository, String milestone, String createdBy) {
        TicketMilestone ms = new TicketMilestone(milestone);
@@ -563,6 +591,7 @@
     * @param milestone
     * @param createdBy
     * @return true if successful
     * @since 1.4.0
     */
    public synchronized boolean updateMilestone(RepositoryModel repository, TicketMilestone milestone, String createdBy) {
        Repository db = null;
@@ -595,6 +624,7 @@
     * @param newName
     * @param createdBy
     * @return true if successful
     * @since 1.4.0
     */
    public synchronized boolean renameMilestone(RepositoryModel repository, String oldName, String newName, String createdBy) {
        if (StringUtils.isEmpty(newName)) {
@@ -633,6 +663,7 @@
        }
        return false;
    }
    /**
     * Deletes a milestone.
     *
@@ -640,6 +671,7 @@
     * @param milestone
     * @param createdBy
     * @return true if successful
     * @since 1.4.0
     */
    public synchronized boolean deleteMilestone(RepositoryModel repository, String milestone, String createdBy) {
        if (StringUtils.isEmpty(milestone)) {
@@ -668,6 +700,7 @@
     *
     * @param repository
     * @return a new ticket id
     * @since 1.4.0
     */
    public abstract long assignNewId(RepositoryModel repository);
@@ -677,6 +710,7 @@
     * @param repository
     * @param ticketId
     * @return true if the ticket exists
     * @since 1.4.0
     */
    public abstract boolean hasTicket(RepositoryModel repository, long ticketId);
@@ -685,6 +719,7 @@
     *
     * @param repository
     * @return all tickets
     * @since 1.4.0
     */
    public List<TicketModel> getTickets(RepositoryModel repository) {
        return getTickets(repository, null);
@@ -700,6 +735,7 @@
     * @param filter
     *            optional issue filter to only return matching results
     * @return a list of tickets
     * @since 1.4.0
     */
    public abstract List<TicketModel> getTickets(RepositoryModel repository, TicketFilter filter);
@@ -709,11 +745,12 @@
     * @param repository
     * @param ticketId
     * @return a ticket, if it exists, otherwise null
     * @since 1.4.0
     */
    public final TicketModel getTicket(RepositoryModel repository, long ticketId) {
        TicketKey key = new TicketKey(repository, ticketId);
        TicketModel ticket = ticketsCache.getIfPresent(key);
        // if ticket not cached
        if (ticket == null) {
            //load ticket
@@ -749,6 +786,7 @@
     * @param repository
     * @param ticketId
     * @return a ticket, if it exists, otherwise null
     * @since 1.4.0
     */
    protected abstract TicketModel getTicketImpl(RepositoryModel repository, long ticketId);
@@ -757,6 +795,7 @@
     *
     * @param ticket
     * @return the ticket url
     * @since 1.4.0
     */
    public String getTicketUrl(TicketModel ticket) {
        final String canonicalUrl = settings.getString(Keys.web.canonicalUrl, "https://localhost:8443");
@@ -770,6 +809,7 @@
     * @param base
     * @param tip
     * @return the compare url
     * @since 1.4.0
     */
    public String getCompareUrl(TicketModel ticket, String base, String tip) {
        final String canonicalUrl = settings.getString(Keys.web.canonicalUrl, "https://localhost:8443");
@@ -781,6 +821,7 @@
     * Returns true if attachments are supported.
     *
     * @return true if attachments are supported
     * @since 1.4.0
     */
    public abstract boolean supportsAttachments();
@@ -791,6 +832,7 @@
     * @param ticketId
     * @param filename
     * @return an attachment, if found, null otherwise
     * @since 1.4.0
     */
    public abstract Attachment getAttachment(RepositoryModel repository, long ticketId, String filename);
@@ -802,6 +844,7 @@
     * @param repository
     * @param change
     * @return true if successful
     * @since 1.4.0
     */
    public TicketModel createTicket(RepositoryModel repository, Change change) {
        return createTicket(repository, 0L, change);
@@ -816,6 +859,7 @@
     * @param ticketId (if <=0 the ticket id will be assigned)
     * @param change
     * @return true if successful
     * @since 1.4.0
     */
    public TicketModel createTicket(RepositoryModel repository, long ticketId, Change change) {
@@ -864,6 +908,7 @@
     * @param ticketId
     * @param change
     * @return the ticket model if successful
     * @since 1.4.0
     */
    public final TicketModel updateTicket(RepositoryModel repository, long ticketId, Change change) {
        if (change == null) {
@@ -902,6 +947,7 @@
     * Deletes all tickets in every repository.
     *
     * @return true if successful
     * @since 1.4.0
     */
    public boolean deleteAll() {
        List<String> repositories = repositoryManager.getRepositoryList();
@@ -924,6 +970,7 @@
     * Deletes all tickets in the specified repository.
     * @param repository
     * @return true if succesful
     * @since 1.4.0
     */
    public boolean deleteAll(RepositoryModel repository) {
        boolean success = deleteAllImpl(repository);
@@ -935,6 +982,12 @@
        return success;
    }
    /**
     * Delete all tickets for the specified repository.
     * @param repository
     * @return true if successful
     * @since 1.4.0
     */
    protected abstract boolean deleteAllImpl(RepositoryModel repository);
    /**
@@ -943,6 +996,7 @@
     * @param oldRepositoryName
     * @param newRepositoryName
     * @return true if successful
     * @since 1.4.0
     */
    public boolean rename(RepositoryModel oldRepository, RepositoryModel newRepository) {
        if (renameImpl(oldRepository, newRepository)) {
@@ -954,6 +1008,14 @@
        return false;
    }
    /**
     * Renames a repository.
     *
     * @param oldRepository
     * @param newRepository
     * @return true if successful
     * @since 1.4.0
     */
    protected abstract boolean renameImpl(RepositoryModel oldRepository, RepositoryModel newRepository);
    /**
@@ -963,6 +1025,7 @@
     * @param ticketId
     * @param deletedBy
     * @return true if successful
     * @since 1.4.0
     */
    public boolean deleteTicket(RepositoryModel repository, long ticketId, String deletedBy) {
        TicketModel ticket = getTicket(repository, ticketId);
@@ -984,6 +1047,7 @@
     * @param ticket
     * @param deletedBy
     * @return true if successful
     * @since 1.4.0
     */
    protected abstract boolean deleteTicketImpl(RepositoryModel repository, TicketModel ticket, String deletedBy);
@@ -999,6 +1063,7 @@
     * @param comment
     *            the revised comment
     * @return the revised ticket if the change was successful
     * @since 1.4.0
     */
    public final TicketModel updateComment(TicketModel ticket, String commentId,
            String updatedBy, String comment) {
@@ -1019,6 +1084,7 @@
     * @param deletedBy
     *             the user deleting the comment
     * @return the revised ticket if the deletion was successful
     * @since 1.4.0
     */
    public final TicketModel deleteComment(TicketModel ticket, String commentId, String deletedBy) {
        Change deletion = new Change(deletedBy);
@@ -1037,6 +1103,7 @@
     * @param ticketId
     * @param change
     * @return true, if the change was committed
     * @since 1.4.0
     */
    protected abstract boolean commitChangeImpl(RepositoryModel repository, long ticketId, Change change);
@@ -1051,6 +1118,7 @@
     * @param page
     * @param pageSize
     * @return a list of matching tickets
     * @since 1.4.0
     */
    public List<QueryResult> searchFor(RepositoryModel repository, String text, int page, int pageSize) {
        return indexer.searchFor(repository, text, page, pageSize);
@@ -1065,6 +1133,7 @@
     * @param sortBy
     * @param descending
     * @return a list of matching tickets or an empty list
     * @since 1.4.0
     */
    public List<QueryResult> queryFor(String query, int page, int pageSize, String sortBy, boolean descending) {
        return indexer.queryFor(query, page, pageSize, sortBy, descending);
@@ -1073,6 +1142,7 @@
    /**
     * Destroys an existing index and reindexes all tickets.
     * This operation may be expensive and time-consuming.
     * @since 1.4.0
     */
    public void reindex() {
        long start = System.nanoTime();
@@ -1099,6 +1169,7 @@
    /**
     * Destroys any existing index and reindexes all tickets.
     * This operation may be expensive and time-consuming.
     * @since 1.4.0
     */
    public void reindex(RepositoryModel repository) {
        long start = System.nanoTime();
@@ -1116,6 +1187,7 @@
     * of ticket updates, namely merging from the web ui.
     *
     * @param runnable
     * @since 1.4.0
     */
    public synchronized void exec(Runnable runnable) {
        runnable.run();