/**
  * Exectue pan script with tranformation stored in ktr manager
  */
 public function execute()
 {
     $logID = $this->ktrExecutorDAO->addExecutionInfoTuple($this->sid, $this->ktrManager->getTableName(), $this->userId);
     $ktrFilePath = $this->ktrManager->changeTranasformationName($logID);
     $command = $this->getCommand($logID);
     $this->ktrExecutorDAO->updateExecutionInfoTupleCommand($logID, $command);
     // loggin to db
     $databaseConnectionInfo = $this->createTargetDatabaseAndTable($logID);
     $this->addMetaDataAboutTargetDatabase($logID, $databaseConnectionInfo);
     $this->ktrExecutorDAO->updateExecutionInfoLog($logID, "executing pan");
     // loggin to db
     // ACTUALL PAN SCRIPT EXECUTION
     $timeStarted = time();
     $this->ktrExecutorDAO->updateExecutionInfoLog($logID, "Strting Curl:" . time());
     // loggin to db
     $curlCaller = new CurlCaller();
     $res = $curlCaller->CallAPI("GET", $command, false);
     $timeEnded = time();
     $this->ktrExecutorDAO->updateExecutionInfoLog($logID, "Finished Curl: " . time() . " Took: " . $timeEnded - $timeStarted);
     // loggin to db
     //var_dump($res);
     //exec($command . "2>&1", $outA, $returnVar);
     //    $this->ktrExecutorDAO->updateExecutionInfoLog($logID, "pan finished");  // loggin to db
     // $this->processExecutionResultMessage($logID, $returnVar, $outA);
 }
Example #2
0
 /** Get a Caller instance.
  *
  * @return	Caller	A Caller instance.
  * @static
  * @access	public
  */
 public static function getInstance()
 {
     if (!is_object(self::$instance)) {
         self::$instance = new CurlCaller();
     }
     return self::$instance;
 }
<?php

require_once realpath(dirname(__FILE__)) . '/../RESTCaller/CurlCaller.php';
require_once realpath(dirname(__FILE__)) . '/../conf/ColFusion_JAVA_REST_API.php';
$curlCaller = new CurlCaller();
$sid = 1;
$user_id = 2;
$table_name = 3;
$columns = 4;
$condition = 5;
$res = $curlCaller->CallAPI("GET", REST_HOST . ":" . REST_PORT . "/RESTfulProject/REST/WebService/GetFeeds?sid=" . $sid . "&user_id=" . $user_id . "&table_name=" . $table_name . "&columns=" . $columns . "&condition=" . $condition, false);
var_dump($res);
Example #4
0
 /** Get a {@link CurlCaller} instance.
  *
  * @return	CurlCaller	A {@link CurlCaller} instance.
  * @static
  * @access	public
  */
 public static function getCurlCaller()
 {
     return CurlCaller::getInstance();
 }