From 3a649921c7772abf1414eca08276ab18beac9bcc Mon Sep 17 00:00:00 2001 From: James Moger Date: Thu, 17 Apr 2014 19:30:46 -0400 Subject: [PATCH] Update javadoc --- src/main/java/com/gitblit/IUserService.java | 10 +++ .../manager/IAuthenticationManager.java | 13 ++- .../gitblit/manager/IFederationManager.java | 18 +++++ .../java/com/gitblit/manager/IGitblit.java | 9 +++ .../java/com/gitblit/manager/IManager.java | 12 +++ .../gitblit/manager/INotificationManager.java | 4 + .../com/gitblit/manager/IPluginManager.java | 20 +++++ .../com/gitblit/manager/IProjectManager.java | 4 + .../gitblit/manager/IRepositoryManager.java | 45 ++++++++++- .../com/gitblit/manager/IRuntimeManager.java | 15 ++++ .../com/gitblit/manager/IUserManager.java | 1 + .../com/gitblit/tickets/ITicketService.java | 80 ++++++++++++++++++- 12 files changed, 225 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/gitblit/IUserService.java b/src/main/java/com/gitblit/IUserService.java index 053f1790..6f3c5423 100644 --- a/src/main/java/com/gitblit/IUserService.java +++ b/src/main/java/com/gitblit/IUserService.java @@ -46,6 +46,7 @@ public interface IUserService { * * @param model * @return cookie value + * @since 0.5.0 */ String getCookie(UserModel model); @@ -54,6 +55,7 @@ public interface IUserService { * * @param cookie * @return a user object or null + * @since 0.5.0 */ UserModel getUserModel(char[] cookie); @@ -62,6 +64,7 @@ public interface IUserService { * * @param username * @return a user object or null + * @since 0.5.0 */ UserModel getUserModel(String username); @@ -70,6 +73,7 @@ public interface IUserService { * * @param model * @return true if update is successful + * @since 0.5.0 */ boolean updateUserModel(UserModel model); @@ -91,6 +95,7 @@ public interface IUserService { * @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 @@ public interface IUserService { * * @param model * @return true if successful + * @since 0.5.0 */ boolean deleteUserModel(UserModel model); @@ -107,6 +113,7 @@ public interface IUserService { * * @param username * @return true if successful + * @since 0.5.0 */ boolean deleteUser(String username); @@ -114,6 +121,7 @@ public interface IUserService { * Returns the list of all users available to the login service. * * @return list of all usernames + * @since 0.5.0 */ List getAllUsernames(); @@ -227,6 +235,7 @@ public interface IUserService { * @param oldRole * @param newRole * @return true if successful + * @since 0.5.0 */ boolean renameRepositoryRole(String oldRole, String newRole); @@ -235,6 +244,7 @@ public interface IUserService { * * @param role * @return true if successful + * @since 0.5.0 */ boolean deleteRepositoryRole(String role); diff --git a/src/main/java/com/gitblit/manager/IAuthenticationManager.java b/src/main/java/com/gitblit/manager/IAuthenticationManager.java index 33546d90..2665b439 100644 --- a/src/main/java/com/gitblit/manager/IAuthenticationManager.java +++ b/src/main/java/com/gitblit/manager/IAuthenticationManager.java @@ -31,6 +31,7 @@ public interface IAuthenticationManager extends IManager { * * @param httpRequest * @return a user object or null + * @since 1.4.0 */ UserModel authenticate(HttpServletRequest httpRequest); @@ -40,6 +41,7 @@ public interface IAuthenticationManager extends IManager { * @param username * @param key * @return a user object or null +* * @since 1.5.0 */ UserModel authenticate(String username, SshKey key); @@ -52,6 +54,7 @@ public interface IAuthenticationManager extends IManager { * @param httpRequest * @param requiresCertificate * @return a user object or null + * @since 1.4.0 */ UserModel authenticate(HttpServletRequest httpRequest, boolean requiresCertificate); @@ -62,6 +65,7 @@ public interface IAuthenticationManager extends IManager { * @param username * @param password * @return a user object or null + * @since 1.4.0 */ UserModel authenticate(String username, char[] password); @@ -70,6 +74,7 @@ public interface IAuthenticationManager extends IManager { * * @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 @@ public interface IAuthenticationManager extends IManager { * * @param response * @param user + * @since 1.4.0 */ void setCookie(HttpServletResponse response, UserModel user); @@ -85,6 +91,7 @@ public interface IAuthenticationManager extends IManager { * Logout a user. * * @param user + * @since 1.4.0 */ void logout(HttpServletResponse response, UserModel user); @@ -92,7 +99,7 @@ public interface IAuthenticationManager extends IManager { * 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 @@ public interface IAuthenticationManager extends IManager { * * @param user * @return true if the user service supports display name changes + * @since 1.4.0 */ boolean supportsDisplayNameChanges(UserModel user); @@ -109,6 +117,7 @@ public interface IAuthenticationManager extends IManager { * * @param user * @return true if the user service supports email address changes + * @since 1.4.0 */ boolean supportsEmailAddressChanges(UserModel user); @@ -117,6 +126,7 @@ public interface IAuthenticationManager extends IManager { * * @param user * @return true if the user service supports team membership changes + * @since 1.4.0 */ boolean supportsTeamMembershipChanges(UserModel user); @@ -125,6 +135,7 @@ public interface IAuthenticationManager extends IManager { * * @param user * @return true if the team memberships can be changed + * @since 1.4.0 */ boolean supportsTeamMembershipChanges(TeamModel team); diff --git a/src/main/java/com/gitblit/manager/IFederationManager.java b/src/main/java/com/gitblit/manager/IFederationManager.java index d5880c00..df271749 100644 --- a/src/main/java/com/gitblit/manager/IFederationManager.java +++ b/src/main/java/com/gitblit/manager/IFederationManager.java @@ -36,6 +36,7 @@ public interface IFederationManager extends IManager { * 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 @@ public interface IFederationManager extends IManager { * Returns the federation user account. * * @return the federation user account + * @since 1.4.0 */ UserModel getFederationUser(); @@ -53,6 +55,7 @@ public interface IFederationManager extends IManager { * * @param httpRequest * @return the federation user, if authenticated + * @since 1.4.0 */ UserModel authenticate(HttpServletRequest httpRequest); @@ -61,6 +64,7 @@ public interface IFederationManager extends IManager { * try to pull. * * @return list of registered gitblit instances + * @since 1.4.0 */ List getFederationRegistrations(); @@ -70,6 +74,7 @@ public interface IFederationManager extends IManager { * @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 @@ public interface IFederationManager extends IManager { * Returns the list of federation sets. * * @return list of federation sets + * @since 1.4.0 */ List getFederationSets(String gitblitUrl); @@ -84,6 +90,7 @@ public interface IFederationManager extends IManager { * Returns the list of possible federation tokens for this Gitblit instance. * * @return list of federation tokens + * @since 1.4.0 */ List getFederationTokens(); @@ -92,6 +99,7 @@ public interface IFederationManager extends IManager { * * @param type * @return a federation token + * @since 1.4.0 */ String getFederationToken(FederationToken type); @@ -100,6 +108,7 @@ public interface IFederationManager extends IManager { * * @param value * @return a federation token + * @since 1.4.0 */ String getFederationToken(String value); @@ -110,6 +119,7 @@ public interface IFederationManager extends IManager { * @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 @@ public interface IFederationManager extends IManager { * @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 @@ public interface IFederationManager extends IManager { * Returns the list of registration results. * * @return the list of registration results + * @since 1.4.0 */ List getFederationResultRegistrations(); @@ -141,6 +153,7 @@ public interface IFederationManager extends IManager { * 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 @@ public interface IFederationManager extends IManager { * Returns the list of pending federation proposals * * @return list of federation proposals + * @since 1.4.0 */ List getPendingFederationProposals(); @@ -159,6 +173,7 @@ public interface IFederationManager extends IManager { * @param token * the federation token * @return a map of + * @since 1.4.0 */ Map getRepositories(String gitblitUrl, String token); @@ -169,6 +184,7 @@ public interface IFederationManager extends IManager { * 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 @@ public interface IFederationManager extends IManager { * * @param token * @return the specified proposal or null + * @since 1.4.0 */ FederationProposal getPendingFederationProposal(String token); @@ -186,6 +203,7 @@ public interface IFederationManager extends IManager { * @param a * proposal * @return true if the proposal was deleted + * @since 1.4.0 */ boolean deletePendingFederationProposal(FederationProposal proposal); diff --git a/src/main/java/com/gitblit/manager/IGitblit.java b/src/main/java/com/gitblit/manager/IGitblit.java index f3202c01..50ec8b1f 100644 --- a/src/main/java/com/gitblit/manager/IGitblit.java +++ b/src/main/java/com/gitblit/manager/IGitblit.java @@ -46,6 +46,7 @@ public interface IGitblit extends IManager, * @param user * @param repository * @return a list of repository urls + * @since 1.4.0 */ List getRepositoryUrls(HttpServletRequest request, UserModel user, RepositoryModel repository); @@ -55,6 +56,7 @@ public interface IGitblit extends IManager, * @param user * @param isCreate * @throws GitBlitException + * @since 1.4.0 */ void addUser(UserModel user) throws GitBlitException; @@ -65,6 +67,7 @@ public interface IGitblit extends IManager, * @param username * @param user * @throws GitBlitException + * @since 1.4.0 */ void reviseUser(String username, UserModel user) throws GitBlitException; @@ -73,6 +76,7 @@ public interface IGitblit extends IManager, * * @param team * @param isCreate + * @since 1.4.0 */ void addTeam(TeamModel team) throws GitBlitException; @@ -81,6 +85,7 @@ public interface IGitblit extends IManager, * * @param teamname * @param team + * @since 1.4.0 */ void reviseTeam(String teamname, TeamModel team) throws GitBlitException; @@ -93,6 +98,7 @@ public interface IGitblit extends IManager, * @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 @@ public interface IGitblit extends IManager, * repository url panel; * * @return a collection of client applications + * @since 1.4.0 */ Collection getClientApplications(); @@ -108,6 +115,7 @@ public interface IGitblit extends IManager, * Returns the ticket service. * * @return a ticket service + * @since 1.4.0 */ ITicketService getTicketService(); @@ -115,6 +123,7 @@ public interface IGitblit extends IManager, * Returns the SSH public key manager. * * @return the SSH public key manager + * @since 1.5.0 */ IPublicKeyManager getPublicKeyManager(); diff --git a/src/main/java/com/gitblit/manager/IManager.java b/src/main/java/com/gitblit/manager/IManager.java index 115831b9..44df5cdf 100644 --- a/src/main/java/com/gitblit/manager/IManager.java +++ b/src/main/java/com/gitblit/manager/IManager.java @@ -17,8 +17,20 @@ package com.gitblit.manager; 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(); } diff --git a/src/main/java/com/gitblit/manager/INotificationManager.java b/src/main/java/com/gitblit/manager/INotificationManager.java index 6bee2f8e..231cf43a 100644 --- a/src/main/java/com/gitblit/manager/INotificationManager.java +++ b/src/main/java/com/gitblit/manager/INotificationManager.java @@ -26,6 +26,7 @@ public interface INotificationManager extends IManager { * * @param subject * @param message + * @since 1.4.0 */ void sendMailToAdministrators(String subject, String message); @@ -35,6 +36,7 @@ public interface INotificationManager extends IManager { * @param subject * @param message * @param toAddresses + * @since 1.4.0 */ void sendMail(String subject, String message, Collection toAddresses); @@ -44,6 +46,7 @@ public interface INotificationManager extends IManager { * @param subject * @param message * @param toAddresses + * @since 1.4.0 */ void sendHtmlMail(String subject, String message, Collection toAddresses); @@ -52,6 +55,7 @@ public interface INotificationManager extends IManager { * * @param mailing * @return the mail message object + * @since 1.4.0 */ void send(Mailing mailing); diff --git a/src/main/java/com/gitblit/manager/IPluginManager.java b/src/main/java/com/gitblit/manager/IPluginManager.java index 528bbed4..d8fe0f85 100644 --- a/src/main/java/com/gitblit/manager/IPluginManager.java +++ b/src/main/java/com/gitblit/manager/IPluginManager.java @@ -32,16 +32,19 @@ public interface IPluginManager extends IManager { * 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 @@ public interface IPluginManager extends IManager { * * @param pluginId * @return the state of the plugin + * @since 1.5.0 */ PluginState startPlugin(String pluginId); @@ -58,6 +62,7 @@ public interface IPluginManager extends IManager { * * @param pluginId * @return the state of the plugin + * @since 1.5.0 */ PluginState stopPlugin(String pluginId); @@ -66,6 +71,7 @@ public interface IPluginManager extends IManager { * * @param type * @return a list of extensions the plugin provides + * @since 1.5.0 */ List> getExtensionClasses(String pluginId); @@ -74,6 +80,7 @@ public interface IPluginManager extends IManager { * * @param type * @return a list of extension instances + * @since 1.5.0 */ List getExtensions(Class type); @@ -81,6 +88,7 @@ public interface IPluginManager extends IManager { * Returns the list of all resolved plugins. * * @return a list of resolved plugins + * @since 1.5.0 */ List getPlugins(); @@ -89,6 +97,7 @@ public interface IPluginManager extends IManager { * * @param pluginId * @return the plugin wrapper + * @since 1.5.0 */ PluginWrapper getPlugin(String pluginId); @@ -97,6 +106,7 @@ public interface IPluginManager extends IManager { * * @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 @@ public interface IPluginManager extends IManager { * * @param pluginId * @return true if successful + * @since 1.5.0 */ boolean disablePlugin(String pluginId); @@ -113,6 +124,7 @@ public interface IPluginManager extends IManager { * * @param pluginId * @return true if successful + * @since 1.5.0 */ boolean enablePlugin(String pluginId); @@ -121,6 +133,7 @@ public interface IPluginManager extends IManager { * * @param pluginId * @return true if successful + * @since 1.5.0 */ boolean uninstallPlugin(String pluginId); @@ -128,6 +141,7 @@ public interface IPluginManager extends IManager { * Refresh the plugin registry. * * @param verifyChecksum + * @since 1.5.0 */ boolean refreshRegistry(boolean verifyChecksum); @@ -136,6 +150,7 @@ public interface IPluginManager extends IManager { * * @param url * @param verifyChecksum + * @since 1.5.0 */ boolean installPlugin(String url, boolean verifyChecksum) throws IOException; @@ -147,6 +162,7 @@ public interface IPluginManager extends IManager { * @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 @@ public interface IPluginManager extends IManager { * The list of all registered plugins. * * @return a list of registered plugins + * @since 1.5.0 */ List getRegisteredPlugins(); @@ -162,6 +179,7 @@ public interface IPluginManager extends IManager { * * @param state * @return the list of plugins that match the install state + * @since 1.5.0 */ List getRegisteredPlugins(InstallState state); @@ -170,6 +188,7 @@ public interface IPluginManager extends IManager { * * @param idOrName * @return a plugin registration or null + * @since 1.5.0 */ PluginRegistration lookupPlugin(String idOrName); @@ -179,6 +198,7 @@ public interface IPluginManager extends IManager { * @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); } diff --git a/src/main/java/com/gitblit/manager/IProjectManager.java b/src/main/java/com/gitblit/manager/IProjectManager.java index c5b490e5..730eec7e 100644 --- a/src/main/java/com/gitblit/manager/IProjectManager.java +++ b/src/main/java/com/gitblit/manager/IProjectManager.java @@ -29,6 +29,7 @@ public interface IProjectManager extends IManager { * @param user * @param includeUsers * @return list of projects that are accessible to the user + * @since 1.4.0 */ List getProjectModels(UserModel user, boolean includeUsers); @@ -38,6 +39,7 @@ public interface IProjectManager extends IManager { * @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 @@ public interface IProjectManager extends IManager { * * @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 @@ public interface IProjectManager extends IManager { * @param repositoryModels * @param includeUsers * @return a list of project models + * @since 1.4.0 */ List getProjectModels(List repositoryModels, boolean includeUsers); diff --git a/src/main/java/com/gitblit/manager/IRepositoryManager.java b/src/main/java/com/gitblit/manager/IRepositoryManager.java index 23c61cb4..fd5fc14b 100644 --- a/src/main/java/com/gitblit/manager/IRepositoryManager.java +++ b/src/main/java/com/gitblit/manager/IRepositoryManager.java @@ -37,6 +37,7 @@ public interface IRepositoryManager extends IManager { * 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 @@ public interface IRepositoryManager extends IManager { * 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 @@ public interface IRepositoryManager extends IManager { * 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 @@ public interface IRepositoryManager extends IManager { * 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 @@ public interface IRepositoryManager extends IManager { * * @param user * @return the effective list of permissions for the user + * @since 1.4.0 */ List getUserAccessPermissions(UserModel user); @@ -79,6 +84,7 @@ public interface IRepositoryManager extends IManager { * * @param repository * @return a list of RegistrantAccessPermissions + * @since 1.4.0 */ List getUserAccessPermissions(RepositoryModel repository); @@ -88,6 +94,7 @@ public interface IRepositoryManager extends IManager { * @param repository * @param permissions * @return true if the user models have been updated + * @since 1.4.0 */ boolean setUserAccessPermissions(RepositoryModel repository, Collection permissions); @@ -98,6 +105,7 @@ public interface IRepositoryManager extends IManager { * @see IUserService.getUsernamesForRepositoryRole(String) * @param repository * @return list of all usernames that have an access permission for the repository + * @since 1.4.0 */ List getRepositoryUsers(RepositoryModel repository); @@ -108,6 +116,7 @@ public interface IRepositoryManager extends IManager { * * @param repository * @return a list of RegistrantAccessPermissions + * @since 1.4.0 */ List getTeamAccessPermissions(RepositoryModel repository); @@ -117,6 +126,7 @@ public interface IRepositoryManager extends IManager { * @param repository * @param permissions * @return true if the team models have been updated + * @since 1.4.0 */ boolean setTeamAccessPermissions(RepositoryModel repository, Collection permissions); @@ -127,6 +137,7 @@ public interface IRepositoryManager extends IManager { * @see IUserService.getTeamnamesForRepositoryRole(String) * @param repository * @return list of all teamnames with explicit access permissions to the repository + * @since 1.4.0 */ List getRepositoryTeams(RepositoryModel repository); @@ -135,12 +146,15 @@ public interface IRepositoryManager extends IManager { * 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 @@ public interface IRepositoryManager extends IManager { * does not consider user access permissions. * * @return list of all repositories + * @since 1.4.0 */ List getRepositoryList(); @@ -157,6 +172,7 @@ public interface IRepositoryManager extends IManager { * * @param repositoryName * @return repository or null + * @since 1.4.0 */ Repository getRepository(String repositoryName); @@ -166,6 +182,7 @@ public interface IRepositoryManager extends IManager { * @param repositoryName * @param logError * @return repository or null + * @since 1.4.0 */ Repository getRepository(String repositoryName, boolean logError); @@ -174,6 +191,7 @@ public interface IRepositoryManager extends IManager { * * @param user * @return list of repository models accessible to user + * @since 1.4.0 */ List getRepositoryModels(UserModel user); @@ -184,6 +202,7 @@ public interface IRepositoryManager extends IManager { * @param user * @param repositoryName * @return repository model or null + * @since 1.4.0 */ RepositoryModel getRepositoryModel(UserModel user, String repositoryName); @@ -193,6 +212,7 @@ public interface IRepositoryManager extends IManager { * * @param repositoryName * @return repository model or null + * @since 1.4.0 */ RepositoryModel getRepositoryModel(String repositoryName); @@ -201,6 +221,7 @@ public interface IRepositoryManager extends IManager { * * @param repository * @return the star count + * @since 1.4.0 */ long getStarCount(RepositoryModel repository); @@ -209,6 +230,7 @@ public interface IRepositoryManager extends IManager { * * @param n * @return true if the repository exists + * @since 1.4.0 */ boolean hasRepository(String repositoryName); @@ -218,6 +240,7 @@ public interface IRepositoryManager extends IManager { * @param n * @param caseInsensitive * @return true if the repository exists + * @since 1.4.0 */ boolean hasRepository(String repositoryName, boolean caseSensitiveCheck); @@ -228,6 +251,7 @@ public interface IRepositoryManager extends IManager { * @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 @@ public interface IRepositoryManager extends IManager { * @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 @@ public interface IRepositoryManager extends IManager { * * @param repository * @return a ForkModel + * @since 1.4.0 */ ForkModel getForkNetwork(String repository); @@ -258,6 +284,7 @@ public interface IRepositoryManager extends IManager { * * @param model * @return size in bytes of the repository + * @since 1.4.0 */ long updateLastChangeFields(Repository r, RepositoryModel model); @@ -270,6 +297,7 @@ public interface IRepositoryManager extends IManager { * @param model * @param repository * @return a new array list of metrics + * @since 1.4.0 */ List getRepositoryDefaultMetrics(RepositoryModel model, Repository repository); @@ -286,6 +314,7 @@ public interface IRepositoryManager extends IManager { * @param repository * @param isCreate * @throws GitBlitException + * @since 1.4.0 */ void updateRepositoryModel(String repositoryName, RepositoryModel repository, boolean isCreate) throws GitBlitException; @@ -297,6 +326,7 @@ public interface IRepositoryManager extends IManager { * the Git repository * @param repository * the Gitblit repository model + * @since 1.4.0 */ void updateConfiguration(Repository r, RepositoryModel repository); @@ -306,6 +336,7 @@ public interface IRepositoryManager extends IManager { * * @param model * @return true if successful + * @since 1.4.0 */ boolean deleteRepositoryModel(RepositoryModel model); @@ -315,6 +346,7 @@ public interface IRepositoryManager extends IManager { * * @param repositoryName * @return true if successful + * @since 1.4.0 */ boolean deleteRepository(String repositoryName); @@ -323,6 +355,7 @@ public interface IRepositoryManager extends IManager { * .groovy extension * * @return list of available hook scripts + * @since 1.4.0 */ List getAllScripts(); @@ -333,6 +366,7 @@ public interface IRepositoryManager extends IManager { * @param repository * if null only the globally specified scripts are returned * @return a list of scripts + * @since 1.4.0 */ List getPreReceiveScriptsInherited(RepositoryModel repository); @@ -344,6 +378,7 @@ public interface IRepositoryManager extends IManager { * @param repository * optional parameter * @return list of available hook scripts + * @since 1.4.0 */ List getPreReceiveScriptsUnused(RepositoryModel repository); @@ -354,6 +389,7 @@ public interface IRepositoryManager extends IManager { * @param repository * if null only the globally specified scripts are returned * @return a list of scripts + * @since 1.4.0 */ List getPostReceiveScriptsInherited(RepositoryModel repository); @@ -365,6 +401,7 @@ public interface IRepositoryManager extends IManager { * @param repository * optional parameter * @return list of available hook scripts + * @since 1.4.0 */ List getPostReceiveScriptsUnused(RepositoryModel repository); @@ -375,13 +412,15 @@ public interface IRepositoryManager extends IManager { * @param page * @param pageSize * @param repositories - * @return + * @return a list of search results + * @since 1.4.0 */ List search(String query, int page, int pageSize, List repositories); /** * * @return true if we are running the gc executor + * @since 1.4.0 */ boolean isCollectingGarbage(); @@ -390,18 +429,21 @@ public interface IRepositoryManager extends IManager { * * @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 @@ public interface IRepositoryManager extends IManager { * * @param repository * @return true if the repository is idle + * @since 1.4.0 */ boolean isIdle(Repository repository); } \ No newline at end of file diff --git a/src/main/java/com/gitblit/manager/IRuntimeManager.java b/src/main/java/com/gitblit/manager/IRuntimeManager.java index 94ce3800..acd3a576 100644 --- a/src/main/java/com/gitblit/manager/IRuntimeManager.java +++ b/src/main/java/com/gitblit/manager/IRuntimeManager.java @@ -34,6 +34,7 @@ public interface IRuntimeManager extends IManager { * Returns the preferred timezone for the Gitblit instance. * * @return a timezone + * @since 1.4.0 */ TimeZone getTimezone(); @@ -42,6 +43,7 @@ public interface IRuntimeManager extends IManager { * 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 @@ public interface IRuntimeManager extends IManager { * 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 @@ public interface IRuntimeManager extends IManager { * 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 @@ public interface IRuntimeManager extends IManager { * 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 @@ public interface IRuntimeManager extends IManager { * access based on environment or some other indicator. * * @return the file + * @since 1.4.0 */ File getFileOrFolder(String fileOrFolder); @@ -90,6 +103,7 @@ public interface IRuntimeManager extends IManager { * Returns the runtime settings. * * @return settings + * @since 1.4.0 */ IStoredSettings getSettings(); @@ -98,6 +112,7 @@ public interface IRuntimeManager extends IManager { * * @param settings * @return true if the update succeeded + * @since 1.4.0 */ boolean updateSettings(Map updatedSettings); } \ No newline at end of file diff --git a/src/main/java/com/gitblit/manager/IUserManager.java b/src/main/java/com/gitblit/manager/IUserManager.java index 945d6a85..b7ea9c46 100644 --- a/src/main/java/com/gitblit/manager/IUserManager.java +++ b/src/main/java/com/gitblit/manager/IUserManager.java @@ -24,6 +24,7 @@ public interface IUserManager extends IManager, IUserService { * * @param username * @return true if the specified username represents an internal account + * @since 1.4.0 */ boolean isInternalAccount(String username); diff --git a/src/main/java/com/gitblit/tickets/ITicketService.java b/src/main/java/com/gitblit/tickets/ITicketService.java index 7d699757..8d922b59 100644 --- a/src/main/java/com/gitblit/tickets/ITicketService.java +++ b/src/main/java/com/gitblit/tickets/ITicketService.java @@ -167,13 +167,13 @@ public abstract class ITicketService { /** * 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 @@ public abstract class ITicketService { /** * 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 @@ public abstract class ITicketService { * 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 @@ public abstract class ITicketService { * * @param repository * @return true if patchsets are being accepted + * @since 1.4.0 */ public boolean isAcceptingNewPatchsets(RepositoryModel repository) { return isReady() @@ -224,6 +226,7 @@ public abstract class ITicketService { * * @param repository * @return true if tickets are being accepted + * @since 1.4.0 */ public boolean isAcceptingNewTickets(RepositoryModel repository) { return isReady() @@ -237,6 +240,7 @@ public abstract class ITicketService { * * @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 @@ public abstract class ITicketService { * 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 @@ public abstract class ITicketService { /** * 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 @@ public abstract class ITicketService { 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 repoKeys = new ArrayList(); @@ -287,6 +299,12 @@ public abstract class ITicketService { 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 @@ public abstract class ITicketService { * * @param repository * @return the list of labels + * @since 1.4.0 */ public List getLabels(RepositoryModel repository) { String key = repository.name; @@ -327,6 +346,7 @@ public abstract class ITicketService { * @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 @@ public abstract class ITicketService { * @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 @@ public abstract class ITicketService { * @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 @@ public abstract class ITicketService { * @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 @@ public abstract class ITicketService { * @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 @@ public abstract class ITicketService { * * @param repository * @return the list of milestones + * @since 1.4.0 */ public List getMilestones(RepositoryModel repository) { String key = repository.name; @@ -500,6 +525,7 @@ public abstract class ITicketService { * @param repository * @param status * @return the list of milestones + * @since 1.4.0 */ public List getMilestones(RepositoryModel repository, Status status) { List matches = new ArrayList(); @@ -517,6 +543,7 @@ public abstract class ITicketService { * @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 @@ public abstract class ITicketService { * @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 @@ public abstract class ITicketService { * @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 @@ public abstract class ITicketService { * @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 @@ public abstract class ITicketService { } return false; } + /** * Deletes a milestone. * @@ -640,6 +671,7 @@ public abstract class ITicketService { * @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 @@ public abstract class ITicketService { * * @param repository * @return a new ticket id + * @since 1.4.0 */ public abstract long assignNewId(RepositoryModel repository); @@ -677,6 +710,7 @@ public abstract class ITicketService { * @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 @@ public abstract class ITicketService { * * @param repository * @return all tickets + * @since 1.4.0 */ public List getTickets(RepositoryModel repository) { return getTickets(repository, null); @@ -700,6 +735,7 @@ public abstract class ITicketService { * @param filter * optional issue filter to only return matching results * @return a list of tickets + * @since 1.4.0 */ public abstract List getTickets(RepositoryModel repository, TicketFilter filter); @@ -709,11 +745,12 @@ public abstract class ITicketService { * @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 @@ public abstract class ITicketService { * @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 @@ public abstract class ITicketService { * * @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 @@ public abstract class ITicketService { * @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 @@ public abstract class ITicketService { * Returns true if attachments are supported. * * @return true if attachments are supported + * @since 1.4.0 */ public abstract boolean supportsAttachments(); @@ -791,6 +832,7 @@ public abstract class ITicketService { * @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 @@ public abstract class ITicketService { * @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 @@ public abstract class ITicketService { * @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 @@ public abstract class ITicketService { * @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 @@ public abstract class ITicketService { * Deletes all tickets in every repository. * * @return true if successful + * @since 1.4.0 */ public boolean deleteAll() { List repositories = repositoryManager.getRepositoryList(); @@ -924,6 +970,7 @@ public abstract class ITicketService { * 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 @@ public abstract class ITicketService { 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 @@ public abstract class ITicketService { * @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 @@ public abstract class ITicketService { 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 @@ public abstract class ITicketService { * @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 @@ public abstract class ITicketService { * @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 @@ public abstract class ITicketService { * @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 @@ public abstract class ITicketService { * @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 @@ public abstract class ITicketService { * @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 @@ public abstract class ITicketService { * @param page * @param pageSize * @return a list of matching tickets + * @since 1.4.0 */ public List searchFor(RepositoryModel repository, String text, int page, int pageSize) { return indexer.searchFor(repository, text, page, pageSize); @@ -1065,6 +1133,7 @@ public abstract class ITicketService { * @param sortBy * @param descending * @return a list of matching tickets or an empty list + * @since 1.4.0 */ public List queryFor(String query, int page, int pageSize, String sortBy, boolean descending) { return indexer.queryFor(query, page, pageSize, sortBy, descending); @@ -1073,6 +1142,7 @@ public abstract class ITicketService { /** * 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 @@ public abstract class ITicketService { /** * 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 @@ public abstract class ITicketService { * of ticket updates, namely merging from the web ui. * * @param runnable + * @since 1.4.0 */ public synchronized void exec(Runnable runnable) { runnable.run(); -- 2.39.5