public VPBuilderInitVPDbConfig(
     String atrSrcDataHdfsFolder,
     String fieldsSplit,
     String accountTypeIdSplit,
     String actVpEventDatabasename,
     String actVpEventOnCreateParameters,
     String actVpEventOnCloseParameters,
     String actNShards,
     String actWinSeconds,
     String dstHdfsFolder,
     String recordLength,
     String[] rules,
     String[] predineAttrbitues,
     boolean deleteBuffers) {
   this.atrSrcDataHdfsFolder = atrSrcDataHdfsFolder;
   this.fieldsSplit = Base64.encode(fieldsSplit.getBytes());
   this.accountTypeIdSplit = Base64.encode(accountTypeIdSplit.getBytes());
   this.actVpEventDatabasename = actVpEventDatabasename;
   this.actVpEventOnCreateParameters = actVpEventOnCreateParameters;
   this.actVpEventOnCloseParameters = actVpEventOnCloseParameters;
   this.actNShards = actNShards;
   this.actWinSeconds = actWinSeconds;
   this.dstHdfsFolder = dstHdfsFolder;
   this.recordLength = recordLength;
   this.rules = rules;
   this.predineAttrbitues = predineAttrbitues;
   this.delBuffers = deleteBuffers;
 }
  private void logIn(java.awt.event.ActionEvent evt) throws ClassNotFoundException, SQLException {

    String userName = txtfldUserName.getText();
    setcurrentUser(userName);
    char[] passwordEntered = this.txtfldPassword.getPassword();
    String passwordStored = "";

    boolean loggedIn = (passwordStored.equals(passwordStored));

    if (true) {
      //  DataAccessor da = new DataAccessor();
      JOptionPane.showMessageDialog(this, "Login Successful.");
      // currentUser.setUserFirstName(txtfldUserName.getText());
      // currentUser.setType(da.getUserType(userName));
      // currentUser.setImage((Icon)da.getUserImage(userName));
      try {
        PrintWriter out;
        java.util.Date date = new java.util.Date();
        String dateFormatted =
            new java.text.SimpleDateFormat("dd/MM/yyyy HH:mm").format(date.getTime());
        out = new PrintWriter(new BufferedWriter(new FileWriter("log.tmp", true)));
        String encoded;
        encoded =
            Base64.encode(
                ("User Name : " + userName + "\tTime : " + dateFormatted).getBytes("UTF-16"));
        out.println(encoded);
        out.close();
      } catch (IOException e) {
      }
      this.setVisible(false);
      try {
        UIManager.setLookAndFeel("de.javasoft.plaf.synthetica.SyntheticaAluOxideLookAndFeel");
      } catch (ClassNotFoundException
          | InstantiationException
          | IllegalAccessException
          | UnsupportedLookAndFeelException ex) {
        Logger.getLogger(LogIn.class.getName()).log(Level.SEVERE, null, ex);
      }
      // MainGUI mi = new MainGUI();
      // mi.setVisible(true);
    } else if (passwordStored == null) {
      JOptionPane.showMessageDialog(this, "Login Failure.\nInvalid User Name");
    } else {
      JOptionPane.showMessageDialog(this, "Login Failure.\nInvalid Password");
    }
  }
示例#3
0
 /**
  * Feed Media
  *
  * @param m
  * @throws MalformedURLException
  */
 protected void feedMedia(Media m) throws MalformedURLException {
   this.setParsingMaker(new ParsingMaker(this.getMediaTitleRegex(), this.getData()));
   m.setTitle(this.getParsingMaker().findOut(">", "<"));
   if (m.getTitle() != null) m.setTitle(m.getTitle().trim());
   this.setParsingMaker(new ParsingMaker(this.getMediaAsinRegex(), this.getData()));
   m.setAsin(this.getParsingMaker().findOut("=\"", "\""));
   if (m.getAsin() != null) m.setAsin(m.getAsin().trim());
   this.setParsingMaker(new ParsingMaker(this.getMediaPriceRegex(), this.getData()));
   m.setPrice(this.getParsingMaker().findOut(" ", "<"));
   if (m.getPrice() != null) m.setPrice(m.getPrice().trim());
   this.setParsingMaker(new ParsingMaker(this.getMediaPriceRegex(), this.getData()));
   m.setDevise(this.getParsingMaker().findOut(">", " "));
   if (m.getDevise() != null) m.setDevise(m.getDevise().trim());
   this.setParsingMaker(new ParsingMaker(this.getMediaImageRegex(), this.getData()));
   String imageUrl = this.getParsingMaker().findOut("=\"", "\"");
   if (imageUrl != null) {
     imageUrl = imageUrl.trim();
     this.setFileLoader(new FileLoader(new URL(imageUrl)));
     m.setImage(Base64.encode(this.getFileLoader().getFile()).toString());
   }
 }
    public Server provision(JCloudsCloud cloud) {
        final ServerCreateBuilder builder = Builders.server();
        final String nodeName = name + "-" + System.currentTimeMillis() % 1000;
        LOGGER.info("Provisioning new openstack node " + nodeName);
        // Ensure predictable node name so we can inject it into user data
        builder.name(nodeName);

        if (!Strings.isNullOrEmpty(imageId)) {
            LOGGER.info("Setting image id to " + imageId);
            builder.image(imageId);
        }
        if (!Strings.isNullOrEmpty((hardwareId))) {
            LOGGER.info("Setting hardware Id to " + hardwareId);
            builder.flavor(hardwareId);
        }

        if (!Strings.isNullOrEmpty(networkId)) {
            LOGGER.info("Setting network to " + networkId);
            builder.networks(Arrays.asList(networkId));
        }

        if (!Strings.isNullOrEmpty(securityGroups)) {
            LOGGER.info("Setting security groups to " + securityGroups);
            for (String sg: csvToArray(securityGroups)) {
                builder.addSecurityGroup(sg);
            }
        }

        if (!Strings.isNullOrEmpty(keyPairName)) {
            LOGGER.info("Setting keyPairName to " + keyPairName);
            builder.keypairName(keyPairName);
        }

        if (!Strings.isNullOrEmpty(availabilityZone)) {
            LOGGER.info("Setting availabilityZone to " + availabilityZone);
            builder.availabilityZone(availabilityZone);
        }

        ExtensionList<ConfigProvider> providers = ConfigProvider.all();
        UserDataConfig.UserDataConfigProvider myProvider = providers.get(UserDataConfig.UserDataConfigProvider.class);
        Config userData = myProvider.getConfigById(userDataId);
        if (userData != null && !userData.content.isEmpty()) {
            HashMap<String, String> vars = new HashMap<String, String>();
            String rootUrl = Jenkins.getInstance().getRootUrl();
            vars.put("JENKINS_URL", rootUrl);
            vars.put("SLAVE_JAR_URL", rootUrl + "jnlpJars/slave.jar");
            vars.put("SLAVE_JNLP_URL", rootUrl + "computer/" + nodeName + "/slave-agent.jnlp");
            vars.put("SLAVE_LABELS", labelString);
            String content = Util.replaceMacro(userData.content, vars);
            LOGGER.info("Sending user-data:\n" + content);
            builder.userData(Base64.encode(content.getBytes()));
        }

        final Openstack openstack = cloud.getOpenstack();
        final Server server = openstack.bootAndWaitActive(builder, cloud.startTimeout);
        LOGGER.info("Provisioned: " + server.toString());

        if (cloud.isFloatingIps()) {
            LOGGER.info("Assiging floating IP to " + nodeName);
            openstack.assignFloatingIp(server);
        }

        // Make sure address information is propagated
        return openstack.updateInfo(server);
    }
 public static String toBase64(final String hex) {
   return Base64.encode(DatatypeConverter.parseHexBinary(hex));
 }
 public void setAccountTypeIdSplit(String accountTypeIdSplit) {
   this.accountTypeIdSplit = Base64.encode(accountTypeIdSplit.getBytes());
 }
 public void setFieldsSplit(String fieldsSplit) {
   this.fieldsSplit = Base64.encode(fieldsSplit.getBytes());
 }