Package org.eclipse.jgit.transport

Examples of org.eclipse.jgit.transport.CredentialItem$Password


      eu.setLightweightPerson(lPerson);
      eu.addNetId(netId);
     
      EnterpriseUserPassword eup=(EnterpriseUserPassword)appConfig.getObject(ENTERPRISE_USER_PASSWORD);
      eup.setEnterpriseUser(eu);
      Password p = eup.newPassword();
      p.setValue(newPassword);
      p.setType("secure credential");
      p.setEncryption("cleartext");
     
      java.util.List returnedEup = eup.query(eu, p2p);
      if (returnedEup.size() == 0) {
        //create the password
        eup.setPassword(p);
View Full Code Here



      // get the newdata from the form data
      EnterpriseUserPassword eup = (EnterpriseUserPassword)getAppConfig().getObject(messageObjectName);
      eup.getXmlEnterpriseObject().setBaseline(baselineEup.getXmlEnterpriseObject());
      Password p = eup.newPassword();
      p.setValue(newPassword);
      p.setType(getChannelRuntimeData().getParameter("Password@type"));
      p.setEncryption(getChannelRuntimeData().getParameter("Password@encryption"));
      eup.setPassword(p);
      eup.setEnterpriseUser(baselineEup.getEnterpriseUser());
     

      // todo - use producer pool
View Full Code Here

          // populate one with values from uPortal then, when the password reset
          // is done (update handler) do a create instead of an update.
          LogService.log(LogService.INFO, "[EnterpriseUserPasswordQueryHandler] EnterpriseUserPassword doesn't exist, using uPortal info.");
          EnterpriseUserPassword eup = (EnterpriseUserPassword)getAppConfig().getObject(messageObjectName);
          eup.setEnterpriseUser(eu);
          Password p = eup.newPassword();
          p.setValue("eupqhunknown");
          p.setType("secure credential");
          p.setEncryption("cleartext");
          eup.setPassword(p);

//          eup.create((PointToPointProducer)getAppConfig().getObject(producerName));
//          LogService.log(LogService.INFO, "[EnterpriseUserPasswordQueryHandler] EnterpriseUserPassword was created.");
          xml += eup.getXmlEnterpriseObject().toXmlString();
View Full Code Here

        logger.info("["+portletName+"] Found EnterpriseUser: " + eu);
      }
     
      EnterpriseUserPassword eup=(EnterpriseUserPassword)appConfig.getObject(ENTERPRISE_USER_PASSWORD);
      eup.setEnterpriseUser(eu);
      Password p = eup.newPassword();
      p.setValue(newPassword);
      p.setType("secure credential");
      p.setEncryption("cleartext");
     
      java.util.List returnedEup = eup.query(eu, p2p);
      if (returnedEup.size() == 0) {
        //create the password
        eup.setPassword(p);
View Full Code Here

        return components.toArray(new JComponent[components.size()]);
    }

    private static void updateCredentialItems(JComponent[] components) {
        for (JComponent component : components) {
            CredentialItem item = (CredentialItem) component.getClientProperty(CRED_ITEM);
            if (item == null) {
                continue;
            }
            if (item instanceof CredentialItem.Username) {
                JTextField field = (JTextField) component;
                ((CredentialItem.Username) item).setValue(field.getText());
                continue;
            }
            if (item instanceof CredentialItem.Password) {
                JPasswordField field = (JPasswordField) component;
                ((CredentialItem.Password) item).setValue(field.getPassword());
                continue;
            }
            if (item instanceof CredentialItem.StringType) {
                if (item.isValueSecure()) {
                    JPasswordField field = (JPasswordField) component;
                    ((CredentialItem.StringType) item).setValue(new String(field.getPassword()));
                    continue;
                }
                JTextField field = (JTextField) component;
View Full Code Here

      throws UnsupportedCredentialItem {
    if (items.length == 0) {
      return true;

    } else if (items.length == 1) {
      final CredentialItem item = items[0];

      if (item instanceof CredentialItem.InformationalMessage) {
        JOptionPane.showMessageDialog(null, item.getPromptText(),
            UIText.get().warning, JOptionPane.INFORMATION_MESSAGE);
        return true;

      } else if (item instanceof CredentialItem.YesNoType) {
        CredentialItem.YesNoType v = (CredentialItem.YesNoType) item;
View Full Code Here

    final JPanel panel = new JPanel();
    panel.setLayout(new GridBagLayout());

    final JTextField[] texts = new JTextField[items.length];
    for (int i = 0; i < items.length; i++) {
      CredentialItem item = items[i];

      if (item instanceof CredentialItem.StringType
          || item instanceof CredentialItem.CharArrayType) {
        gbc.fill = GridBagConstraints.NONE;
        gbc.gridwidth = GridBagConstraints.RELATIVE;
        gbc.gridx = 0;
        panel.add(new JLabel(item.getPromptText()), gbc);

        gbc.fill = GridBagConstraints.HORIZONTAL;
        gbc.gridwidth = GridBagConstraints.RELATIVE;
        gbc.gridx = 1;
        if (item.isValueSecure())
          texts[i] = new JPasswordField(20);
        else
          texts[i] = new JTextField(20);
        panel.add(texts[i], gbc);
        gbc.gridy++;

      } else if (item instanceof CredentialItem.InformationalMessage) {
        gbc.fill = GridBagConstraints.NONE;
        gbc.gridwidth = GridBagConstraints.REMAINDER;
        gbc.gridx = 0;
        panel.add(new JLabel(item.getPromptText()), gbc);
        gbc.gridy++;

      } else {
        throw new UnsupportedCredentialItem(uri, item.getPromptText());
      }
    }

    if (JOptionPane.showConfirmDialog(null, panel,
        UIText.get().authenticationRequired,
        JOptionPane.OK_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE) != JOptionPane.OK_OPTION)
      return false; // cancel

    for (int i = 0; i < items.length; i++) {
      CredentialItem item = items[i];
      JTextField f = texts[i];

      if (item instanceof CredentialItem.StringType) {
        CredentialItem.StringType v = (CredentialItem.StringType) item;
        if (f instanceof JPasswordField)
View Full Code Here

  @Override
  public boolean get(URIish uri, CredentialItem... items)
      throws UnsupportedCredentialItem {
    boolean ok = true;
    for (int i = 0; i < items.length && ok; i++) {
      CredentialItem item = items[i];

      if (item instanceof CredentialItem.StringType)
        ok = get((CredentialItem.StringType) item);

      else if (item instanceof CredentialItem.CharArrayType)
        ok = get((CredentialItem.CharArrayType) item);

      else if (item instanceof CredentialItem.YesNoType)
        ok = get((CredentialItem.YesNoType) item);

      else if (item instanceof CredentialItem.InformationalMessage)
        ok = get((CredentialItem.InformationalMessage) item);

      else
        throw new UnsupportedCredentialItem(uri, item.getPromptText());
    }
    return ok;
  }
View Full Code Here

      throws UnsupportedCredentialItem {
    if (items.length == 0) {
      return true;

    } else if (items.length == 1) {
      final CredentialItem item = items[0];

      if (item instanceof CredentialItem.InformationalMessage) {
        JOptionPane.showMessageDialog(null, item.getPromptText(),
            UIText.get().warning, JOptionPane.INFORMATION_MESSAGE);
        return true;

      } else if (item instanceof CredentialItem.YesNoType) {
        CredentialItem.YesNoType v = (CredentialItem.YesNoType) item;
View Full Code Here

    final JPanel panel = new JPanel();
    panel.setLayout(new GridBagLayout());

    final JTextField[] texts = new JTextField[items.length];
    for (int i = 0; i < items.length; i++) {
      CredentialItem item = items[i];

      if (item instanceof CredentialItem.StringType
          || item instanceof CredentialItem.CharArrayType) {
        gbc.fill = GridBagConstraints.NONE;
        gbc.gridwidth = GridBagConstraints.RELATIVE;
        gbc.gridx = 0;
        panel.add(new JLabel(item.getPromptText()), gbc);

        gbc.fill = GridBagConstraints.HORIZONTAL;
        gbc.gridwidth = GridBagConstraints.RELATIVE;
        gbc.gridx = 1;
        if (item.isValueSecure())
          texts[i] = new JPasswordField(20);
        else
          texts[i] = new JTextField(20);
        panel.add(texts[i], gbc);
        gbc.gridy++;

      } else if (item instanceof CredentialItem.InformationalMessage) {
        gbc.fill = GridBagConstraints.NONE;
        gbc.gridwidth = GridBagConstraints.REMAINDER;
        gbc.gridx = 0;
        panel.add(new JLabel(item.getPromptText()), gbc);
        gbc.gridy++;

      } else {
        throw new UnsupportedCredentialItem(uri, item.getPromptText());
      }
    }

    if (JOptionPane.showConfirmDialog(null, panel,
        UIText.get().authenticationRequired,
        JOptionPane.OK_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE) != JOptionPane.OK_OPTION)
      return false; // cancel

    for (int i = 0; i < items.length; i++) {
      CredentialItem item = items[i];
      JTextField f = texts[i];

      if (item instanceof CredentialItem.StringType) {
        CredentialItem.StringType v = (CredentialItem.StringType) item;
        if (f instanceof JPasswordField)
View Full Code Here

TOP

Related Classes of org.eclipse.jgit.transport.CredentialItem$Password

Copyright © 2018 www.massapicom. 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.