You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by sm...@apache.org on 2014/07/12 06:08:42 UTC
[24/47] Added c++ client samples for integrattion of airavata with
any other application's c++ interface
http://git-wip-us.apache.org/repos/asf/airavata/blob/f891b7dc/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
new file mode 100644
index 0000000..51390b2
--- /dev/null
+++ b/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/Airavata_server.skeleton.cpp
@@ -0,0 +1,399 @@
+// This autogenerated skeleton file illustrates how to build a server.
+// You should copy it to another filename to avoid overwriting it.
+
+#include "Airavata.h"
+#include <thrift/protocol/TBinaryProtocol.h>
+#include <thrift/server/TSimpleServer.h>
+#include <thrift/transport/TServerSocket.h>
+#include <thrift/transport/TBufferTransports.h>
+
+using namespace ::apache::thrift;
+using namespace ::apache::thrift::protocol;
+using namespace ::apache::thrift::transport;
+using namespace ::apache::thrift::server;
+
+using boost::shared_ptr;
+
+using namespace ::apache::airavata::api;
+
+class AiravataHandler : virtual public AiravataIf {
+ public:
+ AiravataHandler() {
+ // Your initialization goes here
+ }
+
+ void getAPIVersion(std::string& _return) {
+ // Your implementation goes here
+ printf("getAPIVersion\n");
+ }
+
+ void createProject(std::string& _return, const ::apache::airavata::model::workspace::Project& project) {
+ // Your implementation goes here
+ printf("createProject\n");
+ }
+
+ void updateProject(const std::string& projectId, const ::apache::airavata::model::workspace::Project& updatedProject) {
+ // Your implementation goes here
+ printf("updateProject\n");
+ }
+
+ void getProject( ::apache::airavata::model::workspace::Project& _return, const std::string& projectId) {
+ // Your implementation goes here
+ printf("getProject\n");
+ }
+
+ void getAllUserProjects(std::vector< ::apache::airavata::model::workspace::Project> & _return, const std::string& userName) {
+ // Your implementation goes here
+ printf("getAllUserProjects\n");
+ }
+
+ void searchProjectsByProjectName(std::vector< ::apache::airavata::model::workspace::Project> & _return, const std::string& userName, const std::string& projectName) {
+ // Your implementation goes here
+ printf("searchProjectsByProjectName\n");
+ }
+
+ void searchProjectsByProjectDesc(std::vector< ::apache::airavata::model::workspace::Project> & _return, const std::string& userName, const std::string& description) {
+ // Your implementation goes here
+ printf("searchProjectsByProjectDesc\n");
+ }
+
+ void searchExperimentsByName(std::vector< ::apache::airavata::model::workspace::experiment::ExperimentSummary> & _return, const std::string& userName, const std::string& expName) {
+ // Your implementation goes here
+ printf("searchExperimentsByName\n");
+ }
+
+ void searchExperimentsByDesc(std::vector< ::apache::airavata::model::workspace::experiment::ExperimentSummary> & _return, const std::string& userName, const std::string& description) {
+ // Your implementation goes here
+ printf("searchExperimentsByDesc\n");
+ }
+
+ void searchExperimentsByApplication(std::vector< ::apache::airavata::model::workspace::experiment::ExperimentSummary> & _return, const std::string& userName, const std::string& applicationId) {
+ // Your implementation goes here
+ printf("searchExperimentsByApplication\n");
+ }
+
+ void getAllExperimentsInProject(std::vector< ::apache::airavata::model::workspace::experiment::Experiment> & _return, const std::string& projectId) {
+ // Your implementation goes here
+ printf("getAllExperimentsInProject\n");
+ }
+
+ void getAllUserExperiments(std::vector< ::apache::airavata::model::workspace::experiment::Experiment> & _return, const std::string& userName) {
+ // Your implementation goes here
+ printf("getAllUserExperiments\n");
+ }
+
+ void createExperiment(std::string& _return, const ::apache::airavata::model::workspace::experiment::Experiment& experiment) {
+ // Your implementation goes here
+ printf("createExperiment\n");
+ }
+
+ void getExperiment( ::apache::airavata::model::workspace::experiment::Experiment& _return, const std::string& airavataExperimentId) {
+ // Your implementation goes here
+ printf("getExperiment\n");
+ }
+
+ void updateExperiment(const std::string& airavataExperimentId, const ::apache::airavata::model::workspace::experiment::Experiment& experiment) {
+ // Your implementation goes here
+ printf("updateExperiment\n");
+ }
+
+ void updateExperimentConfiguration(const std::string& airavataExperimentId, const ::apache::airavata::model::workspace::experiment::UserConfigurationData& userConfiguration) {
+ // Your implementation goes here
+ printf("updateExperimentConfiguration\n");
+ }
+
+ void updateResourceScheduleing(const std::string& airavataExperimentId, const ::apache::airavata::model::workspace::experiment::ComputationalResourceScheduling& resourceScheduling) {
+ // Your implementation goes here
+ printf("updateResourceScheduleing\n");
+ }
+
+ bool validateExperiment(const std::string& airavataExperimentId) {
+ // Your implementation goes here
+ printf("validateExperiment\n");
+ }
+
+ void launchExperiment(const std::string& airavataExperimentId, const std::string& airavataCredStoreToken) {
+ // Your implementation goes here
+ printf("launchExperiment\n");
+ }
+
+ void getExperimentStatus( ::apache::airavata::model::workspace::experiment::ExperimentStatus& _return, const std::string& airavataExperimentId) {
+ // Your implementation goes here
+ printf("getExperimentStatus\n");
+ }
+
+ void getExperimentOutputs(std::vector< ::apache::airavata::model::workspace::experiment::DataObjectType> & _return, const std::string& airavataExperimentId) {
+ // Your implementation goes here
+ printf("getExperimentOutputs\n");
+ }
+
+ void getJobStatuses(std::map<std::string, ::apache::airavata::model::workspace::experiment::JobStatus> & _return, const std::string& airavataExperimentId) {
+ // Your implementation goes here
+ printf("getJobStatuses\n");
+ }
+
+ void cloneExperiment(std::string& _return, const std::string& existingExperimentID, const std::string& newExperimentName) {
+ // Your implementation goes here
+ printf("cloneExperiment\n");
+ }
+
+ void terminateExperiment(const std::string& airavataExperimentId) {
+ // Your implementation goes here
+ printf("terminateExperiment\n");
+ }
+
+ void registerApplicationModule(std::string& _return, const ::apache::airavata::model::appcatalog::appdeployment::ApplicationModule& applicationModule) {
+ // Your implementation goes here
+ printf("registerApplicationModule\n");
+ }
+
+ void getApplicationModule( ::apache::airavata::model::appcatalog::appdeployment::ApplicationModule& _return, const std::string& appModuleId) {
+ // Your implementation goes here
+ printf("getApplicationModule\n");
+ }
+
+ bool updateApplicationModule(const std::string& appModuleId, const ::apache::airavata::model::appcatalog::appdeployment::ApplicationModule& applicationModule) {
+ // Your implementation goes here
+ printf("updateApplicationModule\n");
+ }
+
+ bool deleteApplicationModule(const std::string& appModuleId) {
+ // Your implementation goes here
+ printf("deleteApplicationModule\n");
+ }
+
+ void registerApplicationDeployment(std::string& _return, const ::apache::airavata::model::appcatalog::appdeployment::ApplicationDeploymentDescription& applicationDeployment) {
+ // Your implementation goes here
+ printf("registerApplicationDeployment\n");
+ }
+
+ void getApplicationDeployment( ::apache::airavata::model::appcatalog::appdeployment::ApplicationDeploymentDescription& _return, const std::string& appDeploymentId) {
+ // Your implementation goes here
+ printf("getApplicationDeployment\n");
+ }
+
+ bool updateApplicationDeployment(const std::string& appDeploymentId, const ::apache::airavata::model::appcatalog::appdeployment::ApplicationDeploymentDescription& applicationDeployment) {
+ // Your implementation goes here
+ printf("updateApplicationDeployment\n");
+ }
+
+ bool deleteApplicationDeployment(const std::string& appDeploymentId) {
+ // Your implementation goes here
+ printf("deleteApplicationDeployment\n");
+ }
+
+ void getAppModuleDeployedResources(std::vector<std::string> & _return, const std::string& appModuleId) {
+ // Your implementation goes here
+ printf("getAppModuleDeployedResources\n");
+ }
+
+ void registerApplicationInterface(std::string& _return, const ::apache::airavata::model::appcatalog::appinterface::ApplicationInterfaceDescription& applicationInterface) {
+ // Your implementation goes here
+ printf("registerApplicationInterface\n");
+ }
+
+ void getApplicationInterface( ::apache::airavata::model::appcatalog::appinterface::ApplicationInterfaceDescription& _return, const std::string& appInterfaceId) {
+ // Your implementation goes here
+ printf("getApplicationInterface\n");
+ }
+
+ bool updateApplicationInterface(const std::string& appInterfaceId, const ::apache::airavata::model::appcatalog::appinterface::ApplicationInterfaceDescription& applicationInterface) {
+ // Your implementation goes here
+ printf("updateApplicationInterface\n");
+ }
+
+ bool deleteApplicationInterface(const std::string& appInterfaceId) {
+ // Your implementation goes here
+ printf("deleteApplicationInterface\n");
+ }
+
+ void getAllApplicationInterfaceNames(std::map<std::string, std::string> & _return) {
+ // Your implementation goes here
+ printf("getAllApplicationInterfaceNames\n");
+ }
+
+ void getAllApplicationInterfaces(std::vector< ::apache::airavata::model::appcatalog::appinterface::ApplicationInterfaceDescription> & _return) {
+ // Your implementation goes here
+ printf("getAllApplicationInterfaces\n");
+ }
+
+ void getApplicationInputs(std::vector< ::apache::airavata::model::appcatalog::appinterface::InputDataObjectType> & _return, const std::string& appInterfaceId) {
+ // Your implementation goes here
+ printf("getApplicationInputs\n");
+ }
+
+ void getApplicationOutputs(std::vector< ::apache::airavata::model::appcatalog::appinterface::OutputDataObjectType> & _return, const std::string& appInterfaceId) {
+ // Your implementation goes here
+ printf("getApplicationOutputs\n");
+ }
+
+ void getAvailableAppInterfaceComputeResources(std::map<std::string, std::string> & _return, const std::string& appInterfaceId) {
+ // Your implementation goes here
+ printf("getAvailableAppInterfaceComputeResources\n");
+ }
+
+ void registerComputeResource(std::string& _return, const ::apache::airavata::model::appcatalog::computeresource::ComputeResourceDescription& computeResourceDescription) {
+ // Your implementation goes here
+ printf("registerComputeResource\n");
+ }
+
+ void getComputeResource( ::apache::airavata::model::appcatalog::computeresource::ComputeResourceDescription& _return, const std::string& computeResourceId) {
+ // Your implementation goes here
+ printf("getComputeResource\n");
+ }
+
+ void getAllComputeResourceNames(std::map<std::string, std::string> & _return) {
+ // Your implementation goes here
+ printf("getAllComputeResourceNames\n");
+ }
+
+ bool updateComputeResource(const std::string& computeResourceId, const ::apache::airavata::model::appcatalog::computeresource::ComputeResourceDescription& computeResourceDescription) {
+ // Your implementation goes here
+ printf("updateComputeResource\n");
+ }
+
+ bool deleteComputeResource(const std::string& computeResourceId) {
+ // Your implementation goes here
+ printf("deleteComputeResource\n");
+ }
+
+ bool addLocalSubmissionDetails(const std::string& computeResourceId, const int32_t priorityOrder, const ::apache::airavata::model::appcatalog::computeresource::LOCALSubmission& localSubmission) {
+ // Your implementation goes here
+ printf("addLocalSubmissionDetails\n");
+ }
+
+ bool updateLocalSubmissionDetails(const std::string& jobSubmissionInterfaceId, const ::apache::airavata::model::appcatalog::computeresource::LOCALSubmission& localSubmission) {
+ // Your implementation goes here
+ printf("updateLocalSubmissionDetails\n");
+ }
+
+ bool addSSHJobSubmissionDetails(const std::string& computeResourceId, const int32_t priorityOrder, const ::apache::airavata::model::appcatalog::computeresource::SSHJobSubmission& sshJobSubmission) {
+ // Your implementation goes here
+ printf("addSSHJobSubmissionDetails\n");
+ }
+
+ bool updateSSHJobSubmissionDetails(const std::string& jobSubmissionInterfaceId, const ::apache::airavata::model::appcatalog::computeresource::SSHJobSubmission& sshJobSubmission) {
+ // Your implementation goes here
+ printf("updateSSHJobSubmissionDetails\n");
+ }
+
+ bool addLocalDataMovementDetails(const std::string& computeResourceId, const int32_t priorityOrder, const ::apache::airavata::model::appcatalog::computeresource::LOCALDataMovement& localDataMovement) {
+ // Your implementation goes here
+ printf("addLocalDataMovementDetails\n");
+ }
+
+ bool updateLocalDataMovementDetails(const std::string& jobSubmissionInterfaceId, const ::apache::airavata::model::appcatalog::computeresource::LOCALDataMovement& localDataMovement) {
+ // Your implementation goes here
+ printf("updateLocalDataMovementDetails\n");
+ }
+
+ bool addSCPDataMovementDetails(const std::string& computeResourceId, const int32_t priorityOrder, const ::apache::airavata::model::appcatalog::computeresource::SCPDataMovement& scpDataMovement) {
+ // Your implementation goes here
+ printf("addSCPDataMovementDetails\n");
+ }
+
+ bool updateSCPDataMovementDetails(const std::string& jobSubmissionInterfaceId, const ::apache::airavata::model::appcatalog::computeresource::SCPDataMovement& scpDataMovement) {
+ // Your implementation goes here
+ printf("updateSCPDataMovementDetails\n");
+ }
+
+ bool addGridFTPDataMovementDetails(const std::string& computeResourceId, const int32_t priorityOrder, const ::apache::airavata::model::appcatalog::computeresource::GridFTPDataMovement& gridFTPDataMovement) {
+ // Your implementation goes here
+ printf("addGridFTPDataMovementDetails\n");
+ }
+
+ bool updateGridFTPDataMovementDetails(const std::string& jobSubmissionInterfaceId, const ::apache::airavata::model::appcatalog::computeresource::GridFTPDataMovement& gridFTPDataMovement) {
+ // Your implementation goes here
+ printf("updateGridFTPDataMovementDetails\n");
+ }
+
+ bool changeJobSubmissionPriority(const std::string& jobSubmissionInterfaceId, const int32_t newPriorityOrder) {
+ // Your implementation goes here
+ printf("changeJobSubmissionPriority\n");
+ }
+
+ bool changeDataMovementPriority(const std::string& dataMovementInterfaceId, const int32_t newPriorityOrder) {
+ // Your implementation goes here
+ printf("changeDataMovementPriority\n");
+ }
+
+ bool changeJobSubmissionPriorities(const std::map<std::string, int32_t> & jobSubmissionPriorityMap) {
+ // Your implementation goes here
+ printf("changeJobSubmissionPriorities\n");
+ }
+
+ bool changeDataMovementPriorities(const std::map<std::string, int32_t> & dataMovementPriorityMap) {
+ // Your implementation goes here
+ printf("changeDataMovementPriorities\n");
+ }
+
+ bool deleteJobSubmissionInterface(const std::string& jobSubmissionInterfaceId) {
+ // Your implementation goes here
+ printf("deleteJobSubmissionInterface\n");
+ }
+
+ bool deleteDataMovementInterface(const std::string& dataMovementInterfaceId) {
+ // Your implementation goes here
+ printf("deleteDataMovementInterface\n");
+ }
+
+ void registerGatewayResourceProfile(std::string& _return, const ::apache::airavata::model::appcatalog::gatewayprofile::GatewayResourceProfile& gatewayResourceProfile) {
+ // Your implementation goes here
+ printf("registerGatewayResourceProfile\n");
+ }
+
+ void getGatewayResourceProfile( ::apache::airavata::model::appcatalog::gatewayprofile::GatewayResourceProfile& _return, const std::string& gatewayID) {
+ // Your implementation goes here
+ printf("getGatewayResourceProfile\n");
+ }
+
+ bool updateGatewayResourceProfile(const std::string& gatewayID, const ::apache::airavata::model::appcatalog::gatewayprofile::GatewayResourceProfile& gatewayResourceProfile) {
+ // Your implementation goes here
+ printf("updateGatewayResourceProfile\n");
+ }
+
+ bool deleteGatewayResourceProfile(const std::string& gatewayID) {
+ // Your implementation goes here
+ printf("deleteGatewayResourceProfile\n");
+ }
+
+ bool addGatewayComputeResourcePreference(const std::string& gatewayID, const std::string& computeResourceId, const ::apache::airavata::model::appcatalog::gatewayprofile::ComputeResourcePreference& computeResourcePreference) {
+ // Your implementation goes here
+ printf("addGatewayComputeResourcePreference\n");
+ }
+
+ void getGatewayComputeResourcePreference( ::apache::airavata::model::appcatalog::gatewayprofile::ComputeResourcePreference& _return, const std::string& gatewayID, const std::string& computeResourceId) {
+ // Your implementation goes here
+ printf("getGatewayComputeResourcePreference\n");
+ }
+
+ void getAllGatewayComputeResourcePreferences(std::vector< ::apache::airavata::model::appcatalog::gatewayprofile::ComputeResourcePreference> & _return, const std::string& gatewayID) {
+ // Your implementation goes here
+ printf("getAllGatewayComputeResourcePreferences\n");
+ }
+
+ bool updateGatewayComputeResourcePreference(const std::string& gatewayID, const std::string& computeResourceId, const ::apache::airavata::model::appcatalog::gatewayprofile::ComputeResourcePreference& computeResourcePreference) {
+ // Your implementation goes here
+ printf("updateGatewayComputeResourcePreference\n");
+ }
+
+ bool deleteGatewayComputeResourcePreference(const std::string& gatewayID, const std::string& computeResourceId) {
+ // Your implementation goes here
+ printf("deleteGatewayComputeResourcePreference\n");
+ }
+
+};
+
+int main(int argc, char **argv) {
+ int port = 9090;
+ shared_ptr<AiravataHandler> handler(new AiravataHandler());
+ shared_ptr<TProcessor> processor(new AiravataProcessor(handler));
+ shared_ptr<TServerTransport> serverTransport(new TServerSocket(port));
+ shared_ptr<TTransportFactory> transportFactory(new TBufferedTransportFactory());
+ shared_ptr<TProtocolFactory> protocolFactory(new TBinaryProtocolFactory());
+
+ TSimpleServer server(processor, serverTransport, transportFactory, protocolFactory);
+ server.serve();
+ return 0;
+}
+