Examples of IGitblit


Examples of com.gitblit.manager.IGitblit

    RuntimeManager runtime = new RuntimeManager(settings, baseFolder).start();
    NoopNotificationManager notifications = new NoopNotificationManager().start();
    UserManager users = new UserManager(runtime).start();
    RepositoryManager repositories = new RepositoryManager(runtime, users).start();
    FederationManager federation = new FederationManager(runtime, notifications, repositories).start();
    IGitblit gitblit = new GitblitManager(runtime, null, notifications, users, null, null, repositories, null, federation);

    FederationPullService puller = new FederationPullService(gitblit, federation.getFederationRegistrations()) {
      @Override
      public void reschedule(FederationModel registration) {
        // NOOP
View Full Code Here

Examples of com.gitblit.manager.IGitblit

  @Override
  public void init(final ServletConfig config) throws ServletException {
    ServletContext context = config.getServletContext();
    ObjectGraph dagger = (ObjectGraph) context.getAttribute(DaggerContext.INJECTOR_NAME);
    IGitblit gitblit = dagger.get(IGitblit.class);
    gitFilter.setRepositoryResolver(new RepositoryResolver<HttpServletRequest>(gitblit));
    gitFilter.setUploadPackFactory(new GitblitUploadPackFactory<HttpServletRequest>(gitblit));
    gitFilter.setReceivePackFactory(new GitblitReceivePackFactory<HttpServletRequest>(gitblit));

    gitFilter.init(new FilterConfig() {
View Full Code Here

Examples of com.gitblit.manager.IGitblit

  }

  static abstract class PluginCommand extends SshCommand {

    protected PluginWrapper getPlugin(String id) throws Failure {
      IGitblit gitblit = getContext().getGitblit();
      PluginWrapper pluginWrapper = null;
      try {
        int index = Integer.parseInt(id);
        List<PluginWrapper> plugins = gitblit.getPlugins();
        if (index > plugins.size()) {
          throw new UnloggedFailure(1, "Invalid plugin index specified!");
        }
        pluginWrapper = plugins.get(index - 1);
      } catch (NumberFormatException e) {
        pluginWrapper = gitblit.getPlugin(id);
        if (pluginWrapper == null) {
          PluginRegistration reg = gitblit.lookupPlugin(id);
          if (reg == null) {
            throw new UnloggedFailure("Invalid plugin specified!");
          }
          pluginWrapper = gitblit.getPlugin(reg.id);
        }
      }

      return pluginWrapper;
    }
View Full Code Here

Examples of com.gitblit.manager.IGitblit

    @Argument(index = 0, required = true, metaVar = "ALL|<ID>|<INDEX>", usage = "the plugin to start")
    protected String id;

    @Override
    public void run() throws Failure {
      IGitblit gitblit = getContext().getGitblit();
      if (id.equalsIgnoreCase("ALL")) {
        gitblit.startPlugins();
        stdout.println("All plugins started");
      } else {
        PluginWrapper pluginWrapper = getPlugin(id);
        if (pluginWrapper == null) {
          throw new UnloggedFailure(String.format("Plugin %s is not installed!", id));
        }

        PluginState state = gitblit.startPlugin(pluginWrapper.getPluginId());
        if (PluginState.STARTED.equals(state)) {
          stdout.println(String.format("Started %s", pluginWrapper.getPluginId()));
        } else {
          throw new UnloggedFailure(1, String.format("Failed to start %s", pluginWrapper.getPluginId()));
        }
View Full Code Here

Examples of com.gitblit.manager.IGitblit

    @Argument(index = 0, required = true, metaVar = "ALL|<ID>|<INDEX>", usage = "the plugin to stop")
    protected String id;

    @Override
    public void run() throws Failure {
      IGitblit gitblit = getContext().getGitblit();
      if (id.equalsIgnoreCase("ALL")) {
        gitblit.stopPlugins();
        stdout.println("All plugins stopped");
      } else {
        PluginWrapper pluginWrapper = getPlugin(id);
        if (pluginWrapper == null) {
          throw new UnloggedFailure(String.format("Plugin %s is not installed!", id));
        }

        PluginState state = gitblit.stopPlugin(pluginWrapper.getPluginId());
        if (PluginState.STOPPED.equals(state)) {
          stdout.println(String.format("Stopped %s", pluginWrapper.getPluginId()));
        } else {
          throw new UnloggedFailure(1, String.format("Failed to stop %s", pluginWrapper.getPluginId()));
        }
View Full Code Here

Examples of com.gitblit.manager.IGitblit

  @Override
  public void setContext(SshCommandContext context) {
    super.setContext(context);

    IGitblit gitblit = context.getGitblit();
    repositoryResolver = new RepositoryResolver<SshDaemonClient>(gitblit);
    uploadPackFactory = new GitblitUploadPackFactory<SshDaemonClient>(gitblit);
    receivePackFactory = new GitblitReceivePackFactory<SshDaemonClient>(gitblit);
  }
View Full Code Here

Examples of com.gitblit.manager.IGitblit

    @Argument(index = 0, required = true, metaVar = "<ID>|<INDEX>", usage = "the plugin to enable")
    protected String id;

    @Override
    public void run() throws Failure {
      IGitblit gitblit = getContext().getGitblit();
      PluginWrapper pluginWrapper = getPlugin(id);
      if (pluginWrapper == null) {
        throw new UnloggedFailure("Invalid plugin specified!");
      }

      if (gitblit.enablePlugin(pluginWrapper.getPluginId())) {
        stdout.println(String.format("Enabled %s", pluginWrapper.getPluginId()));
      } else {
        throw new UnloggedFailure(1, String.format("Failed to enable %s", pluginWrapper.getPluginId()));
      }
    }
View Full Code Here

Examples of com.gitblit.manager.IGitblit

    @Argument(index = 0, required = true, metaVar = "<ID>|<INDEX>", usage = "the plugin to disable")
    protected String id;

    @Override
    public void run() throws Failure {
      IGitblit gitblit = getContext().getGitblit();
      PluginWrapper pluginWrapper = getPlugin(id);
      if (pluginWrapper == null) {
        throw new UnloggedFailure("Invalid plugin specified!");
      }

      if (gitblit.disablePlugin(pluginWrapper.getPluginId())) {
        stdout.println(String.format("Disabled %s", pluginWrapper.getPluginId()));
      } else {
        throw new UnloggedFailure(1, String.format("Failed to disable %s", pluginWrapper.getPluginId()));
      }
    }
View Full Code Here

Examples of com.gitblit.manager.IGitblit

    @Argument(index = 0, required = true, metaVar = "<ID>|<INDEX>", usage = "the plugin to show")
    protected String id;

    @Override
    public void run() throws Failure {
      IGitblit gitblit = getContext().getGitblit();
      PluginWrapper pw = getPlugin(id);
      if (pw == null) {
        PluginRegistration registration = gitblit.lookupPlugin(id);
        if (registration == null) {
          throw new Failure(1, String.format("Unknown plugin %s", id));
        }
        show(registration);
      } else {
View Full Code Here

Examples of com.gitblit.manager.IGitblit

     * Show an installed plugin.
     *
     * @param pw
     */
    protected void show(PluginWrapper pw) {
      IGitblit gitblit = getContext().getGitblit();
      PluginRegistration reg = gitblit.lookupPlugin(pw.getPluginId());

      // FIELDS
      final String fields = buildFieldTable(pw, reg);

      // EXTENSIONS
      StringBuilder sb = new StringBuilder();
      List<Class<?>> exts = gitblit.getExtensionClasses(pw.getPluginId());
      String extensions;
      if (exts.isEmpty()) {
        extensions = FlipTable.EMPTY;
      } else {
        StringBuilder description = new StringBuilder();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.