Package it.eng.spagobi.engines.talend

Examples of it.eng.spagobi.engines.talend.TalendEngineConfig


        logger.debug("OUT");
      }
    }
   
    private String getJavaExecutionCmd(Job job, File tempDir) {
      TalendEngineConfig config = TalendEngineConfig.getInstance();
      String cmd = "java";
      String classpath;
     
      classpath = "." + File.separatorChar + tempDir.getName() + File.pathSeparator
    + TalendScriptAccessUtils.getClassPath(job, runtimeRepository);
     
      String javaInstallDir = config.getJavaInstallDir();
      if(config.getJavaInstallDir() != null) {
        String javaBinDir = (config.getJavaBinDir() != null? config.getJavaBinDir(): "bin");
        String javaCommand = (config.getJavaCommand() != null? config.getJavaCommand(): "java");
        cmd = javaInstallDir + File.separatorChar + javaBinDir + File.separatorChar + javaCommand;
      }
     
      String xmsValue = (config.getJavaCommandOption("Xms")!= null? config.getJavaCommandOption("Xms"): DEFAULT_XMS_VALUE);
      String xmxValue = (config.getJavaCommandOption("Xmx")!= null? config.getJavaCommandOption("Xmx"): DEFAULT_XMX_VALUE);
      cmd += " -Xms" + xmsValue +"M -Xmx" + xmxValue + "M -cp " + classpath  + " " + TalendScriptAccessUtils.getExecutableClass(job);
       
      cmd = cmd + " --context=" + job.getContext();
     
      return cmd;
View Full Code Here


   *
   * @return the executable file name
   */
  public static String getExecutableFileName(Job job) {
    StringBuffer buffer = new StringBuffer();
    TalendEngineConfig config = TalendEngineConfig.getInstance();
    if(job.isPerlJob()) {
        buffer.append(job.getProject());
        buffer.append(config.getJobSeparator());
        buffer.append(config.getWordSeparator());
        buffer.append(job.getName());
        buffer.append(config.getPerlExt());
      } else if(job.isJavaJob()) {
        buffer.append(job.getName().toLowerCase());
        buffer.append("_" + job.getVersion().replace('.', '_'));
        buffer.append(".jar");       
      } else{
View Full Code Here

   *
   * @return the context file name
   */
  public static String getContextFileName(Job job) {   
    StringBuffer buffer = new StringBuffer();
    TalendEngineConfig config = TalendEngineConfig.getInstance();
    if(job.isPerlJob()) {
        buffer.append(job.getProject());
        buffer.append(config.getJobSeparator());
        buffer.append(config.getWordSeparator());
        buffer.append(job.getName());
        buffer.append(config.getWordSeparator());
        buffer.append(job.getContext());
        buffer.append(config.getPerlExt());
      } else if(job.isJavaJob()) {
        return null;
      } else{
        return null;
      }
View Full Code Here

   */
  public static File getContextFile(Job job, RuntimeRepository runtimeRepository) {   
    File contextFile = null;
    StringBuffer buffer = new StringBuffer();
   
    TalendEngineConfig config = TalendEngineConfig.getInstance();
    if(job.isPerlJob()) {
        buffer.append(job.getProject());
        buffer.append(config.getJobSeparator());
        buffer.append(config.getWordSeparator());
        buffer.append(job.getName());
        buffer.append(config.getWordSeparator());
        buffer.append(job.getContext());
        buffer.append(config.getPerlExt());
        File executableJobDir = runtimeRepository.getExecutableJobDir(job);
        String contextFileName = buffer.toString();
        contextFile = new File(executableJobDir, contextFileName);
      } else if(job.isJavaJob()) {
        buffer.append(runtimeRepository.getExecutableJobFile(job));
View Full Code Here

      if (!runtimeRepository.containsJob(job)) {         
        throw new JobNotFoundException("Job executable file " +
            runtimeRepository.getExecutableJobFile(job) + " does not exist.");
      }
     
      TalendEngineConfig config = TalendEngineConfig.getInstance();
      String cmd = config.getPerlInstallDir() + File.separatorChar + config.getPerlBinDir()+
        File.separatorChar + config.getPerlCommand() + " " + TalendScriptAccessUtils.getExecutableFileName(job);
     
             
      // if the context is not specified, it looks for the defualt context script file;
      // if it exists, the context is assumed to be the default.
      // Instead, if the context is specified, it looks for the relevant context script file;
View Full Code Here

      else {
        if (!tempDir.isDirectory()) tempDir.delete();
      }
      UUIDGenerator uuidGenerator = UUIDGenerator.getInstance();
      String tempFileName = uuidGenerator.generateTimeBasedUUID().toString();
      TalendEngineConfig config = TalendEngineConfig.getInstance();
      File contextScriptTempFile = new File(tempDirPath + File.separatorChar + tempFileName + config.getPerlExt());
    FileOutputStream fos = new FileOutputStream(contextScriptTempFile);
    fos.write(filebuff.toString().getBytes());
    fos.flush();
    fos.close();
    return contextScriptTempFile;
View Full Code Here

    String template = getTemplate(language, projectName, jobName);
   
    BASE64Encoder encoder = new BASE64Encoder();
    String templateBase64Coded = encoder.encode(template.getBytes());   
   
    TalendEngineConfig config = TalendEngineConfig.getInstance();
   
    String user = USER;
    String password = PASSWORD;
    Date now = new Date();
    String date = new Long (now.getTime()).toString();
    String label = jobName.toUpperCase();
    if (label.length() > 20) label = label.substring(0,19);
    String name = jobName ;
    String description = language + " job defined in " + projectName  + " project";
    String encrypt = "false";
    String visible = "true";
    String functionalitiyCode = config.getSpagobiTargetFunctionalityLabel();   
    String type = "ETL";
    String state = "DEV";
   
     HashMap<String, Object> attributes = new HashMap<String, Object>();
    attributes.put("TEMPLATE", templateBase64Coded);
View Full Code Here

      template += "</etl>";
     
      BASE64Encoder encoder = new BASE64Encoder();
      String templateBase64Coded = encoder.encode(template.getBytes());   
     
      TalendEngineConfig config = TalendEngineConfig.getInstance();
     
      String user = "biadmin";
    String password = "biadmin";
    String label = "ETL_JOB";
    String name = "EtlJob";
    String description = "Etl Job";
    boolean encrypt = false;
    boolean visible = true;
    String functionalitiyCode = config.getSpagobiTargetFunctionalityLabel()
    String type = "ETL";
    String state = "DEV";
     
      try {
View Full Code Here

TOP

Related Classes of it.eng.spagobi.engines.talend.TalendEngineConfig

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.