diff options
author | James Moger <james.moger@gitblit.com> | 2013-11-24 21:31:14 -0500 |
---|---|---|
committer | James Moger <james.moger@gitblit.com> | 2013-11-29 11:05:51 -0500 |
commit | 8d88096236fe70b850a29f548432299a866886e6 (patch) | |
tree | 27d75e1e543c766a1d56654a126573069362cd20 /src/main/java | |
parent | 7bf6e183ff8abd0c35eeb29f399da12389562ecb (diff) | |
download | gitblit-8d88096236fe70b850a29f548432299a866886e6.tar.gz gitblit-8d88096236fe70b850a29f548432299a866886e6.zip |
Renamed Gitblit to GitBlit to not break existing Groovy hooks
Change-Id: Id5286ed1b9d7e92644cacf857096e6dd273c8f05
Diffstat (limited to 'src/main/java')
-rw-r--r-- | src/main/java/com/gitblit/DaggerModule.java | 8 | ||||
-rw-r--r-- | src/main/java/com/gitblit/GitBlit.java (renamed from src/main/java/com/gitblit/Gitblit.java) | 42 | ||||
-rw-r--r-- | src/main/java/com/gitblit/git/GitDaemon.java | 4 | ||||
-rw-r--r-- | src/main/java/com/gitblit/git/GitServlet.java | 6 | ||||
-rw-r--r-- | src/main/java/com/gitblit/git/GitblitReceivePack.java | 6 | ||||
-rw-r--r-- | src/main/java/com/gitblit/git/GitblitReceivePackFactory.java | 6 | ||||
-rw-r--r-- | src/main/java/com/gitblit/git/RepositoryResolver.java | 6 | ||||
-rw-r--r-- | src/main/java/com/gitblit/manager/ServicesManager.java | 6 | ||||
-rw-r--r-- | src/main/java/com/gitblit/service/FederationPullService.java | 4 |
9 files changed, 53 insertions, 35 deletions
diff --git a/src/main/java/com/gitblit/DaggerModule.java b/src/main/java/com/gitblit/DaggerModule.java index 1fad779f..5e49a97d 100644 --- a/src/main/java/com/gitblit/DaggerModule.java +++ b/src/main/java/com/gitblit/DaggerModule.java @@ -82,7 +82,7 @@ import dagger.Provides; IServicesManager.class, // the monolithic manager - Gitblit.class, + GitBlit.class, // filters & servlets GitServlet.class, @@ -175,7 +175,7 @@ public class DaggerModule { repositoryManager); } - @Provides @Singleton Gitblit provideGitblit( + @Provides @Singleton GitBlit provideGitblit( IRuntimeManager runtimeManager, INotificationManager notificationManager, IUserManager userManager, @@ -185,7 +185,7 @@ public class DaggerModule { IGitblitManager gitblitManager, IFederationManager federationManager) { - return new Gitblit( + return new GitBlit( runtimeManager, notificationManager, userManager, @@ -196,7 +196,7 @@ public class DaggerModule { federationManager); } - @Provides @Singleton IServicesManager provideServicesManager(Gitblit gitblit) { + @Provides @Singleton IServicesManager provideServicesManager(GitBlit gitblit) { return new ServicesManager(gitblit); } diff --git a/src/main/java/com/gitblit/Gitblit.java b/src/main/java/com/gitblit/GitBlit.java index 64316bb4..0dcc765b 100644 --- a/src/main/java/com/gitblit/Gitblit.java +++ b/src/main/java/com/gitblit/GitBlit.java @@ -54,7 +54,7 @@ import com.gitblit.models.TeamModel; import com.gitblit.models.UserModel; /** - * Gitblit is an aggregate interface delegate. It implements all the manager + * GitBlit is an aggregate interface delegate. It implements all the manager * interfaces and delegates all methods calls to the actual manager implementations. * It's primary purpose is to provide complete management control to the git * upload and receive pack functions. @@ -62,7 +62,7 @@ import com.gitblit.models.UserModel; * @author James Moger * */ -public class Gitblit implements IRuntimeManager, +public class GitBlit implements IRuntimeManager, INotificationManager, IUserManager, ISessionManager, @@ -87,7 +87,7 @@ public class Gitblit implements IRuntimeManager, private final IFederationManager federationManager; - public Gitblit( + public GitBlit( IRuntimeManager runtimeManager, INotificationManager notificationManager, IUserManager userManager, @@ -108,16 +108,39 @@ public class Gitblit implements IRuntimeManager, } @Override - public Gitblit start() { + public GitBlit start() { return this; } @Override - public Gitblit stop() { + public GitBlit stop() { return this; } /* + * ISTOREDSETTINGS + * + * these methods are necessary for (nearly) seamless Groovy hook operation + * after the massive refactor. + */ + + public boolean getBoolean(String key, boolean defaultValue) { + return runtimeManager.getSettings().getBoolean(key, defaultValue); + } + + public String getString(String key, String defaultValue) { + return runtimeManager.getSettings().getString(key, defaultValue); + } + + public int getInteger(String key, int defaultValue) { + return runtimeManager.getSettings().getInteger(key, defaultValue); + } + + public List<String> getStrings(String key) { + return runtimeManager.getSettings().getStrings(key); + } + + /* * RUNTIME MANAGER */ @@ -268,11 +291,6 @@ public class Gitblit implements IRuntimeManager, } @Override - public void logout(UserModel user) { - userManager.logout(user); - } - - @Override public List<String> getAllUsernames() { return userManager.getAllUsernames(); } @@ -313,8 +331,8 @@ public class Gitblit implements IRuntimeManager, } @Override - public UserModel authenticate(char[] cookie) { - return userManager.authenticate(cookie); + public UserModel getUserModel(char[] cookie) { + return userManager.getUserModel(cookie); } @Override diff --git a/src/main/java/com/gitblit/git/GitDaemon.java b/src/main/java/com/gitblit/git/GitDaemon.java index a7e7cd55..7273f387 100644 --- a/src/main/java/com/gitblit/git/GitDaemon.java +++ b/src/main/java/com/gitblit/git/GitDaemon.java @@ -67,7 +67,7 @@ import org.eclipse.jgit.transport.resolver.UploadPackFactory; import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import com.gitblit.Gitblit;
+import com.gitblit.GitBlit;
import com.gitblit.IStoredSettings;
import com.gitblit.Keys;
import com.gitblit.utils.StringUtils;
@@ -108,7 +108,7 @@ public class GitDaemon { private ReceivePackFactory<GitDaemonClient> receivePackFactory;
- public GitDaemon(Gitblit gitblit) {
+ public GitDaemon(GitBlit gitblit) {
IStoredSettings settings = gitblit.getSettings();
int port = settings.getInteger(Keys.git.daemonPort, 0);
diff --git a/src/main/java/com/gitblit/git/GitServlet.java b/src/main/java/com/gitblit/git/GitServlet.java index 35470a29..c5119424 100644 --- a/src/main/java/com/gitblit/git/GitServlet.java +++ b/src/main/java/com/gitblit/git/GitServlet.java @@ -21,7 +21,7 @@ import javax.servlet.ServletConfig; import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
-import com.gitblit.Gitblit;
+import com.gitblit.GitBlit;
/**
* The GitServlet provides http/https access to Git repositories.
@@ -35,10 +35,10 @@ public class GitServlet extends org.eclipse.jgit.http.server.GitServlet { private static final long serialVersionUID = 1L;
- private final Gitblit gitblit;
+ private final GitBlit gitblit;
@Inject
- public GitServlet(Gitblit gitblit) {
+ public GitServlet(GitBlit gitblit) {
super();
this.gitblit = gitblit;
}
diff --git a/src/main/java/com/gitblit/git/GitblitReceivePack.java b/src/main/java/com/gitblit/git/GitblitReceivePack.java index cc1490e6..11b1bda8 100644 --- a/src/main/java/com/gitblit/git/GitblitReceivePack.java +++ b/src/main/java/com/gitblit/git/GitblitReceivePack.java @@ -44,7 +44,7 @@ import org.slf4j.LoggerFactory; import com.gitblit.Constants;
import com.gitblit.Constants.AccessRestrictionType;
-import com.gitblit.Gitblit;
+import com.gitblit.GitBlit;
import com.gitblit.IStoredSettings;
import com.gitblit.Keys;
import com.gitblit.client.Translation;
@@ -91,10 +91,10 @@ public class GitblitReceivePack extends ReceivePack implements PreReceiveHook, P private final IStoredSettings settings;
- private final Gitblit gitblit;
+ private final GitBlit gitblit;
public GitblitReceivePack(
- Gitblit gitblit,
+ GitBlit gitblit,
Repository db,
RepositoryModel repository,
UserModel user) {
diff --git a/src/main/java/com/gitblit/git/GitblitReceivePackFactory.java b/src/main/java/com/gitblit/git/GitblitReceivePackFactory.java index 71a8e68b..e24d1192 100644 --- a/src/main/java/com/gitblit/git/GitblitReceivePackFactory.java +++ b/src/main/java/com/gitblit/git/GitblitReceivePackFactory.java @@ -26,7 +26,7 @@ import org.eclipse.jgit.transport.resolver.ServiceNotEnabledException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.gitblit.Gitblit; +import com.gitblit.GitBlit; import com.gitblit.IStoredSettings; import com.gitblit.Keys; import com.gitblit.models.RepositoryModel; @@ -47,9 +47,9 @@ public class GitblitReceivePackFactory<X> implements ReceivePackFactory<X> { private final IStoredSettings settings; - private final Gitblit gitblit; + private final GitBlit gitblit; - public GitblitReceivePackFactory(Gitblit gitblit) { + public GitblitReceivePackFactory(GitBlit gitblit) { super(); this.settings = gitblit.getSettings(); this.gitblit = gitblit; diff --git a/src/main/java/com/gitblit/git/RepositoryResolver.java b/src/main/java/com/gitblit/git/RepositoryResolver.java index 39d1f396..8615eea1 100644 --- a/src/main/java/com/gitblit/git/RepositoryResolver.java +++ b/src/main/java/com/gitblit/git/RepositoryResolver.java @@ -27,7 +27,7 @@ import org.eclipse.jgit.transport.resolver.ServiceNotEnabledException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.gitblit.Gitblit; +import com.gitblit.GitBlit; import com.gitblit.models.RepositoryModel; import com.gitblit.models.UserModel; @@ -41,9 +41,9 @@ public class RepositoryResolver<X> extends FileResolver<X> { private final Logger logger = LoggerFactory.getLogger(RepositoryResolver.class); - private final Gitblit gitblit; + private final GitBlit gitblit; - public RepositoryResolver(Gitblit gitblit) { + public RepositoryResolver(GitBlit gitblit) { super(gitblit.getRepositoriesFolder(), true); this.gitblit = gitblit; } diff --git a/src/main/java/com/gitblit/manager/ServicesManager.java b/src/main/java/com/gitblit/manager/ServicesManager.java index d04b2774..4cf07438 100644 --- a/src/main/java/com/gitblit/manager/ServicesManager.java +++ b/src/main/java/com/gitblit/manager/ServicesManager.java @@ -28,7 +28,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.gitblit.Constants.FederationToken; -import com.gitblit.Gitblit; +import com.gitblit.GitBlit; import com.gitblit.IStoredSettings; import com.gitblit.Keys; import com.gitblit.fanout.FanoutNioService; @@ -56,13 +56,13 @@ public class ServicesManager implements IServicesManager { private final IStoredSettings settings; - private final Gitblit gitblit; + private final GitBlit gitblit; private FanoutService fanoutService; private GitDaemon gitDaemon; - public ServicesManager(Gitblit gitblit) { + public ServicesManager(GitBlit gitblit) { this.settings = gitblit.getSettings(); this.gitblit = gitblit; } diff --git a/src/main/java/com/gitblit/service/FederationPullService.java b/src/main/java/com/gitblit/service/FederationPullService.java index 91fe015b..c804f3f1 100644 --- a/src/main/java/com/gitblit/service/FederationPullService.java +++ b/src/main/java/com/gitblit/service/FederationPullService.java @@ -32,7 +32,7 @@ import com.gitblit.Constants.AccessPermission; import com.gitblit.Constants.FederationPullStatus; import com.gitblit.Constants.FederationStrategy; import com.gitblit.GitBlitException.ForbiddenException; -import com.gitblit.Gitblit; +import com.gitblit.GitBlit; import com.gitblit.IUserService; import com.gitblit.Keys; import com.gitblit.models.FederationModel; @@ -51,7 +51,7 @@ public abstract class FederationPullService implements Runnable { Logger logger = LoggerFactory.getLogger(getClass()); - Gitblit gitblit; + GitBlit gitblit; private final List<FederationModel> registrations; |