Return-Path: X-Original-To: apmail-airavata-commits-archive@www.apache.org Delivered-To: apmail-airavata-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 1C7D017574 for ; Tue, 4 Nov 2014 18:40:35 +0000 (UTC) Received: (qmail 97461 invoked by uid 500); 4 Nov 2014 18:40:35 -0000 Delivered-To: apmail-airavata-commits-archive@airavata.apache.org Received: (qmail 97313 invoked by uid 500); 4 Nov 2014 18:40:34 -0000 Mailing-List: contact commits-help@airavata.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@airavata.apache.org Delivered-To: mailing list commits@airavata.apache.org Received: (qmail 97200 invoked by uid 99); 4 Nov 2014 18:40:34 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 04 Nov 2014 18:40:34 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 90F788AE7C0; Tue, 4 Nov 2014 18:40:34 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: chathuri@apache.org To: commits@airavata.apache.org Date: Tue, 04 Nov 2014 18:40:34 -0000 Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: [1/3] adding delete queue method Repository: airavata Updated Branches: refs/heads/master 08fff2ce2 -> 9cf6d0d8b http://git-wip-us.apache.org/repos/asf/airavata/blob/9cf6d0d8/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/Airavata.cpp ---------------------------------------------------------------------- diff --git a/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/Airavata.cpp b/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/Airavata.cpp index ca5ead1..e1c3da2 100644 --- a/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/Airavata.cpp +++ b/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/Airavata.cpp @@ -19768,6 +19768,250 @@ uint32_t Airavata_deleteResourceJobManager_presult::read(::apache::thrift::proto return xfer; } +uint32_t Airavata_deleteBatchQueue_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_computeResourceId = false; + bool isset_queueName = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->computeResourceId); + isset_computeResourceId = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->queueName); + isset_queueName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_computeResourceId) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_queueName) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t Airavata_deleteBatchQueue_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + xfer += oprot->writeStructBegin("Airavata_deleteBatchQueue_args"); + + xfer += oprot->writeFieldBegin("computeResourceId", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->computeResourceId); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("queueName", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->queueName); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +uint32_t Airavata_deleteBatchQueue_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + xfer += oprot->writeStructBegin("Airavata_deleteBatchQueue_pargs"); + + xfer += oprot->writeFieldBegin("computeResourceId", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString((*(this->computeResourceId))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("queueName", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString((*(this->queueName))); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +uint32_t Airavata_deleteBatchQueue_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool(this->success); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->ire.read(iprot); + this->__isset.ire = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->ace.read(iprot); + this->__isset.ace = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->ase.read(iprot); + this->__isset.ase = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t Airavata_deleteBatchQueue_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("Airavata_deleteBatchQueue_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_BOOL, 0); + xfer += oprot->writeBool(this->success); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.ire) { + xfer += oprot->writeFieldBegin("ire", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->ire.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.ace) { + xfer += oprot->writeFieldBegin("ace", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->ace.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.ase) { + xfer += oprot->writeFieldBegin("ase", ::apache::thrift::protocol::T_STRUCT, 3); + xfer += this->ase.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +uint32_t Airavata_deleteBatchQueue_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool((*(this->success))); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->ire.read(iprot); + this->__isset.ire = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->ace.read(iprot); + this->__isset.ace = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->ase.read(iprot); + this->__isset.ase = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + uint32_t Airavata_registerGatewayResourceProfile_args::read(::apache::thrift::protocol::TProtocol* iprot) { uint32_t xfer = 0; @@ -27421,6 +27665,74 @@ bool AiravataClient::recv_deleteResourceJobManager() throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "deleteResourceJobManager failed: unknown result"); } +bool AiravataClient::deleteBatchQueue(const std::string& computeResourceId, const std::string& queueName) +{ + send_deleteBatchQueue(computeResourceId, queueName); + return recv_deleteBatchQueue(); +} + +void AiravataClient::send_deleteBatchQueue(const std::string& computeResourceId, const std::string& queueName) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("deleteBatchQueue", ::apache::thrift::protocol::T_CALL, cseqid); + + Airavata_deleteBatchQueue_pargs args; + args.computeResourceId = &computeResourceId; + args.queueName = &queueName; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +bool AiravataClient::recv_deleteBatchQueue() +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("deleteBatchQueue") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + bool _return; + Airavata_deleteBatchQueue_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + return _return; + } + if (result.__isset.ire) { + throw result.ire; + } + if (result.__isset.ace) { + throw result.ace; + } + if (result.__isset.ase) { + throw result.ase; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "deleteBatchQueue failed: unknown result"); +} + void AiravataClient::registerGatewayResourceProfile(std::string& _return, const ::apache::airavata::model::appcatalog::gatewayprofile::GatewayResourceProfile& gatewayResourceProfile) { send_registerGatewayResourceProfile(gatewayResourceProfile); @@ -33174,6 +33486,69 @@ void AiravataProcessor::process_deleteResourceJobManager(int32_t seqid, ::apache } } +void AiravataProcessor::process_deleteBatchQueue(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = NULL; + if (this->eventHandler_.get() != NULL) { + ctx = this->eventHandler_->getContext("Airavata.deleteBatchQueue", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "Airavata.deleteBatchQueue"); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->preRead(ctx, "Airavata.deleteBatchQueue"); + } + + Airavata_deleteBatchQueue_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->postRead(ctx, "Airavata.deleteBatchQueue", bytes); + } + + Airavata_deleteBatchQueue_result result; + try { + result.success = iface_->deleteBatchQueue(args.computeResourceId, args.queueName); + result.__isset.success = true; + } catch ( ::apache::airavata::api::error::InvalidRequestException &ire) { + result.ire = ire; + result.__isset.ire = true; + } catch ( ::apache::airavata::api::error::AiravataClientException &ace) { + result.ace = ace; + result.__isset.ace = true; + } catch ( ::apache::airavata::api::error::AiravataSystemException &ase) { + result.ase = ase; + result.__isset.ase = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->handlerError(ctx, "Airavata.deleteBatchQueue"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("deleteBatchQueue", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->preWrite(ctx, "Airavata.deleteBatchQueue"); + } + + oprot->writeMessageBegin("deleteBatchQueue", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->postWrite(ctx, "Airavata.deleteBatchQueue", bytes); + } +} + void AiravataProcessor::process_registerGatewayResourceProfile(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) { void* ctx = NULL; http://git-wip-us.apache.org/repos/asf/airavata/blob/9cf6d0d8/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/Airavata.h ---------------------------------------------------------------------- diff --git a/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/Airavata.h b/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/Airavata.h index a6168dd..7387517 100644 --- a/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/Airavata.h +++ b/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/Airavata.h @@ -113,6 +113,7 @@ class AiravataIf { virtual bool updateResourceJobManager(const std::string& resourceJobManagerId, const ::apache::airavata::model::appcatalog::computeresource::ResourceJobManager& updatedResourceJobManager) = 0; virtual void getResourceJobManager( ::apache::airavata::model::appcatalog::computeresource::ResourceJobManager& _return, const std::string& resourceJobManagerId) = 0; virtual bool deleteResourceJobManager(const std::string& resourceJobManagerId) = 0; + virtual bool deleteBatchQueue(const std::string& computeResourceId, const std::string& queueName) = 0; virtual void registerGatewayResourceProfile(std::string& _return, const ::apache::airavata::model::appcatalog::gatewayprofile::GatewayResourceProfile& gatewayResourceProfile) = 0; virtual void getGatewayResourceProfile( ::apache::airavata::model::appcatalog::gatewayprofile::GatewayResourceProfile& _return, const std::string& gatewayID) = 0; virtual bool updateGatewayResourceProfile(const std::string& gatewayID, const ::apache::airavata::model::appcatalog::gatewayprofile::GatewayResourceProfile& gatewayResourceProfile) = 0; @@ -417,6 +418,10 @@ class AiravataNull : virtual public AiravataIf { bool _return = false; return _return; } + bool deleteBatchQueue(const std::string& /* computeResourceId */, const std::string& /* queueName */) { + bool _return = false; + return _return; + } void registerGatewayResourceProfile(std::string& /* _return */, const ::apache::airavata::model::appcatalog::gatewayprofile::GatewayResourceProfile& /* gatewayResourceProfile */) { return; } @@ -11479,6 +11484,146 @@ class Airavata_deleteResourceJobManager_presult { }; +class Airavata_deleteBatchQueue_args { + public: + + Airavata_deleteBatchQueue_args() : computeResourceId(), queueName() { + } + + virtual ~Airavata_deleteBatchQueue_args() throw() {} + + std::string computeResourceId; + std::string queueName; + + void __set_computeResourceId(const std::string& val) { + computeResourceId = val; + } + + void __set_queueName(const std::string& val) { + queueName = val; + } + + bool operator == (const Airavata_deleteBatchQueue_args & rhs) const + { + if (!(computeResourceId == rhs.computeResourceId)) + return false; + if (!(queueName == rhs.queueName)) + return false; + return true; + } + bool operator != (const Airavata_deleteBatchQueue_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const Airavata_deleteBatchQueue_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class Airavata_deleteBatchQueue_pargs { + public: + + + virtual ~Airavata_deleteBatchQueue_pargs() throw() {} + + const std::string* computeResourceId; + const std::string* queueName; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _Airavata_deleteBatchQueue_result__isset { + _Airavata_deleteBatchQueue_result__isset() : success(false), ire(false), ace(false), ase(false) {} + bool success; + bool ire; + bool ace; + bool ase; +} _Airavata_deleteBatchQueue_result__isset; + +class Airavata_deleteBatchQueue_result { + public: + + Airavata_deleteBatchQueue_result() : success(0) { + } + + virtual ~Airavata_deleteBatchQueue_result() throw() {} + + bool success; + ::apache::airavata::api::error::InvalidRequestException ire; + ::apache::airavata::api::error::AiravataClientException ace; + ::apache::airavata::api::error::AiravataSystemException ase; + + _Airavata_deleteBatchQueue_result__isset __isset; + + void __set_success(const bool val) { + success = val; + } + + void __set_ire(const ::apache::airavata::api::error::InvalidRequestException& val) { + ire = val; + } + + void __set_ace(const ::apache::airavata::api::error::AiravataClientException& val) { + ace = val; + } + + void __set_ase(const ::apache::airavata::api::error::AiravataSystemException& val) { + ase = val; + } + + bool operator == (const Airavata_deleteBatchQueue_result & rhs) const + { + if (!(success == rhs.success)) + return false; + if (!(ire == rhs.ire)) + return false; + if (!(ace == rhs.ace)) + return false; + if (!(ase == rhs.ase)) + return false; + return true; + } + bool operator != (const Airavata_deleteBatchQueue_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const Airavata_deleteBatchQueue_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _Airavata_deleteBatchQueue_presult__isset { + _Airavata_deleteBatchQueue_presult__isset() : success(false), ire(false), ace(false), ase(false) {} + bool success; + bool ire; + bool ace; + bool ase; +} _Airavata_deleteBatchQueue_presult__isset; + +class Airavata_deleteBatchQueue_presult { + public: + + + virtual ~Airavata_deleteBatchQueue_presult() throw() {} + + bool* success; + ::apache::airavata::api::error::InvalidRequestException ire; + ::apache::airavata::api::error::AiravataClientException ace; + ::apache::airavata::api::error::AiravataSystemException ase; + + _Airavata_deleteBatchQueue_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + + class Airavata_registerGatewayResourceProfile_args { public: @@ -12985,6 +13130,9 @@ class AiravataClient : virtual public AiravataIf { bool deleteResourceJobManager(const std::string& resourceJobManagerId); void send_deleteResourceJobManager(const std::string& resourceJobManagerId); bool recv_deleteResourceJobManager(); + bool deleteBatchQueue(const std::string& computeResourceId, const std::string& queueName); + void send_deleteBatchQueue(const std::string& computeResourceId, const std::string& queueName); + bool recv_deleteBatchQueue(); void registerGatewayResourceProfile(std::string& _return, const ::apache::airavata::model::appcatalog::gatewayprofile::GatewayResourceProfile& gatewayResourceProfile); void send_registerGatewayResourceProfile(const ::apache::airavata::model::appcatalog::gatewayprofile::GatewayResourceProfile& gatewayResourceProfile); void recv_registerGatewayResourceProfile(std::string& _return); @@ -13108,6 +13256,7 @@ class AiravataProcessor : public ::apache::thrift::TDispatchProcessor { void process_updateResourceJobManager(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); void process_getResourceJobManager(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); void process_deleteResourceJobManager(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_deleteBatchQueue(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); void process_registerGatewayResourceProfile(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); void process_getGatewayResourceProfile(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); void process_updateGatewayResourceProfile(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); @@ -13201,6 +13350,7 @@ class AiravataProcessor : public ::apache::thrift::TDispatchProcessor { processMap_["updateResourceJobManager"] = &AiravataProcessor::process_updateResourceJobManager; processMap_["getResourceJobManager"] = &AiravataProcessor::process_getResourceJobManager; processMap_["deleteResourceJobManager"] = &AiravataProcessor::process_deleteResourceJobManager; + processMap_["deleteBatchQueue"] = &AiravataProcessor::process_deleteBatchQueue; processMap_["registerGatewayResourceProfile"] = &AiravataProcessor::process_registerGatewayResourceProfile; processMap_["getGatewayResourceProfile"] = &AiravataProcessor::process_getGatewayResourceProfile; processMap_["updateGatewayResourceProfile"] = &AiravataProcessor::process_updateGatewayResourceProfile; @@ -14019,6 +14169,15 @@ class AiravataMultiface : virtual public AiravataIf { return ifaces_[i]->deleteResourceJobManager(resourceJobManagerId); } + bool deleteBatchQueue(const std::string& computeResourceId, const std::string& queueName) { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->deleteBatchQueue(computeResourceId, queueName); + } + return ifaces_[i]->deleteBatchQueue(computeResourceId, queueName); + } + void registerGatewayResourceProfile(std::string& _return, const ::apache::airavata::model::appcatalog::gatewayprofile::GatewayResourceProfile& gatewayResourceProfile) { size_t sz = ifaces_.size(); size_t i = 0; http://git-wip-us.apache.org/repos/asf/airavata/blob/9cf6d0d8/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/Airavata_server.skeleton.cpp ---------------------------------------------------------------------- diff --git a/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/Airavata_server.skeleton.cpp b/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/Airavata_server.skeleton.cpp index 4f36e0a..2b7e03f 100644 --- a/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/Airavata_server.skeleton.cpp +++ b/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/Airavata_server.skeleton.cpp @@ -444,6 +444,11 @@ class AiravataHandler : virtual public AiravataIf { printf("deleteResourceJobManager\n"); } + bool deleteBatchQueue(const std::string& computeResourceId, const std::string& queueName) { + // Your implementation goes here + printf("deleteBatchQueue\n"); + } + void registerGatewayResourceProfile(std::string& _return, const ::apache::airavata::model::appcatalog::gatewayprofile::GatewayResourceProfile& gatewayResourceProfile) { // Your implementation goes here printf("registerGatewayResourceProfile\n"); http://git-wip-us.apache.org/repos/asf/airavata/blob/9cf6d0d8/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/lib/Airavata/API/Airavata.php ---------------------------------------------------------------------- diff --git a/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/lib/Airavata/API/Airavata.php b/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/lib/Airavata/API/Airavata.php index 08c075b..806d317 100644 --- a/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/lib/Airavata/API/Airavata.php +++ b/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/lib/Airavata/API/Airavata.php @@ -98,6 +98,7 @@ interface AiravataIf { public function updateResourceJobManager($resourceJobManagerId, \Airavata\Model\AppCatalog\ComputeResource\ResourceJobManager $updatedResourceJobManager); public function getResourceJobManager($resourceJobManagerId); public function deleteResourceJobManager($resourceJobManagerId); + public function deleteBatchQueue($computeResourceId, $queueName); public function registerGatewayResourceProfile(\Airavata\Model\AppCatalog\GatewayProfile\GatewayResourceProfile $gatewayResourceProfile); public function getGatewayResourceProfile($gatewayID); public function updateGatewayResourceProfile($gatewayID, \Airavata\Model\AppCatalog\GatewayProfile\GatewayResourceProfile $gatewayResourceProfile); @@ -5028,6 +5029,67 @@ class AiravataClient implements \Airavata\API\AiravataIf { throw new \Exception("deleteResourceJobManager failed: unknown result"); } + public function deleteBatchQueue($computeResourceId, $queueName) + { + $this->send_deleteBatchQueue($computeResourceId, $queueName); + return $this->recv_deleteBatchQueue(); + } + + public function send_deleteBatchQueue($computeResourceId, $queueName) + { + $args = new \Airavata\API\Airavata_deleteBatchQueue_args(); + $args->computeResourceId = $computeResourceId; + $args->queueName = $queueName; + $bin_accel = ($this->output_ instanceof TBinaryProtocolAccelerated) && function_exists('thrift_protocol_write_binary'); + if ($bin_accel) + { + thrift_protocol_write_binary($this->output_, 'deleteBatchQueue', TMessageType::CALL, $args, $this->seqid_, $this->output_->isStrictWrite()); + } + else + { + $this->output_->writeMessageBegin('deleteBatchQueue', TMessageType::CALL, $this->seqid_); + $args->write($this->output_); + $this->output_->writeMessageEnd(); + $this->output_->getTransport()->flush(); + } + } + + public function recv_deleteBatchQueue() + { + $bin_accel = ($this->input_ instanceof TBinaryProtocolAccelerated) && function_exists('thrift_protocol_read_binary'); + if ($bin_accel) $result = thrift_protocol_read_binary($this->input_, '\Airavata\API\Airavata_deleteBatchQueue_result', $this->input_->isStrictRead()); + else + { + $rseqid = 0; + $fname = null; + $mtype = 0; + + $this->input_->readMessageBegin($fname, $mtype, $rseqid); + if ($mtype == TMessageType::EXCEPTION) { + $x = new TApplicationException(); + $x->read($this->input_); + $this->input_->readMessageEnd(); + throw $x; + } + $result = new \Airavata\API\Airavata_deleteBatchQueue_result(); + $result->read($this->input_); + $this->input_->readMessageEnd(); + } + if ($result->success !== null) { + return $result->success; + } + if ($result->ire !== null) { + throw $result->ire; + } + if ($result->ace !== null) { + throw $result->ace; + } + if ($result->ase !== null) { + throw $result->ase; + } + throw new \Exception("deleteBatchQueue failed: unknown result"); + } + public function registerGatewayResourceProfile(\Airavata\Model\AppCatalog\GatewayProfile\GatewayResourceProfile $gatewayResourceProfile) { $this->send_registerGatewayResourceProfile($gatewayResourceProfile); @@ -24335,6 +24397,236 @@ class Airavata_deleteResourceJobManager_result { } +class Airavata_deleteBatchQueue_args { + static $_TSPEC; + + public $computeResourceId = null; + public $queueName = null; + + public function __construct($vals=null) { + if (!isset(self::$_TSPEC)) { + self::$_TSPEC = array( + 1 => array( + 'var' => 'computeResourceId', + 'type' => TType::STRING, + ), + 2 => array( + 'var' => 'queueName', + 'type' => TType::STRING, + ), + ); + } + if (is_array($vals)) { + if (isset($vals['computeResourceId'])) { + $this->computeResourceId = $vals['computeResourceId']; + } + if (isset($vals['queueName'])) { + $this->queueName = $vals['queueName']; + } + } + } + + public function getName() { + return 'Airavata_deleteBatchQueue_args'; + } + + public function read($input) + { + $xfer = 0; + $fname = null; + $ftype = 0; + $fid = 0; + $xfer += $input->readStructBegin($fname); + while (true) + { + $xfer += $input->readFieldBegin($fname, $ftype, $fid); + if ($ftype == TType::STOP) { + break; + } + switch ($fid) + { + case 1: + if ($ftype == TType::STRING) { + $xfer += $input->readString($this->computeResourceId); + } else { + $xfer += $input->skip($ftype); + } + break; + case 2: + if ($ftype == TType::STRING) { + $xfer += $input->readString($this->queueName); + } else { + $xfer += $input->skip($ftype); + } + break; + default: + $xfer += $input->skip($ftype); + break; + } + $xfer += $input->readFieldEnd(); + } + $xfer += $input->readStructEnd(); + return $xfer; + } + + public function write($output) { + $xfer = 0; + $xfer += $output->writeStructBegin('Airavata_deleteBatchQueue_args'); + if ($this->computeResourceId !== null) { + $xfer += $output->writeFieldBegin('computeResourceId', TType::STRING, 1); + $xfer += $output->writeString($this->computeResourceId); + $xfer += $output->writeFieldEnd(); + } + if ($this->queueName !== null) { + $xfer += $output->writeFieldBegin('queueName', TType::STRING, 2); + $xfer += $output->writeString($this->queueName); + $xfer += $output->writeFieldEnd(); + } + $xfer += $output->writeFieldStop(); + $xfer += $output->writeStructEnd(); + return $xfer; + } + +} + +class Airavata_deleteBatchQueue_result { + static $_TSPEC; + + public $success = null; + public $ire = null; + public $ace = null; + public $ase = null; + + public function __construct($vals=null) { + if (!isset(self::$_TSPEC)) { + self::$_TSPEC = array( + 0 => array( + 'var' => 'success', + 'type' => TType::BOOL, + ), + 1 => array( + 'var' => 'ire', + 'type' => TType::STRUCT, + 'class' => '\Airavata\API\Error\InvalidRequestException', + ), + 2 => array( + 'var' => 'ace', + 'type' => TType::STRUCT, + 'class' => '\Airavata\API\Error\AiravataClientException', + ), + 3 => array( + 'var' => 'ase', + 'type' => TType::STRUCT, + 'class' => '\Airavata\API\Error\AiravataSystemException', + ), + ); + } + if (is_array($vals)) { + if (isset($vals['success'])) { + $this->success = $vals['success']; + } + if (isset($vals['ire'])) { + $this->ire = $vals['ire']; + } + if (isset($vals['ace'])) { + $this->ace = $vals['ace']; + } + if (isset($vals['ase'])) { + $this->ase = $vals['ase']; + } + } + } + + public function getName() { + return 'Airavata_deleteBatchQueue_result'; + } + + public function read($input) + { + $xfer = 0; + $fname = null; + $ftype = 0; + $fid = 0; + $xfer += $input->readStructBegin($fname); + while (true) + { + $xfer += $input->readFieldBegin($fname, $ftype, $fid); + if ($ftype == TType::STOP) { + break; + } + switch ($fid) + { + case 0: + if ($ftype == TType::BOOL) { + $xfer += $input->readBool($this->success); + } else { + $xfer += $input->skip($ftype); + } + break; + case 1: + if ($ftype == TType::STRUCT) { + $this->ire = new \Airavata\API\Error\InvalidRequestException(); + $xfer += $this->ire->read($input); + } else { + $xfer += $input->skip($ftype); + } + break; + case 2: + if ($ftype == TType::STRUCT) { + $this->ace = new \Airavata\API\Error\AiravataClientException(); + $xfer += $this->ace->read($input); + } else { + $xfer += $input->skip($ftype); + } + break; + case 3: + if ($ftype == TType::STRUCT) { + $this->ase = new \Airavata\API\Error\AiravataSystemException(); + $xfer += $this->ase->read($input); + } else { + $xfer += $input->skip($ftype); + } + break; + default: + $xfer += $input->skip($ftype); + break; + } + $xfer += $input->readFieldEnd(); + } + $xfer += $input->readStructEnd(); + return $xfer; + } + + public function write($output) { + $xfer = 0; + $xfer += $output->writeStructBegin('Airavata_deleteBatchQueue_result'); + if ($this->success !== null) { + $xfer += $output->writeFieldBegin('success', TType::BOOL, 0); + $xfer += $output->writeBool($this->success); + $xfer += $output->writeFieldEnd(); + } + if ($this->ire !== null) { + $xfer += $output->writeFieldBegin('ire', TType::STRUCT, 1); + $xfer += $this->ire->write($output); + $xfer += $output->writeFieldEnd(); + } + if ($this->ace !== null) { + $xfer += $output->writeFieldBegin('ace', TType::STRUCT, 2); + $xfer += $this->ace->write($output); + $xfer += $output->writeFieldEnd(); + } + if ($this->ase !== null) { + $xfer += $output->writeFieldBegin('ase', TType::STRUCT, 3); + $xfer += $this->ase->write($output); + $xfer += $output->writeFieldEnd(); + } + $xfer += $output->writeFieldStop(); + $xfer += $output->writeStructEnd(); + return $xfer; + } + +} + class Airavata_registerGatewayResourceProfile_args { static $_TSPEC; http://git-wip-us.apache.org/repos/asf/airavata/blob/9cf6d0d8/airavata-api/thrift-interface-descriptions/airavataAPI.thrift ---------------------------------------------------------------------- diff --git a/airavata-api/thrift-interface-descriptions/airavataAPI.thrift b/airavata-api/thrift-interface-descriptions/airavataAPI.thrift index 6b00d24..6006adb 100644 --- a/airavata-api/thrift-interface-descriptions/airavataAPI.thrift +++ b/airavata-api/thrift-interface-descriptions/airavataAPI.thrift @@ -1388,6 +1388,11 @@ service Airavata { throws (1: airavataErrors.InvalidRequestException ire, 2: airavataErrors.AiravataClientException ace, 3: airavataErrors.AiravataSystemException ase) + + bool deleteBatchQueue(1: required string computeResourceId, 2: required string queueName) + throws (1: airavataErrors.InvalidRequestException ire, + 2: airavataErrors.AiravataClientException ace, + 3: airavataErrors.AiravataSystemException ase) /* * Gateway Resource Profile * http://git-wip-us.apache.org/repos/asf/airavata/blob/9cf6d0d8/modules/app-catalog/app-catalog-cpi/src/main/java/org/airavata/appcatalog/cpi/ComputeResource.java ---------------------------------------------------------------------- diff --git a/modules/app-catalog/app-catalog-cpi/src/main/java/org/airavata/appcatalog/cpi/ComputeResource.java b/modules/app-catalog/app-catalog-cpi/src/main/java/org/airavata/appcatalog/cpi/ComputeResource.java index b64903e..efa2f96 100644 --- a/modules/app-catalog/app-catalog-cpi/src/main/java/org/airavata/appcatalog/cpi/ComputeResource.java +++ b/modules/app-catalog/app-catalog-cpi/src/main/java/org/airavata/appcatalog/cpi/ComputeResource.java @@ -235,6 +235,8 @@ public interface ComputeResource { */ void removeDataMovementInterface(String computeResourceId, String dataMovementInterfaceId) throws AppCatalogException; + void removeBatchQueue(String computeResourceId, String queueName) throws AppCatalogException; + LOCALSubmission getLocalJobSubmission(String submissionId) throws AppCatalogException; http://git-wip-us.apache.org/repos/asf/airavata/blob/9cf6d0d8/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/impl/ComputeResourceImpl.java ---------------------------------------------------------------------- diff --git a/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/impl/ComputeResourceImpl.java b/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/impl/ComputeResourceImpl.java index 89a292b..7917b23 100644 --- a/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/impl/ComputeResourceImpl.java +++ b/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/impl/ComputeResourceImpl.java @@ -118,8 +118,6 @@ public class ComputeResourceImpl implements ComputeResource { ComputeResourceResource computeHostResource) throws AppCatalogException { List batchQueueList = description.getBatchQueues(); - BatchQueueResource resource = new BatchQueueResource(); - resource.remove(description.getComputeResourceId()); if (batchQueueList != null && !batchQueueList.isEmpty()) { for (BatchQueue batchQueue : batchQueueList) { BatchQueueResource bq = AppCatalogThriftConversion.getBatchQueue(batchQueue); @@ -733,6 +731,20 @@ public class ComputeResourceImpl implements ComputeResource { } @Override + public void removeBatchQueue(String computeResourceId, String queueName) throws AppCatalogException { + try { + BatchQueueResource resource = new BatchQueueResource(); + Map ids = new HashMap(); + ids.put(AbstractResource.BatchQueueConstants.COMPUTE_RESOURCE_ID, computeResourceId); + ids.put(AbstractResource.BatchQueueConstants.QUEUE_NAME, queueName); + resource.remove(ids); + }catch (Exception e){ + logger.error("Error while removing batch queue..", e); + throw new AppCatalogException(e); + } + } + + @Override public String addResourceJobManager(ResourceJobManager resourceJobManager) throws AppCatalogException { resourceJobManager.setResourceJobManagerId(AppCatalogUtils.getID("RJM")); http://git-wip-us.apache.org/repos/asf/airavata/blob/9cf6d0d8/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/resources/BatchQueueResource.java ---------------------------------------------------------------------- diff --git a/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/resources/BatchQueueResource.java b/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/resources/BatchQueueResource.java index 5df3bd2..2dac680 100644 --- a/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/resources/BatchQueueResource.java +++ b/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/resources/BatchQueueResource.java @@ -53,12 +53,20 @@ public class BatchQueueResource extends AbstractResource { @Override public void remove(Object identifier) throws AppCatalogException { + HashMap ids; + if (identifier instanceof Map) { + ids = (HashMap) identifier; + } else { + logger.error("Identifier should be a map with the field name and it's value"); + throw new AppCatalogException("Identifier should be a map with the field name and it's value"); + } EntityManager em = null; try { em = AppCatalogJPAUtils.getEntityManager(); em.getTransaction().begin(); AppCatalogQueryGenerator generator = new AppCatalogQueryGenerator(BATCH_QUEUE); - generator.setParameter(BatchQueueConstants.COMPUTE_RESOURCE_ID, identifier); + generator.setParameter(BatchQueueConstants.COMPUTE_RESOURCE_ID, ids.get(BatchQueueConstants.COMPUTE_RESOURCE_ID)); + generator.setParameter(BatchQueueConstants.QUEUE_NAME, ids.get(BatchQueueConstants.QUEUE_NAME)); Query q = generator.deleteQuery(em); q.executeUpdate(); em.getTransaction().commit();