File was renamed from src/main/java/com/gitblit/Gitblit.java |
| | |
| | | |
| | | import com.gitblit.Constants.FederationRequest; |
| | | import com.gitblit.Constants.FederationToken; |
| | | import com.gitblit.manager.IAuthenticationManager; |
| | | import com.gitblit.manager.IFederationManager; |
| | | import com.gitblit.manager.IGitblitManager; |
| | | import com.gitblit.manager.INotificationManager; |
| | | import com.gitblit.manager.IProjectManager; |
| | | import com.gitblit.manager.IRepositoryManager; |
| | | import com.gitblit.manager.IRuntimeManager; |
| | | import com.gitblit.manager.ISessionManager; |
| | | import com.gitblit.manager.IUserManager; |
| | | import com.gitblit.models.FederationModel; |
| | | import com.gitblit.models.FederationProposal; |
| | |
| | | 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. |
| | |
| | | * @author James Moger |
| | | * |
| | | */ |
| | | public class Gitblit implements IRuntimeManager, |
| | | public class GitBlit implements IRuntimeManager, |
| | | INotificationManager, |
| | | IUserManager, |
| | | ISessionManager, |
| | | IAuthenticationManager, |
| | | IRepositoryManager, |
| | | IProjectManager, |
| | | IGitblitManager, |
| | |
| | | |
| | | private final IUserManager userManager; |
| | | |
| | | private final ISessionManager sessionManager; |
| | | private final IAuthenticationManager authenticationManager; |
| | | |
| | | private final IRepositoryManager repositoryManager; |
| | | |
| | |
| | | |
| | | private final IFederationManager federationManager; |
| | | |
| | | public Gitblit( |
| | | public GitBlit( |
| | | IRuntimeManager runtimeManager, |
| | | INotificationManager notificationManager, |
| | | IUserManager userManager, |
| | | ISessionManager sessionManager, |
| | | IAuthenticationManager authenticationManager, |
| | | IRepositoryManager repositoryManager, |
| | | IProjectManager projectManager, |
| | | IGitblitManager gitblitManager, |
| | |
| | | this.runtimeManager = runtimeManager; |
| | | this.notificationManager = notificationManager; |
| | | this.userManager = userManager; |
| | | this.sessionManager = sessionManager; |
| | | this.authenticationManager = authenticationManager; |
| | | this.repositoryManager = repositoryManager; |
| | | this.projectManager = projectManager; |
| | | this.gitblitManager = gitblitManager; |
| | |
| | | } |
| | | |
| | | @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); |
| | | } |
| | | |
| | | /* |
| | |
| | | |
| | | @Override |
| | | public UserModel authenticate(String username, char[] password) { |
| | | return sessionManager.authenticate(username, password); |
| | | return authenticationManager.authenticate(username, password); |
| | | } |
| | | |
| | | @Override |
| | | public UserModel authenticate(HttpServletRequest httpRequest) { |
| | | return sessionManager.authenticate(httpRequest, false); |
| | | return authenticationManager.authenticate(httpRequest, false); |
| | | } |
| | | @Override |
| | | public UserModel authenticate(HttpServletRequest httpRequest, boolean requiresCertificate) { |
| | | return sessionManager.authenticate(httpRequest, requiresCertificate); |
| | | return authenticationManager.authenticate(httpRequest, requiresCertificate); |
| | | } |
| | | |
| | | @Override |
| | | public void setCookie(HttpServletResponse response, UserModel user) { |
| | | sessionManager.setCookie(response, user); |
| | | authenticationManager.setCookie(response, user); |
| | | } |
| | | |
| | | @Override |
| | | public void logout(HttpServletResponse response, UserModel user) { |
| | | sessionManager.logout(response, user); |
| | | authenticationManager.logout(response, user); |
| | | } |
| | | |
| | | @Override |
| | | public boolean supportsCredentialChanges(UserModel user) { |
| | | return authenticationManager.supportsCredentialChanges(user); |
| | | } |
| | | |
| | | @Override |
| | | public boolean supportsDisplayNameChanges(UserModel user) { |
| | | return authenticationManager.supportsDisplayNameChanges(user); |
| | | } |
| | | |
| | | @Override |
| | | public boolean supportsEmailAddressChanges(UserModel user) { |
| | | return authenticationManager.supportsEmailAddressChanges(user); |
| | | } |
| | | |
| | | @Override |
| | | public boolean supportsTeamMembershipChanges(UserModel user) { |
| | | return authenticationManager.supportsTeamMembershipChanges(user); |
| | | } |
| | | |
| | | @Override |
| | | public boolean supportsTeamMembershipChanges(TeamModel team) { |
| | | return authenticationManager.supportsTeamMembershipChanges(team); |
| | | } |
| | | |
| | | /* |
| | |
| | | */ |
| | | |
| | | @Override |
| | | public boolean supportsAddUser() { |
| | | return userManager.supportsAddUser(); |
| | | } |
| | | |
| | | @Override |
| | | public boolean supportsCredentialChanges(UserModel user) { |
| | | return userManager.supportsCredentialChanges(user); |
| | | } |
| | | |
| | | @Override |
| | | public boolean supportsDisplayNameChanges(UserModel user) { |
| | | return userManager.supportsDisplayNameChanges(user); |
| | | } |
| | | |
| | | @Override |
| | | public boolean supportsEmailAddressChanges(UserModel user) { |
| | | return userManager.supportsEmailAddressChanges(user); |
| | | } |
| | | |
| | | @Override |
| | | public boolean supportsTeamMembershipChanges(UserModel user) { |
| | | return userManager.supportsTeamMembershipChanges(user); |
| | | } |
| | | |
| | | @Override |
| | | public void logout(UserModel user) { |
| | | userManager.logout(user); |
| | | public void setup(IRuntimeManager runtimeManager) { |
| | | } |
| | | |
| | | @Override |
| | |
| | | } |
| | | |
| | | @Override |
| | | public boolean supportsCookies() { |
| | | return userManager.supportsCookies(); |
| | | } |
| | | |
| | | @Override |
| | | public String getCookie(UserModel model) { |
| | | return userManager.getCookie(model); |
| | | } |
| | | |
| | | @Override |
| | | public UserModel authenticate(char[] cookie) { |
| | | return userManager.authenticate(cookie); |
| | | public UserModel getUserModel(char[] cookie) { |
| | | return userManager.getUserModel(cookie); |
| | | } |
| | | |
| | | @Override |