Examples of FederationProposal


Examples of com.gitblit.models.FederationProposal

      return;
    }

    if (FederationRequest.PROPOSAL.equals(reqType)) {
      // Receive a gitblit federation proposal
      FederationProposal proposal = deserialize(request, response, FederationProposal.class);
      if (proposal == null) {
        return;
      }

      // reject proposal, if not receipt prohibited
View Full Code Here

Examples of com.gitblit.models.FederationProposal

      return;
    }

    if (FederationRequest.PROPOSAL.equals(reqType)) {
      // Receive a gitblit federation proposal
      FederationProposal proposal = deserialize(request, response, FederationProposal.class);
      if (proposal == null) {
        return;
      }

      // reject proposal, if not receipt prohibited
View Full Code Here

Examples of com.gitblit.models.FederationProposal

    myUrl = WicketUtils.getGitblitURL(getRequest());
    destinationUrl = "https://";

    // temporary proposal
    FederationProposal proposal = app().federation().createFederationProposal(myUrl, token);
    if (proposal == null) {
      error(getString("gb.couldNotCreateFederationProposal"), true);
    }

    CompoundPropertyModel<SendProposalPage> model = new CompoundPropertyModel<SendProposalPage>(
        this);

    Form<SendProposalPage> form = new Form<SendProposalPage>("editForm", model) {
      private static final long serialVersionUID = 1L;

      @Override
      protected void onSubmit() {
        // confirm a repository name was entered
        if (StringUtils.isEmpty(myUrl)) {
          error(getString("gb.pleaseSetGitblitUrl"));
          return;
        }
        if (StringUtils.isEmpty(destinationUrl)) {
          error(getString("gb.pleaseSetDestinationUrl"));
          return;
        }

        // build new proposal
        FederationProposal proposal = app().federation().createFederationProposal(myUrl, token);
        proposal.url = myUrl;
        proposal.message = message;
        try {
          FederationProposalResult res = FederationUtils
              .propose(destinationUrl, proposal);
View Full Code Here

Examples of com.gitblit.models.FederationProposal

  public ReviewProposalPage(PageParameters params) {
    super(params);

    final String token = WicketUtils.getToken(params);

    FederationProposal proposal = app().federation().getPendingFederationProposal(token);
    if (proposal == null) {
      error(getString("gb.couldNotFindFederationProposal"), true);
    }

    setupPage(getString("gb.proposals"), proposal.url);
View Full Code Here

Examples of com.gitblit.models.FederationProposal

              && file.getName().toLowerCase().endsWith(Constants.PROPOSAL_EXT);
        }
      });
      for (File file : files) {
        String json = com.gitblit.utils.FileUtils.readContent(file, null);
        FederationProposal proposal = JsonUtils.fromJsonString(json,
            FederationProposal.class);
        list.add(proposal);
      }
    }
    return list;
View Full Code Here

Examples of com.gitblit.models.FederationProposal

        tokenType = type;
        break;
      }
    }
    Map<String, RepositoryModel> repositories = getRepositories(gitblitUrl, token);
    FederationProposal proposal = new FederationProposal(gitblitUrl, tokenType, token,
        repositories);
    return proposal;
  }
View Full Code Here

Examples of com.gitblit.models.FederationProposal

      model.size = "5 MB";
      model.hasCommits = true;
      repositories.put(model.name, model);
    }

    FederationProposal proposal = new FederationProposal("http://testurl", FederationToken.ALL,
        "testtoken", repositories);

    // propose federation
    assertEquals("proposal refused", FederationUtils.propose(url, proposal),
        FederationProposalResult.NO_PROPOSALS);
View Full Code Here

Examples of com.gitblit.models.FederationProposal

        counter = 0;
      }

      @Override
      public void populateItem(final Item<FederationProposal> item) {
        final FederationProposal entry = item.getModelObject();
        item.add(new LinkPanel("url", "list", entry.url, ReviewProposalPage.class,
            WicketUtils.newTokenParameter(entry.token)));
        item.add(WicketUtils.createDateLabel("received", entry.received, getTimeZone(), getTimeUtils()));
        item.add(new Label("tokenType", entry.tokenType.name()));
        item.add(new LinkPanel("token", "list", entry.token, ReviewProposalPage.class,
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.