airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From scnakand...@apache.org
Subject [02/51] [partial] airavata-php-gateway git commit: removing files from wrong merge
Date Tue, 13 Dec 2016 22:09:15 GMT
http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/d55608f1/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/thrift/transport/TTransportException.h
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/thrift/transport/TTransportException.h b/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/thrift/transport/TTransportException.h
deleted file mode 100644
index 028dbb8..0000000
--- a/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/thrift/transport/TTransportException.h
+++ /dev/null
@@ -1,115 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#ifndef _THRIFT_TRANSPORT_TTRANSPORTEXCEPTION_H_
-#define _THRIFT_TRANSPORT_TTRANSPORTEXCEPTION_H_ 1
-
-#include <string>
-#include <thrift/Thrift.h>
-
-namespace apache { namespace thrift { namespace transport {
-
-/**
- * Class to encapsulate all the possible types of transport errors that may
- * occur in various transport systems. This provides a sort of generic
- * wrapper around the vague UNIX E_ error codes that lets a common code
- * base of error handling to be used for various types of transports, i.e.
- * pipes etc.
- *
- */
-class TTransportException : public apache::thrift::TException {
- public:
-  /**
-   * Error codes for the various types of exceptions.
-   */
-  enum TTransportExceptionType
-  { UNKNOWN = 0
-  , NOT_OPEN = 1
-  , TIMED_OUT = 2
-  , END_OF_FILE = 3
-  , INTERRUPTED = 4
-  , BAD_ARGS = 5
-  , CORRUPTED_DATA = 6
-  , INTERNAL_ERROR = 7
-  };
-
-  TTransportException() :
-    apache::thrift::TException(),
-    type_(UNKNOWN) {}
-
-  TTransportException(TTransportExceptionType type) :
-    apache::thrift::TException(),
-    type_(type) {}
-
-  TTransportException(const std::string& message) :
-    apache::thrift::TException(message),
-    type_(UNKNOWN) {}
-
-  TTransportException(TTransportExceptionType type, const std::string& message) :
-    apache::thrift::TException(message),
-    type_(type) {}
-
-  TTransportException(TTransportExceptionType type,
-                      const std::string& message,
-                      int errno_copy) :
-    apache::thrift::TException(message + ": " + TOutput::strerror_s(errno_copy)),
-    type_(type) {}
-
-  virtual ~TTransportException() throw() {}
-
-  /**
-   * Returns an error code that provides information about the type of error
-   * that has occurred.
-   *
-   * @return Error code
-   */
-  TTransportExceptionType getType() const throw() {
-    return type_;
-  }
-
-  virtual const char* what() const throw() {
-    if (message_.empty()) {
-      switch (type_) {
-        case UNKNOWN        : return "TTransportException: Unknown transport exception";
-        case NOT_OPEN       : return "TTransportException: Transport not open";
-        case TIMED_OUT      : return "TTransportException: Timed out";
-        case END_OF_FILE    : return "TTransportException: End of file";
-        case INTERRUPTED    : return "TTransportException: Interrupted";
-        case BAD_ARGS       : return "TTransportException: Invalid arguments";
-        case CORRUPTED_DATA : return "TTransportException: Corrupted Data";
-        case INTERNAL_ERROR : return "TTransportException: Internal error";
-        default             : return "TTransportException: (Invalid exception type)";
-      }
-    } else {
-      return message_.c_str();
-    }
-  }
-
- protected:
-  /** Just like strerror_r but returns a C++ string object. */
-  std::string strerror_s(int errno_copy);
-
-  /** Error code */
-  TTransportExceptionType type_;
-
-};
-
-}}} // apache::thrift::transport
-
-#endif // #ifndef _THRIFT_TRANSPORT_TTRANSPORTEXCEPTION_H_

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/d55608f1/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/thrift/transport/TTransportUtils.cpp
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/thrift/transport/TTransportUtils.cpp b/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/thrift/transport/TTransportUtils.cpp
deleted file mode 100644
index 44f6101..0000000
--- a/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/thrift/transport/TTransportUtils.cpp
+++ /dev/null
@@ -1,178 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#include <thrift/transport/TTransportUtils.h>
-
-using std::string;
-
-namespace apache { namespace thrift { namespace transport {
-
-uint32_t TPipedTransport::read(uint8_t* buf, uint32_t len) {
-  uint32_t need = len;
-
-  // We don't have enough data yet
-  if (rLen_-rPos_ < need) {
-    // Copy out whatever we have
-    if (rLen_-rPos_ > 0) {
-      memcpy(buf, rBuf_+rPos_, rLen_-rPos_);
-      need -= rLen_-rPos_;
-      buf += rLen_-rPos_;
-      rPos_ = rLen_;
-    }
-
-    // Double the size of the underlying buffer if it is full
-    if (rLen_ == rBufSize_) {
-      rBufSize_ *=2;
-      rBuf_ = (uint8_t *)std::realloc(rBuf_, sizeof(uint8_t) * rBufSize_);
-    }
-
-    // try to fill up the buffer
-    rLen_ += srcTrans_->read(rBuf_+rPos_, rBufSize_ - rPos_);
-  }
-
-
-  // Hand over whatever we have
-  uint32_t give = need;
-  if (rLen_-rPos_ < give) {
-    give = rLen_-rPos_;
-  }
-  if (give > 0) {
-    memcpy(buf, rBuf_+rPos_, give);
-    rPos_ += give;
-    need -= give;
-  }
-
-  return (len - need);
-}
-
-void TPipedTransport::write(const uint8_t* buf, uint32_t len) {
-  if (len == 0) {
-    return;
-  }
-
-  // Make the buffer as big as it needs to be
-  if ((len + wLen_) >= wBufSize_) {
-    uint32_t newBufSize = wBufSize_*2;
-    while ((len + wLen_) >= newBufSize) {
-      newBufSize *= 2;
-    }
-    wBuf_ = (uint8_t *)std::realloc(wBuf_, sizeof(uint8_t) * newBufSize);
-    wBufSize_ = newBufSize;
-  }
-
-  // Copy into the buffer
-  memcpy(wBuf_ + wLen_, buf, len);
-  wLen_ += len;
-}
-
-void TPipedTransport::flush()  {
-  // Write out any data waiting in the write buffer
-  if (wLen_ > 0) {
-    srcTrans_->write(wBuf_, wLen_);
-    wLen_ = 0;
-  }
-
-  // Flush the underlying transport
-  srcTrans_->flush();
-}
-
-TPipedFileReaderTransport::TPipedFileReaderTransport(boost::shared_ptr<TFileReaderTransport> srcTrans, boost::shared_ptr<TTransport> dstTrans)
-  : TPipedTransport(srcTrans, dstTrans),
-    srcTrans_(srcTrans) {
-}
-
-TPipedFileReaderTransport::~TPipedFileReaderTransport() {
-}
-
-bool TPipedFileReaderTransport::isOpen() {
-  return TPipedTransport::isOpen();
-}
-
-bool TPipedFileReaderTransport::peek() {
-  return TPipedTransport::peek();
-}
-
-void TPipedFileReaderTransport::open() {
-  TPipedTransport::open();
-}
-
-void TPipedFileReaderTransport::close() {
-  TPipedTransport::close();
-}
-
-uint32_t TPipedFileReaderTransport::read(uint8_t* buf, uint32_t len) {
-  return TPipedTransport::read(buf, len);
-}
-
-uint32_t TPipedFileReaderTransport::readAll(uint8_t* buf, uint32_t len) {
-  uint32_t have = 0;
-  uint32_t get = 0;
-
-  while (have < len) {
-    get = read(buf+have, len-have);
-    if (get <= 0) {
-      throw TEOFException();
-    }
-    have += get;
-  }
-
-  return have;
-}
-
-uint32_t TPipedFileReaderTransport::readEnd() {
-  return TPipedTransport::readEnd();
-}
-
-void TPipedFileReaderTransport::write(const uint8_t* buf, uint32_t len) {
-  TPipedTransport::write(buf, len);
-}
-
-uint32_t TPipedFileReaderTransport::writeEnd() {
-  return TPipedTransport::writeEnd();
-}
-
-void TPipedFileReaderTransport::flush() {
-  TPipedTransport::flush();
-}
-
-int32_t TPipedFileReaderTransport::getReadTimeout() {
-  return srcTrans_->getReadTimeout();
-}
-
-void TPipedFileReaderTransport::setReadTimeout(int32_t readTimeout) {
-  srcTrans_->setReadTimeout(readTimeout);
-}
-
-uint32_t TPipedFileReaderTransport::getNumChunks() {
-  return srcTrans_->getNumChunks();
-}
-
-uint32_t TPipedFileReaderTransport::getCurChunk() {
-  return srcTrans_->getCurChunk();
-}
-
-void TPipedFileReaderTransport::seekToChunk(int32_t chunk) {
-  srcTrans_->seekToChunk(chunk);
-}
-
-void TPipedFileReaderTransport::seekToEnd() {
-  srcTrans_->seekToEnd();
-}
-
-}}} // apache::thrift::transport

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/d55608f1/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/thrift/transport/TTransportUtils.h
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/thrift/transport/TTransportUtils.h b/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/thrift/transport/TTransportUtils.h
deleted file mode 100644
index aa294b4..0000000
--- a/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/thrift/transport/TTransportUtils.h
+++ /dev/null
@@ -1,330 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#ifndef _THRIFT_TRANSPORT_TTRANSPORTUTILS_H_
-#define _THRIFT_TRANSPORT_TTRANSPORTUTILS_H_ 1
-
-#include <cstdlib>
-#include <cstring>
-#include <string>
-#include <algorithm>
-#include <thrift/transport/TTransport.h>
-// Include the buffered transports that used to be defined here.
-#include <thrift/transport/TBufferTransports.h>
-#include <thrift/transport/TFileTransport.h>
-
-namespace apache { namespace thrift { namespace transport {
-
-/**
- * The null transport is a dummy transport that doesn't actually do anything.
- * It's sort of an analogy to /dev/null, you can never read anything from it
- * and it will let you write anything you want to it, though it won't actually
- * go anywhere.
- *
- */
-class TNullTransport : public TVirtualTransport<TNullTransport> {
- public:
-  TNullTransport() {}
-
-  ~TNullTransport() {}
-
-  bool isOpen() {
-    return true;
-  }
-
-  void open() {}
-
-  void write(const uint8_t* /* buf */, uint32_t /* len */) {
-    return;
-  }
-
-};
-
-
-/**
- * TPipedTransport. This transport allows piping of a request from one
- * transport to another either when readEnd() or writeEnd(). The typical
- * use case for this is to log a request or a reply to disk.
- * The underlying buffer expands to a keep a copy of the entire
- * request/response.
- *
- */
-class TPipedTransport : virtual public TTransport {
- public:
-  TPipedTransport(boost::shared_ptr<TTransport> srcTrans,
-                  boost::shared_ptr<TTransport> dstTrans) :
-    srcTrans_(srcTrans),
-    dstTrans_(dstTrans),
-    rBufSize_(512), rPos_(0), rLen_(0),
-    wBufSize_(512), wLen_(0) {
-
-    // default is to to pipe the request when readEnd() is called
-    pipeOnRead_ = true;
-    pipeOnWrite_ = false;
-
-    rBuf_ = (uint8_t*) std::malloc(sizeof(uint8_t) * rBufSize_);
-    if (rBuf_ == NULL) {
-      throw std::bad_alloc();
-    }
-    wBuf_ = (uint8_t*) std::malloc(sizeof(uint8_t) * wBufSize_);
-    if (wBuf_ == NULL) {
-      throw std::bad_alloc();
-    }
-  }
-
-  TPipedTransport(boost::shared_ptr<TTransport> srcTrans,
-                  boost::shared_ptr<TTransport> dstTrans,
-                  uint32_t sz) :
-    srcTrans_(srcTrans),
-    dstTrans_(dstTrans),
-    rBufSize_(512), rPos_(0), rLen_(0),
-    wBufSize_(sz), wLen_(0) {
-
-    rBuf_ = (uint8_t*) std::malloc(sizeof(uint8_t) * rBufSize_);
-    if (rBuf_ == NULL) {
-      throw std::bad_alloc();
-    }
-    wBuf_ = (uint8_t*) std::malloc(sizeof(uint8_t) * wBufSize_);
-    if (wBuf_ == NULL) {
-      throw std::bad_alloc();
-    }
-  }
-
-  ~TPipedTransport() {
-    std::free(rBuf_);
-    std::free(wBuf_);
-  }
-
-  bool isOpen() {
-    return srcTrans_->isOpen();
-  }
-
-  bool peek() {
-    if (rPos_ >= rLen_) {
-      // Double the size of the underlying buffer if it is full
-      if (rLen_ == rBufSize_) {
-        rBufSize_ *=2;
-        rBuf_ = (uint8_t *)std::realloc(rBuf_, sizeof(uint8_t) * rBufSize_);
-      }
-
-      // try to fill up the buffer
-      rLen_ += srcTrans_->read(rBuf_+rPos_, rBufSize_ - rPos_);
-    }
-    return (rLen_ > rPos_);
-  }
-
-
-  void open() {
-    srcTrans_->open();
-  }
-
-  void close() {
-    srcTrans_->close();
-  }
-
-  void setPipeOnRead(bool pipeVal) {
-    pipeOnRead_ = pipeVal;
-  }
-
-  void setPipeOnWrite(bool pipeVal) {
-    pipeOnWrite_ = pipeVal;
-  }
-
-  uint32_t read(uint8_t* buf, uint32_t len);
-
-  uint32_t readEnd() {
-
-    if (pipeOnRead_) {
-      dstTrans_->write(rBuf_, rPos_);
-      dstTrans_->flush();
-    }
-
-    srcTrans_->readEnd();
-
-    // If requests are being pipelined, copy down our read-ahead data,
-    // then reset our state.
-    int read_ahead = rLen_ - rPos_;
-    uint32_t bytes = rPos_;
-    memcpy(rBuf_, rBuf_ + rPos_, read_ahead);
-    rPos_ = 0;
-    rLen_ = read_ahead;
-
-    return bytes;
-  }
-
-  void write(const uint8_t* buf, uint32_t len);
-
-  uint32_t writeEnd() {
-    if (pipeOnWrite_) {
-      dstTrans_->write(wBuf_, wLen_);
-      dstTrans_->flush();
-    }
-    return wLen_;
-  }
-
-  void flush();
-
-  boost::shared_ptr<TTransport> getTargetTransport() {
-    return dstTrans_;
-  }
-
-  /*
-   * Override TTransport *_virt() functions to invoke our implementations.
-   * We cannot use TVirtualTransport to provide these, since we need to inherit
-   * virtually from TTransport.
-   */
-  virtual uint32_t read_virt(uint8_t* buf, uint32_t len) {
-    return this->read(buf, len);
-  }
-  virtual void write_virt(const uint8_t* buf, uint32_t len) {
-    this->write(buf, len);
-  }
-
- protected:
-  boost::shared_ptr<TTransport> srcTrans_;
-  boost::shared_ptr<TTransport> dstTrans_;
-
-  uint8_t* rBuf_;
-  uint32_t rBufSize_;
-  uint32_t rPos_;
-  uint32_t rLen_;
-
-  uint8_t* wBuf_;
-  uint32_t wBufSize_;
-  uint32_t wLen_;
-
-  bool pipeOnRead_;
-  bool pipeOnWrite_;
-};
-
-
-/**
- * Wraps a transport into a pipedTransport instance.
- *
- */
-class TPipedTransportFactory : public TTransportFactory {
- public:
-  TPipedTransportFactory() {}
-  TPipedTransportFactory(boost::shared_ptr<TTransport> dstTrans) {
-    initializeTargetTransport(dstTrans);
-  }
-  virtual ~TPipedTransportFactory() {}
-
-  /**
-   * Wraps the base transport into a piped transport.
-   */
-  virtual boost::shared_ptr<TTransport> getTransport(boost::shared_ptr<TTransport> srcTrans) {
-    return boost::shared_ptr<TTransport>(new TPipedTransport(srcTrans, dstTrans_));
-  }
-
-  virtual void initializeTargetTransport(boost::shared_ptr<TTransport> dstTrans) {
-    if (dstTrans_.get() == NULL) {
-      dstTrans_ = dstTrans;
-    } else {
-      throw TException("Target transport already initialized");
-    }
-  }
-
- protected:
-  boost::shared_ptr<TTransport> dstTrans_;
-};
-
-/**
- * TPipedFileTransport. This is just like a TTransport, except that
- * it is a templatized class, so that clients who rely on a specific
- * TTransport can still access the original transport.
- *
- */
-class TPipedFileReaderTransport : public TPipedTransport,
-                                  public TFileReaderTransport {
- public:
-  TPipedFileReaderTransport(boost::shared_ptr<TFileReaderTransport> srcTrans, boost::shared_ptr<TTransport> dstTrans);
-
-  ~TPipedFileReaderTransport();
-
-  // TTransport functions
-  bool isOpen();
-  bool peek();
-  void open();
-  void close();
-  uint32_t read(uint8_t* buf, uint32_t len);
-  uint32_t readAll(uint8_t* buf, uint32_t len);
-  uint32_t readEnd();
-  void write(const uint8_t* buf, uint32_t len);
-  uint32_t writeEnd();
-  void flush();
-
-  // TFileReaderTransport functions
-  int32_t getReadTimeout();
-  void setReadTimeout(int32_t readTimeout);
-  uint32_t getNumChunks();
-  uint32_t getCurChunk();
-  void seekToChunk(int32_t chunk);
-  void seekToEnd();
-
-  /*
-   * Override TTransport *_virt() functions to invoke our implementations.
-   * We cannot use TVirtualTransport to provide these, since we need to inherit
-   * virtually from TTransport.
-   */
-  virtual uint32_t read_virt(uint8_t* buf, uint32_t len) {
-    return this->read(buf, len);
-  }
-  virtual uint32_t readAll_virt(uint8_t* buf, uint32_t len) {
-    return this->readAll(buf, len);
-  }
-  virtual void write_virt(const uint8_t* buf, uint32_t len) {
-    this->write(buf, len);
-  }
-
- protected:
-  // shouldn't be used
-  TPipedFileReaderTransport();
-  boost::shared_ptr<TFileReaderTransport> srcTrans_;
-};
-
-/**
- * Creates a TPipedFileReaderTransport from a filepath and a destination transport
- *
- */
-class TPipedFileReaderTransportFactory : public TPipedTransportFactory {
- public:
-  TPipedFileReaderTransportFactory() {}
-  TPipedFileReaderTransportFactory(boost::shared_ptr<TTransport> dstTrans)
-    : TPipedTransportFactory(dstTrans)
-  {}
-  virtual ~TPipedFileReaderTransportFactory() {}
-
-  boost::shared_ptr<TTransport> getTransport(boost::shared_ptr<TTransport> srcTrans) {
-    boost::shared_ptr<TFileReaderTransport> pFileReaderTransport = boost::dynamic_pointer_cast<TFileReaderTransport>(srcTrans);
-    if (pFileReaderTransport.get() != NULL) {
-      return getFileReaderTransport(pFileReaderTransport);
-    } else {
-      return boost::shared_ptr<TTransport>();
-    }
-  }
-
-  boost::shared_ptr<TFileReaderTransport> getFileReaderTransport(boost::shared_ptr<TFileReaderTransport> srcTrans) {
-    return boost::shared_ptr<TFileReaderTransport>(new TPipedFileReaderTransport(srcTrans, dstTrans_));
-  }
-};
-
-}}} // apache::thrift::transport
-
-#endif // #ifndef _THRIFT_TRANSPORT_TTRANSPORTUTILS_H_

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/d55608f1/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/thrift/transport/TVirtualTransport.h
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/thrift/transport/TVirtualTransport.h b/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/thrift/transport/TVirtualTransport.h
deleted file mode 100644
index 575f547..0000000
--- a/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/thrift/transport/TVirtualTransport.h
+++ /dev/null
@@ -1,146 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#ifndef _THRIFT_TRANSPORT_TVIRTUALTRANSPORT_H_
-#define _THRIFT_TRANSPORT_TVIRTUALTRANSPORT_H_ 1
-
-#include <thrift/transport/TTransport.h>
-
-namespace apache { namespace thrift { namespace transport {
-
-
-/**
- * Helper class that provides default implementations of TTransport methods.
- *
- * This class provides default implementations of read(), readAll(), write(),
- * borrow() and consume().
- *
- * In the TTransport base class, each of these methods simply invokes its
- * virtual counterpart.  This class overrides them to always perform the
- * default behavior, without a virtual function call.
- *
- * The primary purpose of this class is to serve as a base class for
- * TVirtualTransport, and prevent infinite recursion if one of its subclasses
- * does not override the TTransport implementation of these methods.  (Since
- * TVirtualTransport::read_virt() calls read(), and TTransport::read() calls
- * read_virt().)
- */
-class TTransportDefaults : public TTransport {
- public:
-  /*
-   * TTransport *_virt() methods provide reasonable default implementations.
-   * Invoke them non-virtually.
-   */
-  uint32_t read(uint8_t* buf, uint32_t len) {
-    return this->TTransport::read_virt(buf, len);
-  }
-  uint32_t readAll(uint8_t* buf, uint32_t len) {
-    return this->TTransport::readAll_virt(buf, len);
-  }
-  void write(const uint8_t* buf, uint32_t len) {
-    this->TTransport::write_virt(buf, len);
-  }
-  const uint8_t* borrow(uint8_t* buf, uint32_t* len) {
-    return this->TTransport::borrow_virt(buf, len);
-  }
-  void consume(uint32_t len) {
-    this->TTransport::consume_virt(len);
-  }
-
- protected:
-  TTransportDefaults() {}
-};
-
-/**
- * Helper class to provide polymorphism for subclasses of TTransport.
- *
- * This class implements *_virt() methods of TTransport, to call the
- * non-virtual versions of these functions in the proper subclass.
- *
- * To define your own transport class using TVirtualTransport:
- * 1) Derive your subclass from TVirtualTransport<your class>
- *    e.g:  class MyTransport : public TVirtualTransport<MyTransport> {
- * 2) Provide your own implementations of read(), readAll(), etc.
- *    These methods should be non-virtual.
- *
- * Transport implementations that need to use virtual inheritance when
- * inheriting from TTransport cannot use TVirtualTransport.
- *
- * @author Chad Walters <chad@powerset.com>
- */
-template <class Transport_, class Super_=TTransportDefaults>
-class TVirtualTransport : public Super_ {
- public:
-  /*
-   * Implementations of the *_virt() functions, to call the subclass's
-   * non-virtual implementation function.
-   */
-  virtual uint32_t read_virt(uint8_t* buf, uint32_t len) {
-    return static_cast<Transport_*>(this)->read(buf, len);
-  }
-
-  virtual uint32_t readAll_virt(uint8_t* buf, uint32_t len) {
-    return static_cast<Transport_*>(this)->readAll(buf, len);
-  }
-
-  virtual void write_virt(const uint8_t* buf, uint32_t len) {
-    static_cast<Transport_*>(this)->write(buf, len);
-  }
-
-  virtual const uint8_t* borrow_virt(uint8_t* buf, uint32_t* len) {
-    return static_cast<Transport_*>(this)->borrow(buf, len);
-  }
-
-  virtual void consume_virt(uint32_t len) {
-    static_cast<Transport_*>(this)->consume(len);
-  }
-
-  /*
-   * Provide a default readAll() implementation that invokes
-   * read() non-virtually.
-   *
-   * Note: subclasses that use TVirtualTransport to derive from another
-   * transport implementation (i.e., not TTransportDefaults) should beware that
-   * this may override any non-default readAll() implementation provided by
-   * the parent transport class.  They may need to redefine readAll() to call
-   * the correct parent implementation, if desired.
-   */
-  uint32_t readAll(uint8_t* buf, uint32_t len) {
-    Transport_* trans = static_cast<Transport_*>(this);
-    return ::apache::thrift::transport::readAll(*trans, buf, len);
-  }
-
- protected:
-  TVirtualTransport() {}
-
-  /*
-   * Templatized constructors, to allow arguments to be passed to the Super_
-   * constructor.  Currently we only support 0, 1, or 2 arguments, but
-   * additional versions can be added as needed.
-   */
-  template <typename Arg_>
-  TVirtualTransport(Arg_ const& arg) : Super_(arg) { }
-
-  template <typename Arg1_, typename Arg2_>
-  TVirtualTransport(Arg1_ const& a1, Arg2_ const& a2) : Super_(a1, a2) { }
-};
-
-}}} // apache::thrift::transport
-
-#endif // #ifndef _THRIFT_TRANSPORT_TVIRTUALTRANSPORT_H_

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/d55608f1/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/thrift/transport/TZlibTransport.cpp
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/thrift/transport/TZlibTransport.cpp b/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/thrift/transport/TZlibTransport.cpp
deleted file mode 100644
index d77eedd..0000000
--- a/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/thrift/transport/TZlibTransport.cpp
+++ /dev/null
@@ -1,399 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#include <cassert>
-#include <cstring>
-#include <algorithm>
-#include <thrift/transport/TZlibTransport.h>
-
-using std::string;
-
-namespace apache { namespace thrift { namespace transport {
-
-// Don't call this outside of the constructor.
-void TZlibTransport::initZlib() {
-  int rv;
-  bool r_init = false;
-  try {
-    rstream_ = new z_stream;
-    wstream_ = new z_stream;
-
-    rstream_->zalloc = Z_NULL;
-    wstream_->zalloc = Z_NULL;
-    rstream_->zfree  = Z_NULL;
-    wstream_->zfree  = Z_NULL;
-    rstream_->opaque = Z_NULL;
-    wstream_->opaque = Z_NULL;
-
-    rstream_->next_in   = crbuf_;
-    wstream_->next_in   = uwbuf_;
-    rstream_->next_out  = urbuf_;
-    wstream_->next_out  = cwbuf_;
-    rstream_->avail_in  = 0;
-    wstream_->avail_in  = 0;
-    rstream_->avail_out = urbuf_size_;
-    wstream_->avail_out = cwbuf_size_;
-
-    rv = inflateInit(rstream_);
-    checkZlibRv(rv, rstream_->msg);
-
-    // Have to set this flag so we know whether to de-initialize.
-    r_init = true;
-
-    rv = deflateInit(wstream_, comp_level_);
-    checkZlibRv(rv, wstream_->msg);
-  }
-
-  catch (...) {
-    if (r_init) {
-      rv = inflateEnd(rstream_);
-      checkZlibRvNothrow(rv, rstream_->msg);
-    }
-    // There is no way we can get here if wstream_ was initialized.
-
-    throw;
-  }
-}
-
-inline void TZlibTransport::checkZlibRv(int status, const char* message) {
-  if (status != Z_OK) {
-    throw TZlibTransportException(status, message);
-  }
-}
-
-inline void TZlibTransport::checkZlibRvNothrow(int status, const char* message) {
-  if (status != Z_OK) {
-    string output = "TZlibTransport: zlib failure in destructor: " +
-      TZlibTransportException::errorMessage(status, message);
-    GlobalOutput(output.c_str());
-  }
-}
-
-TZlibTransport::~TZlibTransport() {
-  int rv;
-  rv = inflateEnd(rstream_);
-  checkZlibRvNothrow(rv, rstream_->msg);
-
-  rv = deflateEnd(wstream_);
-  // Z_DATA_ERROR may be returned if the caller has written data, but not
-  // called flush() to actually finish writing the data out to the underlying
-  // transport.  The defined TTransport behavior in this case is that this data
-  // may be discarded, so we ignore the error and silently discard the data.
-  // For other erros, log a message.
-  if (rv != Z_DATA_ERROR) {
-    checkZlibRvNothrow(rv, wstream_->msg);
-  }
-
-  delete[] urbuf_;
-  delete[] crbuf_;
-  delete[] uwbuf_;
-  delete[] cwbuf_;
-  delete rstream_;
-  delete wstream_;
-}
-
-bool TZlibTransport::isOpen() {
-  return (readAvail() > 0) || (rstream_->avail_in > 0) || transport_->isOpen();
-}
-
-bool TZlibTransport::peek() {
-  return (readAvail() > 0) || (rstream_->avail_in > 0) || transport_->peek();
-}
-
-
-
-// READING STRATEGY
-//
-// We have two buffers for reading: one containing the compressed data (crbuf_)
-// and one containing the uncompressed data (urbuf_).  When read is called,
-// we repeat the following steps until we have satisfied the request:
-// - Copy data from urbuf_ into the caller's buffer.
-// - If we had enough, return.
-// - If urbuf_ is empty, read some data into it from the underlying transport.
-// - Inflate data from crbuf_ into urbuf_.
-//
-// In standalone objects, we set input_ended_ to true when inflate returns
-// Z_STREAM_END.  This allows to make sure that a checksum was verified.
-
-inline int TZlibTransport::readAvail() {
-  return urbuf_size_ - rstream_->avail_out - urpos_;
-}
-
-uint32_t TZlibTransport::read(uint8_t* buf, uint32_t len) {
-  uint32_t need = len;
-
-  // TODO(dreiss): Skip urbuf on big reads.
-
-  while (true) {
-    // Copy out whatever we have available, then give them the min of
-    // what we have and what they want, then advance indices.
-    int give = std::min((uint32_t) readAvail(), need);
-    memcpy(buf, urbuf_ + urpos_, give);
-    need -= give;
-    buf += give;
-    urpos_ += give;
-
-    // If they were satisfied, we are done.
-    if (need == 0) {
-      return len;
-    }
-
-    // If we will need to read from the underlying transport to get more data,
-    // but we already have some data available, return it now.  Reading from
-    // the underlying transport may block, and read() is only allowed to block
-    // when no data is available.
-    if (need < len && rstream_->avail_in == 0) {
-      return len - need;
-    }
-
-    // If we get to this point, we need to get some more data.
-
-    // If zlib has reported the end of a stream, we can't really do any more.
-    if (input_ended_) {
-      return len - need;
-    }
-
-    // The uncompressed read buffer is empty, so reset the stream fields.
-    rstream_->next_out  = urbuf_;
-    rstream_->avail_out = urbuf_size_;
-    urpos_ = 0;
-
-    // Call inflate() to uncompress some more data
-    if (!readFromZlib()) {
-      // no data available from underlying transport
-      return len - need;
-    }
-
-    // Okay.  The read buffer should have whatever we can give it now.
-    // Loop back to the start and try to give some more.
-  }
-}
-
-bool TZlibTransport::readFromZlib() {
-  assert(!input_ended_);
-
-  // If we don't have any more compressed data available,
-  // read some from the underlying transport.
-  if (rstream_->avail_in == 0) {
-    uint32_t got = transport_->read(crbuf_, crbuf_size_);
-    if (got == 0) {
-      return false;
-    }
-    rstream_->next_in  = crbuf_;
-    rstream_->avail_in = got;
-  }
-
-  // We have some compressed data now.  Uncompress it.
-  int zlib_rv = inflate(rstream_, Z_SYNC_FLUSH);
-
-  if (zlib_rv == Z_STREAM_END) {
-    input_ended_ = true;
-  } else {
-    checkZlibRv(zlib_rv, rstream_->msg);
-  }
-
-  return true;
-}
-
-
-// WRITING STRATEGY
-//
-// We buffer up small writes before sending them to zlib, so our logic is:
-// - Is the write big?
-//   - Send the buffer to zlib.
-//   - Send this data to zlib.
-// - Is the write small?
-//   - Is there insufficient space in the buffer for it?
-//     - Send the buffer to zlib.
-//   - Copy the data to the buffer.
-//
-// We have two buffers for writing also: the uncompressed buffer (mentioned
-// above) and the compressed buffer.  When sending data to zlib we loop over
-// the following until the source (uncompressed buffer or big write) is empty:
-// - Is there no more space in the compressed buffer?
-//   - Write the compressed buffer to the underlying transport.
-// - Deflate from the source into the compressed buffer.
-
-void TZlibTransport::write(const uint8_t* buf, uint32_t len) {
-  if (output_finished_) {
-    throw TTransportException(TTransportException::BAD_ARGS,
-                              "write() called after finish()");
-  }
-
-  // zlib's "deflate" function has enough logic in it that I think
-  // we're better off (performance-wise) buffering up small writes.
-  if (len > MIN_DIRECT_DEFLATE_SIZE) {
-    flushToZlib(uwbuf_, uwpos_, Z_NO_FLUSH);
-    uwpos_ = 0;
-    flushToZlib(buf, len, Z_NO_FLUSH);
-  } else if (len > 0) {
-    if (uwbuf_size_ - uwpos_ < len) {
-      flushToZlib(uwbuf_, uwpos_, Z_NO_FLUSH);
-      uwpos_ = 0;
-    }
-    memcpy(uwbuf_ + uwpos_, buf, len);
-    uwpos_ += len;
-  }
-}
-
-void TZlibTransport::flush()  {
-  if (output_finished_) {
-    throw TTransportException(TTransportException::BAD_ARGS,
-                              "flush() called after finish()");
-  }
-
-  flushToTransport(Z_FULL_FLUSH);
-}
-
-void TZlibTransport::finish()  {
-  if (output_finished_) {
-    throw TTransportException(TTransportException::BAD_ARGS,
-                              "finish() called more than once");
-  }
-
-  flushToTransport(Z_FINISH);
-}
-
-void TZlibTransport::flushToTransport(int flush)  {
-  // write pending data in uwbuf_ to zlib
-  flushToZlib(uwbuf_, uwpos_, flush);
-  uwpos_ = 0;
-
-  // write all available data from zlib to the transport
-  transport_->write(cwbuf_, cwbuf_size_ - wstream_->avail_out);
-  wstream_->next_out = cwbuf_;
-  wstream_->avail_out = cwbuf_size_;
-
-  // flush the transport
-  transport_->flush();
-}
-
-void TZlibTransport::flushToZlib(const uint8_t* buf, int len, int flush) {
-  wstream_->next_in  = const_cast<uint8_t*>(buf);
-  wstream_->avail_in = len;
-
-  while (true) {
-    if (flush == Z_NO_FLUSH && wstream_->avail_in == 0) {
-      break;
-    }
-
-    // If our ouput buffer is full, flush to the underlying transport.
-    if (wstream_->avail_out == 0) {
-      transport_->write(cwbuf_, cwbuf_size_);
-      wstream_->next_out  = cwbuf_;
-      wstream_->avail_out = cwbuf_size_;
-    }
-
-    int zlib_rv = deflate(wstream_, flush);
-
-    if (flush == Z_FINISH && zlib_rv == Z_STREAM_END) {
-      assert(wstream_->avail_in == 0);
-      output_finished_ = true;
-      break;
-    }
-
-    checkZlibRv(zlib_rv, wstream_->msg);
-
-    if ((flush == Z_SYNC_FLUSH || flush == Z_FULL_FLUSH) &&
-        wstream_->avail_in == 0 && wstream_->avail_out != 0) {
-      break;
-    }
-  }
-}
-
-const uint8_t* TZlibTransport::borrow(uint8_t* buf, uint32_t* len) {
-  (void) buf;
-  // Don't try to be clever with shifting buffers.
-  // If we have enough data, give a pointer to it,
-  // otherwise let the protcol use its slow path.
-  if (readAvail() >= (int)*len) {
-    *len = (uint32_t)readAvail();
-    return urbuf_ + urpos_;
-  }
-  return NULL;
-}
-
-void TZlibTransport::consume(uint32_t len) {
-  if (readAvail() >= (int)len) {
-    urpos_ += len;
-  } else {
-    throw TTransportException(TTransportException::BAD_ARGS,
-                              "consume did not follow a borrow.");
-  }
-}
-
-void TZlibTransport::verifyChecksum() {
-  // If zlib has already reported the end of the stream,
-  // it has verified the checksum.
-  if (input_ended_) {
-    return;
-  }
-
-  // This should only be called when reading is complete.
-  // If the caller still has unread data, throw an exception.
-  if (readAvail() > 0) {
-    throw TTransportException(
-        TTransportException::CORRUPTED_DATA,
-        "verifyChecksum() called before end of zlib stream");
-  }
-
-  // Reset the rstream fields, in case avail_out is 0.
-  // (Since readAvail() is 0, we know there is no unread data in urbuf_)
-  rstream_->next_out  = urbuf_;
-  rstream_->avail_out = urbuf_size_;
-  urpos_ = 0;
-
-  // Call inflate()
-  // This will throw an exception if the checksum is bad.
-  bool performed_inflate = readFromZlib();
-  if (!performed_inflate) {
-    // We needed to read from the underlying transport, and the read() call
-    // returned 0.
-    //
-    // Not all TTransport implementations behave the same way here, so we'll
-    // end up with different behavior depending on the underlying transport.
-    //
-    // For some transports (e.g., TFDTransport), read() blocks if no more data
-    // is available.  They only return 0 if EOF has been reached, or if the
-    // remote endpoint has closed the connection.  For those transports,
-    // verifyChecksum() will block until the checksum becomes available.
-    //
-    // Other transport types (e.g., TMemoryBuffer) always return 0 immediately
-    // if no more data is available.  For those transport types, verifyChecksum
-    // will raise the following exception if the checksum is not available from
-    // the underlying transport yet.
-    throw TTransportException(TTransportException::CORRUPTED_DATA,
-                              "checksum not available yet in "
-                              "verifyChecksum()");
-  }
-
-  // If input_ended_ is true now, the checksum has been verified
-  if (input_ended_) {
-    return;
-  }
-
-  // The caller invoked us before the actual end of the data stream
-  assert(rstream_->avail_out < urbuf_size_);
-  throw TTransportException(TTransportException::CORRUPTED_DATA,
-                            "verifyChecksum() called before end of "
-                            "zlib stream");
-}
-
-
-}}} // apache::thrift::transport

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/d55608f1/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/thrift/transport/TZlibTransport.h
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/thrift/transport/TZlibTransport.h b/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/thrift/transport/TZlibTransport.h
deleted file mode 100644
index dd9dd14..0000000
--- a/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/thrift/transport/TZlibTransport.h
+++ /dev/null
@@ -1,249 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#ifndef _THRIFT_TRANSPORT_TZLIBTRANSPORT_H_
-#define _THRIFT_TRANSPORT_TZLIBTRANSPORT_H_ 1
-
-#include <boost/lexical_cast.hpp>
-#include <thrift/transport/TTransport.h>
-#include <thrift/transport/TVirtualTransport.h>
-#include <zlib.h>
-
-struct z_stream_s;
-
-namespace apache { namespace thrift { namespace transport {
-
-class TZlibTransportException : public TTransportException {
- public:
-  TZlibTransportException(int status, const char* msg) :
-    TTransportException(TTransportException::INTERNAL_ERROR,
-                        errorMessage(status, msg)),
-    zlib_status_(status),
-    zlib_msg_(msg == NULL ? "(null)" : msg) {}
-
-  virtual ~TZlibTransportException() throw() {}
-
-  int getZlibStatus() { return zlib_status_; }
-  std::string getZlibMessage() { return zlib_msg_; }
-
-  static std::string errorMessage(int status, const char* msg) {
-    std::string rv = "zlib error: ";
-    if (msg) {
-      rv += msg;
-    } else {
-      rv += "(no message)";
-    }
-    rv += " (status = ";
-    rv += boost::lexical_cast<std::string>(status);
-    rv += ")";
-    return rv;
-  }
-
-  int zlib_status_;
-  std::string zlib_msg_;
-};
-
-/**
- * This transport uses zlib to compress on write and decompress on read 
- *
- * TODO(dreiss): Don't do an extra copy of the compressed data if
- *               the underlying transport is TBuffered or TMemory.
- *
- */
-class TZlibTransport : public TVirtualTransport<TZlibTransport> {
- public:
- 
-  /**
-   * @param transport    The transport to read compressed data from
-   *                     and write compressed data to.
-   * @param urbuf_size   Uncompressed buffer size for reading.
-   * @param crbuf_size   Compressed buffer size for reading.
-   * @param uwbuf_size   Uncompressed buffer size for writing.
-   * @param cwbuf_size   Compressed buffer size for writing.
-   * @param comp_level   Compression level (0=none[fast], 6=default, 9=max[slow]).
-   */
-  TZlibTransport(boost::shared_ptr<TTransport> transport,
-                 int urbuf_size = DEFAULT_URBUF_SIZE,
-                 int crbuf_size = DEFAULT_CRBUF_SIZE,
-                 int uwbuf_size = DEFAULT_UWBUF_SIZE,
-                 int cwbuf_size = DEFAULT_CWBUF_SIZE,
-                 int16_t comp_level = Z_DEFAULT_COMPRESSION) :
-    transport_(transport),
-    urpos_(0),
-    uwpos_(0),
-    input_ended_(false),
-    output_finished_(false),
-    urbuf_size_(urbuf_size),
-    crbuf_size_(crbuf_size),
-    uwbuf_size_(uwbuf_size),
-    cwbuf_size_(cwbuf_size),
-    urbuf_(NULL),
-    crbuf_(NULL),
-    uwbuf_(NULL),
-    cwbuf_(NULL),
-    rstream_(NULL),
-    wstream_(NULL),
-    comp_level_(comp_level)
-  {
-    if (uwbuf_size_ < MIN_DIRECT_DEFLATE_SIZE) {
-      // Have to copy this into a local because of a linking issue.
-      int minimum = MIN_DIRECT_DEFLATE_SIZE;
-      throw TTransportException(
-          TTransportException::BAD_ARGS,
-          "TZLibTransport: uncompressed write buffer must be at least"
-          + boost::lexical_cast<std::string>(minimum) + ".");
-    }
-
-    try {
-      urbuf_ = new uint8_t[urbuf_size];
-      crbuf_ = new uint8_t[crbuf_size];
-      uwbuf_ = new uint8_t[uwbuf_size];
-      cwbuf_ = new uint8_t[cwbuf_size];
-
-      // Don't call this outside of the constructor.
-      initZlib();
-
-    } catch (...) {
-      delete[] urbuf_;
-      delete[] crbuf_;
-      delete[] uwbuf_;
-      delete[] cwbuf_;
-      throw;
-    }
-  }
-
-  // Don't call this outside of the constructor.
-  void initZlib();
-
-  /**
-   * TZlibTransport destructor.
-   *
-   * Warning: Destroying a TZlibTransport object may discard any written but
-   * unflushed data.  You must explicitly call flush() or finish() to ensure
-   * that data is actually written and flushed to the underlying transport.
-   */
-  ~TZlibTransport();
-
-  bool isOpen();
-  bool peek();
-
-  void open() {
-    transport_->open();
-  }
-
-  void close() {
-    transport_->close();
-  }
-
-  uint32_t read(uint8_t* buf, uint32_t len);
-
-  void write(const uint8_t* buf, uint32_t len);
-
-  void flush();
-
-  /**
-   * Finalize the zlib stream.
-   *
-   * This causes zlib to flush any pending write data and write end-of-stream
-   * information, including the checksum.  Once finish() has been called, no
-   * new data can be written to the stream.
-   */
-  void finish();
-
-  const uint8_t* borrow(uint8_t* buf, uint32_t* len);
-
-  void consume(uint32_t len);
-
-  /**
-   * Verify the checksum at the end of the zlib stream.
-   *
-   * This may only be called after all data has been read.
-   * It verifies the checksum that was written by the finish() call.
-   */
-  void verifyChecksum();
-
-   /**
-    * TODO(someone_smart): Choose smart defaults.
-    */
-  static const int DEFAULT_URBUF_SIZE = 128;
-  static const int DEFAULT_CRBUF_SIZE = 1024;
-  static const int DEFAULT_UWBUF_SIZE = 128;
-  static const int DEFAULT_CWBUF_SIZE = 1024;
-
- protected:
-
-  inline void checkZlibRv(int status, const char* msg);
-  inline void checkZlibRvNothrow(int status, const char* msg);
-  inline int readAvail();
-  void flushToTransport(int flush);
-  void flushToZlib(const uint8_t* buf, int len, int flush);
-  bool readFromZlib();
-
- protected:
-  // Writes smaller than this are buffered up.
-  // Larger (or equal) writes are dumped straight to zlib.
-  static const uint32_t MIN_DIRECT_DEFLATE_SIZE = 32;
-
-  boost::shared_ptr<TTransport> transport_;
-
-  int urpos_;
-  int uwpos_;
-
-  /// True iff zlib has reached the end of the input stream.
-  bool input_ended_;
-  /// True iff we have finished the output stream.
-  bool output_finished_;
-
-  uint32_t urbuf_size_;
-  uint32_t crbuf_size_;
-  uint32_t uwbuf_size_;
-  uint32_t cwbuf_size_;
-
-  uint8_t* urbuf_;
-  uint8_t* crbuf_;
-  uint8_t* uwbuf_;
-  uint8_t* cwbuf_;
-
-  struct z_stream_s* rstream_;
-  struct z_stream_s* wstream_;
-
-  const int comp_level_;
-};
-
-
-/**
- * Wraps a transport into a zlibbed one.
- *
- */
-class TZlibTransportFactory : public TTransportFactory {
- public:
-  TZlibTransportFactory() {}
-
-  virtual ~TZlibTransportFactory() {}
-
-  virtual boost::shared_ptr<TTransport> getTransport(
-                                         boost::shared_ptr<TTransport> trans) {
-    return boost::shared_ptr<TTransport>(new TZlibTransport(trans));
-  }
-};
-
-
-}}} // apache::thrift::transport
-
-#endif // #ifndef _THRIFT_TRANSPORT_TZLIBTRANSPORT_H_

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/d55608f1/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/thrift/windows/GetTimeOfDay.cpp
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/thrift/windows/GetTimeOfDay.cpp b/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/thrift/windows/GetTimeOfDay.cpp
deleted file mode 100644
index 1906302..0000000
--- a/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/thrift/windows/GetTimeOfDay.cpp
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#include <thrift/windows/GetTimeOfDay.h>
-#include <thrift/thrift-config.h>
-
-// win32
-#include <time.h>
-
-#if defined(_MSC_VER) || defined(_MSC_EXTENSIONS)
-#   define DELTA_EPOCH_IN_MICROSECS  11644473600000000Ui64
-#else
-#   define DELTA_EPOCH_IN_MICROSECS  11644473600000000ULL
-#endif
-
-struct timezone
-{
-    int  tz_minuteswest; /* minutes W of Greenwich */
-    int  tz_dsttime;     /* type of dst correction */
-};
-
-int thrift_gettimeofday(struct timeval * tv, struct timezone * tz)
-{
-    FILETIME         ft;
-    unsigned __int64 tmpres(0);
-    static int       tzflag;
-
-    if (NULL != tv)
-    {
-        GetSystemTimeAsFileTime(&ft);
-
-        tmpres |= ft.dwHighDateTime;
-        tmpres <<= 32;
-        tmpres |= ft.dwLowDateTime;
-
-        /*converting file time to unix epoch*/
-        tmpres -= DELTA_EPOCH_IN_MICROSECS;
-        tmpres /= 10;  /*convert into microseconds*/
-        tv->tv_sec = (long)(tmpres / 1000000UL);
-        tv->tv_usec = (long)(tmpres % 1000000UL);
-    }
-
-    if (NULL != tz)
-    {
-        if (!tzflag)
-        {
-            _tzset();
-            tzflag++;
-        }
-
-        long time_zone(0);
-        errno_t err(_get_timezone(&time_zone));
-        if (err == NO_ERROR)
-        {
-            tz->tz_minuteswest = time_zone / 60;
-        }
-        else
-        {
-            return -1;
-        }
-
-        int day_light(0);
-        err = (_get_daylight(&day_light));
-        if (err == NO_ERROR)
-        {
-            tz->tz_dsttime = day_light;
-            return 0;
-        }
-        else
-        {
-            return -1;
-        }
-    }
-
-    return -1;
-}
-
-int thrift_sleep(unsigned int seconds)
-{
-  ::Sleep(seconds * 1000);
-  return 0;
-}
-int thrift_usleep(unsigned int microseconds)
-{
-  unsigned int milliseconds = (microseconds + 999)/ 1000;
-  ::Sleep(milliseconds);
-  return 0;
-}
-
-char *thrift_ctime_r(const time_t *_clock, char *_buf)
-{
-   strcpy(_buf, ctime(_clock));
-   return _buf;
-}
-
-

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/d55608f1/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/thrift/windows/GetTimeOfDay.h
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/thrift/windows/GetTimeOfDay.h b/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/thrift/windows/GetTimeOfDay.h
deleted file mode 100644
index 27b8a84..0000000
--- a/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/thrift/windows/GetTimeOfDay.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#ifndef _THRIFT_WINDOWS_GETTIMEOFDAY_H_
-#define _THRIFT_WINDOWS_GETTIMEOFDAY_H_
-
-#if defined(_MSC_VER) && (_MSC_VER > 1200)
-#pragma once
-#endif // _MSC_VER
-
-#ifndef _WIN32
-#error This is a MSVC header only.
-#endif
-
-#include <thrift/thrift-config.h>
-
-struct thrift_timespec {
-  int64_t tv_sec;
-  int64_t tv_nsec;
-};
-
-int thrift_gettimeofday(struct timeval * tv, struct timezone * tz);
-int thrift_sleep(unsigned int seconds);
-int thrift_usleep(unsigned int micro_seconds);
-char *thrift_ctime_r(const time_t *_clock, char *_buf);
-
-#endif // _THRIFT_WINDOWS_GETTIMEOFDAY_H_

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/d55608f1/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/thrift/windows/Operators.h
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/thrift/windows/Operators.h b/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/thrift/windows/Operators.h
deleted file mode 100644
index 95d8e3e..0000000
--- a/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/thrift/windows/Operators.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#ifndef _THRIFT_WINDOWS_OPERATORS_H_
-#define _THRIFT_WINDOWS_OPERATORS_H_
-
-#if defined(_MSC_VER) && (_MSC_VER > 1200)
-#pragma once
-#endif // _MSC_VER
-
-namespace apache { namespace thrift {
-
-class TEnumIterator;
-
-inline bool operator == (const TEnumIterator&, const TEnumIterator&)
-{
-    // Not entirely sure what the test should be here. It is only to enable
-    // iterator debugging and is not used in release mode.
-    return true;
-}
-
-}} // apache::thrift
-
-#endif // _THRIFT_WINDOWS_OPERATORS_H_

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/d55608f1/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/thrift/windows/SocketPair.cpp
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/thrift/windows/SocketPair.cpp b/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/thrift/windows/SocketPair.cpp
deleted file mode 100644
index 4b65e6b..0000000
--- a/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/thrift/windows/SocketPair.cpp
+++ /dev/null
@@ -1,102 +0,0 @@
-/* socketpair.c
- * Copyright 2007 by Nathan C. Myers <ncm@cantrip.org>; some rights reserved.
- * This code is Free Software.  It may be copied freely, in original or
- * modified form, subject only to the restrictions that (1) the author is
- * relieved from all responsibilities for any use for any purpose, and (2)
- * this copyright notice must be retained, unchanged, in its entirety.  If
- * for any reason the author might be held responsible for any consequences
- * of copying or use, license is withheld.
- */
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#include <thrift/windows/SocketPair.h>
-#include <thrift/Thrift.h>
-
-// stl
-#include <string.h>
-
-// Win32
-#include <WS2tcpip.h>
-
-int thrift_socketpair(int d, int type, int protocol, THRIFT_SOCKET sv[2])
-{
-    THRIFT_UNUSED_VARIABLE(protocol);
-    THRIFT_UNUSED_VARIABLE(type);
-    THRIFT_UNUSED_VARIABLE(d);
-
-    union {
-       struct sockaddr_in inaddr;
-       struct sockaddr addr;
-    } a;
-    THRIFT_SOCKET listener;
-    int e;
-    socklen_t addrlen = sizeof(a.inaddr);
-    DWORD flags = 0;
-    int reuse = 1;
-
-    if (sv == 0) {
-      WSASetLastError(WSAEINVAL);
-      return SOCKET_ERROR;
-    }
-
-    listener = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
-    if (listener == INVALID_SOCKET)
-        return SOCKET_ERROR;
-
-    memset(&a, 0, sizeof(a));
-    a.inaddr.sin_family = AF_INET;
-    a.inaddr.sin_addr.s_addr = htonl(INADDR_LOOPBACK);
-    a.inaddr.sin_port = 0;
-
-    sv[0] = sv[1] = INVALID_SOCKET;
-    do {
-        //ignore errors coming out of this setsockopt.  This is because
-        //SO_EXCLUSIVEADDRUSE requires admin privileges on WinXP, but we don't
-        //want to force socket pairs to be an admin.
-        setsockopt(listener, SOL_SOCKET, SO_EXCLUSIVEADDRUSE,
-               (char*) &reuse, (socklen_t) sizeof(reuse));
-        if  (bind(listener, &a.addr, sizeof(a.inaddr)) == SOCKET_ERROR)
-            break;
-        if  (getsockname(listener, &a.addr, &addrlen) == SOCKET_ERROR)
-            break;
-        if (listen(listener, 1) == SOCKET_ERROR)
-            break;
-        sv[0] = WSASocket(AF_INET, SOCK_STREAM, 0, NULL, 0, flags);
-        if (sv[0] == INVALID_SOCKET)
-            break;
-        if (connect(sv[0], &a.addr, sizeof(a.inaddr)) == SOCKET_ERROR)
-            break;
-        sv[1] = accept(listener, NULL, NULL);
-        if (sv[1] == INVALID_SOCKET)
-            break;
-
-        closesocket(listener);
-        return 0;
-
-    } while (0);
-
-    e = WSAGetLastError();
-    closesocket(listener);
-    closesocket(sv[0]);
-    closesocket(sv[1]);
-    WSASetLastError(e);
-    return SOCKET_ERROR;
-}

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/d55608f1/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/thrift/windows/SocketPair.h
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/thrift/windows/SocketPair.h b/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/thrift/windows/SocketPair.h
deleted file mode 100644
index 86bf431..0000000
--- a/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/thrift/windows/SocketPair.h
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#ifndef _THRIFT_WINDOWS_SOCKETPAIR_H_
-#define _THRIFT_WINDOWS_SOCKETPAIR_H_ 1
-
-#if defined(_MSC_VER) && (_MSC_VER > 1200)
-#pragma once
-#endif // _MSC_VER
-
-#ifndef _WIN32
-#error This is a MSVC header only.
-#endif
-
-// Win32
-#include <Winsock2.h>
-#include <thrift/thrift-config.h>
-
-int thrift_socketpair(int d, int type, int protocol, THRIFT_SOCKET sv[2]);
-
-#endif // _THRIFT_WINDOWS_SOCKETPAIR_H_

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/d55608f1/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/thrift/windows/StdAfx.cpp
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/thrift/windows/StdAfx.cpp b/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/thrift/windows/StdAfx.cpp
deleted file mode 100644
index e69de29..0000000

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/d55608f1/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/thrift/windows/StdAfx.h
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/thrift/windows/StdAfx.h b/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/thrift/windows/StdAfx.h
deleted file mode 100644
index e69de29..0000000

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/d55608f1/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/thrift/windows/TWinsockSingleton.cpp
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/thrift/windows/TWinsockSingleton.cpp b/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/thrift/windows/TWinsockSingleton.cpp
deleted file mode 100644
index 2e306c6..0000000
--- a/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/thrift/windows/TWinsockSingleton.cpp
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#include <thrift/windows/TWinsockSingleton.h>
-
-// boost
-#include <boost/assert.hpp>
-#include <stdexcept>
-
-namespace apache { namespace thrift { namespace transport {
-
-TWinsockSingleton::instance_ptr TWinsockSingleton::instance_ptr_(NULL);
-#if USE_BOOST_THREAD
-boost::once_flag                TWinsockSingleton::flags_ = BOOST_ONCE_INIT;
-#elif USE_STD_THREAD
-std::once_flag                  TWinsockSingleton::flags_;
-#else
-#error For windows you must choose USE_BOOST_THREAD or USE_STD_THREAD
-#endif
-
-//------------------------------------------------------------------------------
-TWinsockSingleton::TWinsockSingleton(void)
-{
-    WORD    version(MAKEWORD(2, 2));
-    WSAData data = {0};
-
-    int error(WSAStartup(version, &data));
-    if (error != 0)
-    {
-        BOOST_ASSERT(false);
-        throw std::runtime_error("Failed to initialise Winsock.");
-    }
-}
-
-//------------------------------------------------------------------------------
-TWinsockSingleton::~TWinsockSingleton(void)
-{
-    WSACleanup();
-}
-
-//------------------------------------------------------------------------------
-void TWinsockSingleton::create(void)
-{
-#if USE_BOOST_THREAD
-    boost::call_once(init, flags_);
-#elif USE_STD_THREAD
-    std::call_once(flags_, init);
-#endif
-}
-
-//------------------------------------------------------------------------------
-void TWinsockSingleton::init(void)
-{
-    instance_ptr_.reset(new TWinsockSingleton);
-}
-
-}}} // apache::thrift::transport

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/d55608f1/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/thrift/windows/TWinsockSingleton.h
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/thrift/windows/TWinsockSingleton.h b/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/thrift/windows/TWinsockSingleton.h
deleted file mode 100644
index ab12c22..0000000
--- a/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/thrift/windows/TWinsockSingleton.h
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#ifndef _THRIFT_TRANSPORT_WINDOWS_TWINSOCKSINGLETON_H_
-#define _THRIFT_TRANSPORT_WINDOWS_TWINSOCKSINGLETON_H_ 1
-
-#if defined(_MSC_VER) && (_MSC_VER > 1200)
-#pragma once
-#endif // _MSC_VER
-
-#ifndef _WIN32
-#error This is a MSVC header only.
-#endif
-
-#include <thrift/thrift-config.h>
-
-// boost
-#include <boost/noncopyable.hpp>
-#include <boost/scoped_ptr.hpp>
-
-#if USE_BOOST_THREAD
-#include <boost/thread/once.hpp>
-#elif USE_STD_THREAD
-#include <mutex>
-#else
-#error For windows you must choose USE_BOOST_THREAD or USE_STD_THREAD
-#endif
-
-namespace apache { namespace thrift { namespace transport {
-
-/**
- * Winsock2 must be intialised once only in order to create sockets. This class
- * performs a one time initialisation when create is called.
- */
-class TWinsockSingleton : private boost::noncopyable
-{
-
-public:
-
-    typedef boost::scoped_ptr<TWinsockSingleton> instance_ptr;
-
-private:
-
-    TWinsockSingleton(void);
-
-public:
-
-    ~TWinsockSingleton(void);
-
-public:
-
-    static void create(void);
-
-private:
-
-    static void init(void);
-
-private:
-
-    static instance_ptr     instance_ptr_;
-#if USE_BOOST_THREAD
-    static boost::once_flag flags_;
-#elif USE_STD_THREAD
-    static std::once_flag flags_;
-#else
-#error Need a non-Boost non-C++11 way to track single initialization here.
-#endif
-};
-
-}}} // apache::thrift::transport
-
-#endif // _THRIFT_TRANSPORT_WINDOWS_TWINSOCKSINGLETON_H_

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/d55608f1/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/thrift/windows/TargetVersion.h
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/thrift/windows/TargetVersion.h b/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/thrift/windows/TargetVersion.h
deleted file mode 100644
index e69de29..0000000

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/d55608f1/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/thrift/windows/WinFcntl.cpp
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/thrift/windows/WinFcntl.cpp b/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/thrift/windows/WinFcntl.cpp
deleted file mode 100644
index 2466400..0000000
--- a/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/thrift/windows/WinFcntl.cpp
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#include <thrift/windows/WinFcntl.h>
-
-int thrift_fcntl(THRIFT_SOCKET fd, int cmd, int flags)
-{
-    if(cmd != THRIFT_F_GETFL && cmd != THRIFT_F_SETFL)
-    {
-        return -1;
-    }
-
-    if(flags != THRIFT_O_NONBLOCK && flags != 0)
-    {
-        return -1;
-    }
-
-    if(cmd == THRIFT_F_GETFL)
-    {
-        return 0;
-    }
-
-    int res;
-    if(flags)
-    {
-        res = ioctlsocket(fd, FIONBIO, reinterpret_cast<u_long *>(&(flags = 1)));
-    }
-    else
-    {
-        res = ioctlsocket(fd, FIONBIO, reinterpret_cast<u_long *>(&(flags = 0)));
-    }
-
-    return res;
-}
-
-#if WINVER <= 0x0502 //XP, Server2003
-int thrift_poll(THRIFT_POLLFD *fdArray, ULONG nfds, INT timeout)
-{
-  fd_set read_fds, write_fds;
-  fd_set* read_fds_ptr  = NULL;
-  fd_set* write_fds_ptr = NULL;
-
-  FD_ZERO(&read_fds);
-  FD_ZERO(&write_fds);
-
-  for(ULONG i=0; i<nfds; i++) {
-    //Read (in) socket
-    if((fdArray[i].events & THRIFT_POLLIN) == THRIFT_POLLIN) {
-      read_fds_ptr = &read_fds;
-      FD_SET(fdArray[i].fd, &read_fds);
-    }
-    //Write (out) socket
-    else if((fdArray[i].events & THRIFT_POLLOUT) == THRIFT_POLLOUT) {
-      write_fds_ptr = &write_fds;
-      FD_SET(fdArray[i].fd, &write_fds);
-    }
-  }
-
-  timeval time_out;
-  timeval* time_out_ptr = NULL;
-  if(timeout >= 0) {
-    timeval time_out = {timeout / 1000, timeout * 1000};
-    time_out_ptr = &time_out;
-  }
-  else { //to avoid compiler warnings
-    (void)time_out;
-    (void)timeout;
-  }
-
-  int sktready = select(1, read_fds_ptr, write_fds_ptr, NULL, time_out_ptr);
-  if(sktready > 0) {
-    for(ULONG i=0; i<nfds; i++) {
-      fdArray[i].revents = 0;
-      if(FD_ISSET(fdArray[i].fd, &read_fds))
-        fdArray[i].revents |= THRIFT_POLLIN;
-      if(FD_ISSET(fdArray[i].fd, &write_fds))
-        fdArray[i].revents |= THRIFT_POLLOUT;
-    }
-  }
-  return sktready;
-}
-#else //Vista, Win7...
-int thrift_poll(THRIFT_POLLFD *fdArray, ULONG nfds, INT timeout)
-{
-  return WSAPoll(fdArray, nfds, timeout);
-}
-#endif // WINVER
-

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/d55608f1/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/thrift/windows/WinFcntl.h
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/thrift/windows/WinFcntl.h b/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/thrift/windows/WinFcntl.h
deleted file mode 100644
index f30c0de..0000000
--- a/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/thrift/windows/WinFcntl.h
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#ifndef _THRIFT_WINDOWS_FCNTL_H_
-#define _THRIFT_WINDOWS_FCNTL_H_ 1
-
-#if defined(_MSC_VER) && (_MSC_VER > 1200)
-#pragma once
-#endif // _MSC_VER
-
-#ifndef _WIN32
-#error This is a MSVC header only.
-#endif
-
-// Win32
-#include <Winsock2.h>
-#include <thrift/transport/PlatformSocket.h>
-
-#if WINVER <= 0x0502 //XP, Server2003
-struct thrift_pollfd {
-  THRIFT_SOCKET  fd;
-  SHORT   events;
-  SHORT   revents;
-};
-#endif
-
-extern "C" {
-int thrift_fcntl(THRIFT_SOCKET fd, int cmd, int flags);
-int thrift_poll(THRIFT_POLLFD *fdArray, ULONG nfds, INT timeout);
-}
-
-#endif // _THRIFT_WINDOWS_FCNTL_H_

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/d55608f1/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/thrift/windows/config.h
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/thrift/windows/config.h b/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/thrift/windows/config.h
deleted file mode 100644
index 0555e07..0000000
--- a/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/thrift/windows/config.h
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#ifndef _THRIFT_WINDOWS_CONFIG_H_
-#define _THRIFT_WINDOWS_CONFIG_H_ 1
-
-#if defined(_MSC_VER) && (_MSC_VER > 1200)
-#pragma once
-#endif // _MSC_VER
-
-#ifndef _WIN32
-#error This is a MSVC header only.
-#endif
-
-// use std::thread in MSVC11 (2012) or newer
-#if _MSC_VER >= 1700
-#  define USE_STD_THREAD 1
-// otherwise use boost threads
-#else
-#  define USE_BOOST_THREAD 1
-#endif
-
-#ifndef TARGET_WIN_XP
-#  define TARGET_WIN_XP 1
-#endif
-
-#if TARGET_WIN_XP
-#  ifndef WINVER
-#    define WINVER 0x0501
-#  endif
-#  ifndef _WIN32_WINNT
-#    define _WIN32_WINNT 0x0501
-#  endif
-#endif
-
-#ifndef _WIN32_WINNT
-#  define _WIN32_WINNT 0x0601
-#endif
-
-#pragma warning(disable: 4996) // Deprecated posix name.
-
-#define VERSION "1.0.0-dev"
-#define HAVE_GETTIMEOFDAY 1
-#define HAVE_SYS_STAT_H 1
-
-#ifdef HAVE_STDINT_H
-#  include <stdint.h>
-#else
-#  include <boost/cstdint.hpp>
-
-typedef boost::int64_t    int64_t;
-typedef boost::uint64_t  uint64_t;
-typedef boost::int32_t    int32_t;
-typedef boost::uint32_t  uint32_t;
-typedef boost::int16_t    int16_t;
-typedef boost::uint16_t  uint16_t;
-typedef boost::int8_t      int8_t;
-typedef boost::uint8_t    uint8_t;
-#endif
-
-#include <thrift/transport/PlatformSocket.h>
-#include <thrift/windows/GetTimeOfDay.h>
-#include <thrift/windows/Operators.h>
-#include <thrift/windows/TWinsockSingleton.h>
-#include <thrift/windows/WinFcntl.h>
-#include <thrift/windows/SocketPair.h>
-
-// windows
-#include <Winsock2.h>
-#include <ws2tcpip.h>
-#pragma comment(lib, "Ws2_32.lib")
-#pragma comment(lib, "advapi32.lib") //For security APIs in TPipeServer
-
-#endif // _THRIFT_WINDOWS_CONFIG_H_

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/d55608f1/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/thrift/windows/force_inc.h
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/thrift/windows/force_inc.h b/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/thrift/windows/force_inc.h
deleted file mode 100644
index e69de29..0000000

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/d55608f1/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/thrift/windows/tr1/functional
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/thrift/windows/tr1/functional b/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/thrift/windows/tr1/functional
deleted file mode 100644
index e69de29..0000000

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/d55608f1/airavata-api/airavata-client-sdks/airavata-php-sdk/pom.xml
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-client-sdks/airavata-php-sdk/pom.xml b/airavata-api/airavata-client-sdks/airavata-php-sdk/pom.xml
deleted file mode 100644
index 4a78d25..0000000
--- a/airavata-api/airavata-client-sdks/airavata-php-sdk/pom.xml
+++ /dev/null
@@ -1,111 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!--Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file 
-    distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under 
-    the Apache License, Version 2.0 (theÏ "License"); you may not use this file except in compliance with the License. You may 
-    obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to 
-    in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF 
-    ANY ~ KIND, either express or implied. See the License for the specific language governing permissions and limitations under 
-    the License. -->
-
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-    <parent>
-        <groupId>org.apache.airavata</groupId>
-        <artifactId>airavata-client-sdks</artifactId>
-        <version>0.17-SNAPSHOT</version>
-        <relativePath>../pom.xml</relativePath>
-    </parent>
-
-    <modelVersion>4.0.0</modelVersion>
-    <artifactId>apache-airavata-client-php-sdk</artifactId>
-    <name>Apache Airavata PHP SDK</name>
-    <packaging>pom</packaging>
-    <url>http://airavata.apache.org/</url>
-
-    <build>
-        <plugins>
-	    <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-dependency-plugin</artifactId>
-                <version>2.8</version>
-                <executions>
-                    <execution>
-                        <id>unpack</id>
-                        <phase>compile</phase>
-                        <goals>
-                            <goal>unpack</goal>
-                        </goals>
-                        <configuration>
-                            <artifactItems>
-                                <artifactItem>
-                                    <groupId>org.apache.airavata</groupId>
-                                    <artifactId>airavata-client-configuration</artifactId>
-                                    <version>${project.version}</version>
-                                    <type>jar</type>
-                                </artifactItem>
-                            </artifactItems>
-                            <outputDirectory>${project.build.directory}/conf</outputDirectory>
-                        </configuration>
-                    </execution>
-                </executions>
-            </plugin>
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-assembly-plugin</artifactId>
-                <executions>
-                    <execution>
-                        <id>distribution-package</id>
-                        <phase>package</phase>
-                        <goals>
-                            <goal>single</goal>
-                        </goals>
-                        <configuration>
-                            <finalName>${archive.name}-${project.version}</finalName>
-                            <descriptors>
-                                <descriptor>src/main/assembly/bin-assembly.xml</descriptor>
-                            </descriptors>
-                            <attach>false</attach>
-                        </configuration>
-                    </execution>
-                </executions>
-            </plugin>
-            <plugin>
-                <groupId>org.codehaus.mojo</groupId>
-                <artifactId>build-helper-maven-plugin</artifactId>
-                <version>1.7</version>
-                <executions>
-                    <execution>
-                        <id>attach-artifacts</id>
-                        <phase>package</phase>
-                        <goals>
-                            <goal>attach-artifact</goal>
-                        </goals>
-                        <configuration>
-                            <artifacts>
-                                <artifact>
-                                    <file>${airavata.client-bin.zip}</file>
-                                    <type>zip</type>
-                                    <classifier>bin</classifier>
-                                </artifact>
-                                <artifact>
-                                    <file>${airavata.client-bin.tar.gz}</file>
-                                    <type>tar.gz</type>
-                                    <classifier>bin</classifier>
-                                </artifact>
-                            </artifacts>
-                        </configuration>
-                    </execution>
-                </executions>
-            </plugin>
-        </plugins>
-    </build>
-
-    
-    <properties>
-        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
-        <archive.name>apache-airavata-php-sdk</archive.name>
-        <airavata.client-dist.name>${archive.name}-${project.version}</airavata.client-dist.name>
-        <airavata.client-bin.zip>${project.build.directory}/${airavata.client-dist.name}-bin.zip</airavata.client-bin.zip>
-        <airavata.client-bin.tar.gz>${project.build.directory}/${airavata.client-dist.name}-bin.tar.gz</airavata.client-bin.tar.gz>
-    </properties>
-</project>

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/d55608f1/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/assembly/bin-assembly.xml
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/assembly/bin-assembly.xml b/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/assembly/bin-assembly.xml
deleted file mode 100644
index 12a7555..0000000
--- a/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/assembly/bin-assembly.xml
+++ /dev/null
@@ -1,64 +0,0 @@
-<!--Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file 
-    distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under 
-    the Apache License, Version 2.0 (theÏ "License"); you may not use this file except in compliance with the License. You may 
-    obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to 
-    in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF 
-    ANY ~ KIND, either express or implied. See the License for the specific language governing permissions and limitations under 
-    the License. -->
-	
-<!DOCTYPE assembly [
-        <!ELEMENT assembly (id|includeBaseDirectory|baseDirectory|formats|fileSets|dependencySets)*>
-        <!ELEMENT id (#PCDATA)>
-        <!ELEMENT includeBaseDirectory (#PCDATA)>
-        <!ELEMENT baseDirectory (#PCDATA)>
-        <!ELEMENT formats (format)*>
-        <!ELEMENT format (#PCDATA)>
-        <!ELEMENT fileSets (fileSet)*>
-        <!ELEMENT fileSet (directory|outputDirectory|includes)*>
-        <!ELEMENT directory (#PCDATA)>
-        <!ELEMENT outputDirectory (#PCDATA)>
-        <!ELEMENT includes (include)*>
-        <!ELEMENT include (#PCDATA)>
-        <!ELEMENT dependencySets (dependencySet)*>
-        <!ELEMENT dependencySet (outputDirectory|includes)*>
-        ]>
-<assembly>
-    <id>bin</id>
-    <includeBaseDirectory>false</includeBaseDirectory>
-    <baseDirectory>${archive.name}-${version}</baseDirectory>
-    <formats>
-        <format>tar.gz</format>
-        <format>zip</format>
-    </formats>
-    <fileSets>
-        <!-- ********************** copy release notes files ********************** -->
-        <fileSet>
-            <directory>../../../</directory>
-            <outputDirectory>${archive.name}-${version}</outputDirectory>
-            <includes>
-                <include>RELEASE_NOTES</include>
-            </includes>
-        </fileSet>
-        <!-- ********************** copy licenses, readme etc. ********************** -->
-        <fileSet>
-            <directory>src/main/resources/</directory>
-            <outputDirectory>${archive.name}-${version}</outputDirectory>
-            <includes>
-                <include>php-cli-samples/*</include>
-		        <include>lib/**</include>
-                <include>conf/*</include>
-                <include>LICENSE</include>
-                <include>NOTICE</include>
-                <include>README</include>
-                <include>INSTALL</include>
-            </includes>
-        </fileSet>
-<!--	<fileSet>
-            <directory>${project.build.directory}/conf</directory>
-            <outputDirectory>conf</outputDirectory>
-	    <includes>
-                <include>*.properties</include>
-            </includes>
-        </fileSet>-->
-    </fileSets>
-</assembly>


Mime
View raw message