diff --git a/proto/Request.proto b/proto/Request.proto index 8c9d751a7c43e3cee7b271ddedb4dcf38ef1812f..5f308df27476e264db3601159b90cc1aadbed49c 100644 --- a/proto/Request.proto +++ b/proto/Request.proto @@ -7,7 +7,9 @@ message Request enum Type { AUTHORIZATION = 0; - DATA = 1; + VALIDATION = 1; + TRANSFER = 2; + KEEPALIVE = 3; } required Type type = 1; @@ -22,13 +24,23 @@ message Request optional Authorization authorization = 2; - //Data request + //Validation request + + message Validation + { + required string schema = 1; + required string table = 2; + } + + optional Validation validation = 3; + + //Transfer request - message Data + message Transfer { required int32 file_version = 1; required string file_name = 2; } - optional Data data = 3; + optional Transfer transfer = 4; } diff --git a/proto/Response.proto b/proto/Response.proto index 0b4214dabc5541abcd8048ba52b0e01bc85ea95c..2d869627a4d0b48140502954a477bd56320f2ab2 100644 --- a/proto/Response.proto +++ b/proto/Response.proto @@ -7,7 +7,9 @@ message Response enum Type { AUTHORIZATION = 0; - DATA = 1; + VALIDATION = 1; + TRANSFER = 2; + KEEPALIVE = 3; } required Type type = 1; @@ -28,9 +30,25 @@ message Response optional Authorization authorization = 2; - //Data response + //Validation response - message Data + message Validation + { + enum State + { + ACCEPTED = 0; + REJECTED = 1; + } + + required State state = 1; + required string status = 2; + } + + optional Validation validation = 3; + + //Transfer response + + message Transfer { enum State { @@ -41,9 +59,11 @@ message Response required State state = 1; required string status = 2; - required string file_path = 3; - required string file_version = 4; - required string file_name = 5; - required uint64 size = 6; + optional string file_path = 3; + optional int32 file_version = 4; + optional string file_name = 5; + optional uint64 size = 6; } + + optional Transfer transfer = 4; } diff --git a/src/DBManager.cpp b/src/DBManager.cpp index e59e6f8729d88014db185907e6f8d1ce32379790..fe0639b4bdbba4dbbd47e3d062674a66dd2a2620 100644 --- a/src/DBManager.cpp +++ b/src/DBManager.cpp @@ -77,4 +77,50 @@ void DBManager::disconnect() m_connectionPool_sp.reset(); } +//============================================================================== +// DBManager::retrieveFileInfo() +//============================================================================== +DBManager::FileTuple DBManager::retrieveFileInfo(std::string schema, + std::string table, int version, std::string name) + throw(soci::soci_error, std::runtime_error) +{ + DEBUG_STREAM << "DBManager::retrieveFileInfo()" << endl; + + if(!m_connectionPool_sp) + throw soci::soci_error("Connection pool not initialized"); + + soci::session session(*m_connectionPool_sp); + + if(session.get_backend() == NULL) + session.reconnect(); + + soci::rowset<FileTuple> rows = (session.prepare << "select storage_path, " + "file_path from " << schema << "." << table << " where " + "file_version=:version and file_name like :name", + soci::use(version, "version"), soci::use(name, "name")); + + std::vector<FileTuple> fileTupleList; + + std::copy(rows.begin(), rows.end(), std::back_inserter(fileTupleList)); + + if(fileTupleList.empty()) + { + std::stringstream errorStream; + errorStream << "Table " << schema << "." << table + << " does not contain file " << name << " version " << version; + throw std::runtime_error(errorStream.str()); + } + + if(fileTupleList.size()>1) + { + std::stringstream errorStream; + errorStream << "Table " << schema << "." << table + << " has duplicate for file " << name << " version " << version; + throw std::runtime_error(errorStream.str()); + } + + return fileTupleList.at(0); +} + + } //namespace diff --git a/src/DBManager.h b/src/DBManager.h index 30c9659dec6d0e8729f85ad04ec6d57f35bf7b1c..747eddda01168db80831fd18f1574600114ae993 100644 --- a/src/DBManager.h +++ b/src/DBManager.h @@ -61,6 +61,15 @@ public: virtual void disconnect(); +//------------------------------------------------------------------------------ +// [Public] File method +//------------------------------------------------------------------------------ + typedef boost::tuple< boost::optional<std::string>, + boost::optional<std::string> > FileTuple; + + virtual FileTuple retrieveFileInfo(std::string, std::string, int, + std::string) throw(soci::soci_error, std::runtime_error); + protected: //------------------------------------------------------------------------------ // [Protected] Class variables diff --git a/src/ProtocolManager.cpp b/src/ProtocolManager.cpp index 0f93eb720024f110c946c3bb0519b7a49a9583da..7525f33e57e19a0367a2445cd1db2996d52db8ee 100644 --- a/src/ProtocolManager.cpp +++ b/src/ProtocolManager.cpp @@ -1,6 +1,7 @@ #include <ProtocolManager.h> #include <boost/date_time.hpp> +#include <boost/filesystem.hpp> namespace DataExporter_ns { @@ -51,10 +52,271 @@ void ProtocolManager::setRemoteEndpoint(std::string remoteEndpoint) //============================================================================== // ProtocolManager::setRemoteEndpoint() //============================================================================== -ResponseSP ProtocolManager::prepareResponse(RequestSP) +ResponseSP ProtocolManager::prepareResponse(RequestSP request_sp) throw(std::runtime_error) { DEBUG_STREAM << "ProtocolManager::prepareResponse()" << endl; + + if(!request_sp->IsInitialized()) + throw std::runtime_error("Not initialized request!"); + + ResponseSP response_sp; + + switch(request_sp->type()) + { + case Request::AUTHORIZATION: + { + response_sp = prepareAuthroisation(request_sp); + break; + } + case Request::VALIDATION: + { + response_sp = prepareValidation(request_sp); + break; + } + case Request::TRANSFER: + { + response_sp = prepareTransfer(request_sp); + break; + } + case Request::KEEPALIVE: + { + response_sp = prepareKeepAlive(request_sp); + break; + } + default: + throw std::runtime_error("Unknown request type!"); + } + + if(!response_sp->IsInitialized()) + throw std::runtime_error("Not initialized response!"); + + return response_sp; +} + +//============================================================================== +// ProtocolManager::prepareAuthroisation() +//============================================================================== +ResponseSP ProtocolManager::prepareAuthroisation(RequestSP request_sp) +{ + DEBUG_STREAM << "ProtocolManager::prepareAuthroisation()" << endl; + + ResponseSP response_sp(new Response()); + + response_sp->set_type(Response::AUTHORIZATION); + + Response::Authorization* authResp = response_sp->mutable_authorization(); + + if(!m_isAuthorised) + { + const Request::Authorization& authReq = request_sp->authorization(); + std::string username = authReq.username(); + std::string password = authReq.password(); + + if(m_configuration_sp->isUserAuthorized(username, password)) + { + INFO_STREAM << "ProtocolManager::prepareAuthroisation() " + << "Authorization accepted from " << m_remoteEndpoint << endl; + + m_isAuthorised = true; + + authResp->set_state(Response::Authorization::ACCEPTED); + authResp->set_status("Authorization accepted"); + } + else + { + WARN_STREAM << "ProtocolManager::prepareAuthroisation() " + << "Invalid username or password from " << m_remoteEndpoint << endl; + + m_isAuthorised = false; + + authResp->set_state(Response::Authorization::REJECTED); + authResp->set_status("Invalid username or password"); + } + } + else + { + WARN_STREAM << "ProtocolManager::prepareAuthroisation() " + << "Already authorized from " << m_remoteEndpoint << endl; + + authResp->set_state(Response::Authorization::REJECTED); + authResp->set_status("Already authorized"); + } + + return response_sp; +} + +//============================================================================== +// ProtocolManager::prepareValidation() +//============================================================================== +ResponseSP ProtocolManager::prepareValidation(RequestSP request_sp) +{ + DEBUG_STREAM << "ProtocolManager::prepareValidation()" << endl; + + ResponseSP response_sp(new Response()); + + response_sp->set_type(Response::VALIDATION); + + Response::Validation* validationRes = response_sp->mutable_validation(); + + if(m_isAuthorised) + { + if(!m_isValidated) + { + const Request::Validation& validationReq = request_sp->validation(); + + m_validatedSchema = validationReq.schema(); + m_validatedTable = validationReq.table(); + + if(m_configuration_sp->isTableExported(m_validatedSchema, m_validatedTable)) + { + INFO_STREAM << "ProtocolManager::prepareValidation() " + << "Validation accepted for " << m_validatedSchema << "." + << m_validatedTable << " from " << m_remoteEndpoint << endl; + + m_isValidated = true; + + validationRes->set_state(Response::Validation::ACCEPTED); + validationRes->set_status("Table validated"); + } + else + { + WARN_STREAM << "ProtocolManager::prepareValidation() " + << "Not exported table from " << m_remoteEndpoint << endl; + + validationRes->set_state(Response::Validation::REJECTED); + validationRes->set_status("Not exported table"); + } + } + else + { + WARN_STREAM << "ProtocolManager::prepareValidation() " + << "Already validated from " << m_remoteEndpoint << endl; + + validationRes->set_state(Response::Validation::REJECTED); + validationRes->set_status("Already validated"); + } + } + else + { + WARN_STREAM << "ProtocolManager::prepareValidation() " + << "Not authorised from " << m_remoteEndpoint << endl; + + validationRes->set_state(Response::Validation::REJECTED); + validationRes->set_status("Not authorised"); + } + + return response_sp; +} + +//============================================================================== +// ProtocolManager::prepareTransfer() +//============================================================================== +ResponseSP ProtocolManager::prepareTransfer(RequestSP request_sp) +{ + DEBUG_STREAM << "ProtocolManager::prepareTransfer()" << endl; + + ResponseSP response_sp(new Response()); + + response_sp->set_type(Response::TRANSFER); + + Response::Transfer* transferRes = response_sp->mutable_transfer(); + + if(m_isAuthorised) + { + if(m_isValidated) + { + const Request::Transfer& transferReq = request_sp->transfer(); + + int fileVersion = transferReq.file_version(); + std::string fileName = transferReq.file_name(); + + try + { + DBManager::FileTuple fileTuple = + m_dBManager_sp->retrieveFileInfo(m_validatedSchema, + m_validatedTable, fileVersion, fileName); + + if(!fileTuple.get<0>() || !fileTuple.get<1>()) + { + std::stringstream errorStream; + errorStream << "File " << fileName << " version " + << fileVersion << " not yet downloaded in storage"; + throw std::runtime_error(errorStream.str()); + } + + std::string storagePath = fileTuple.get<0>().get(); + boost::filesystem::path absPath(storagePath); + + std::string filePath = fileTuple.get<1>().get(); + boost::filesystem::path relPath(filePath); + + absPath /= relPath; + + std::stringstream pathStream; + pathStream << "/" << fileVersion << "/" << fileName; + boost::filesystem::path lastPath(pathStream.str()); + + absPath /= lastPath; + + DEBUG_STREAM << "FILE: " << absPath.string() << endl; + + if(!boost::filesystem::is_regular_file(absPath)) + { + std::stringstream errorStream; + errorStream << "File " << fileName << " version " + << fileVersion << " not exists in storage"; + throw std::runtime_error(errorStream.str()); + } + + transferRes->set_file_path(filePath); + transferRes->set_file_version(fileVersion); + transferRes->set_file_name(fileName); + transferRes->set_size(boost::filesystem::file_size(pathStream.str())); + + transferRes->set_state(Response::Transfer::ACCEPTED); + transferRes->set_status("File found"); + } + catch(std::exception& ex) + { + WARN_STREAM << "ProtocolManager::prepareMetadata() " + << ex.what() << " from " << m_remoteEndpoint << endl; + + transferRes->set_state(Response::Transfer::REJECTED); + transferRes->set_status(ex.what()); + } + } + else + { + WARN_STREAM << "ProtocolManager::prepareMetadata() " + << "Not validated from " << m_remoteEndpoint << endl; + + transferRes->set_state(Response::Transfer::REJECTED); + transferRes->set_status("Not validated"); + } + } + else + { + WARN_STREAM << "ProtocolManager::prepareData() " + << "Not authorised from " << m_remoteEndpoint << endl; + + transferRes->set_state(Response::Transfer::REJECTED); + transferRes->set_status("Not authorised"); + } + + return response_sp; +} + +//============================================================================== +// ProtocolManager::prepareKeepAlive() +//============================================================================== +ResponseSP ProtocolManager::prepareKeepAlive(RequestSP request_sp) +{ + ResponseSP response_sp(new Response()); + + response_sp->set_type(Response::KEEPALIVE); + + return response_sp; } } //namespace diff --git a/src/ProtocolManager.h b/src/ProtocolManager.h index ea48ee9729f9bb522c6ac07c1416ebbe24ab0221..815c662dfb29c61adb51474753bf734219addac9 100644 --- a/src/ProtocolManager.h +++ b/src/ProtocolManager.h @@ -61,8 +61,15 @@ public: protected: //------------------------------------------------------------------------------ -// [Protected] Protected methods TODO +// [Protected] Request specific methods //------------------------------------------------------------------------------ + virtual ResponseSP prepareAuthroisation(RequestSP); + + virtual ResponseSP prepareValidation(RequestSP); + + virtual ResponseSP prepareTransfer(RequestSP); + + virtual ResponseSP prepareKeepAlive(RequestSP); //------------------------------------------------------------------------------ // [Protected] Class variables @@ -76,6 +83,15 @@ protected: //Client is authorised bool m_isAuthorised; + //Table is validated + bool m_isValidated; + + //Validate schema name + std::string m_validatedSchema; + + //Validate table name + std::string m_validatedTable; + //Address and port of remote endpoint std::string m_remoteEndpoint; }; diff --git a/src/Request.pb.cc b/src/Request.pb.cc index 7efd9fa8b8a435e4ec519785e3b4ba119e7cf8dc..acfa300c7bcfff7034da708087e51234b1456e74 100644 --- a/src/Request.pb.cc +++ b/src/Request.pb.cc @@ -26,9 +26,12 @@ const ::google::protobuf::internal::GeneratedMessageReflection* const ::google::protobuf::Descriptor* Request_Authorization_descriptor_ = NULL; const ::google::protobuf::internal::GeneratedMessageReflection* Request_Authorization_reflection_ = NULL; -const ::google::protobuf::Descriptor* Request_Data_descriptor_ = NULL; +const ::google::protobuf::Descriptor* Request_Validation_descriptor_ = NULL; const ::google::protobuf::internal::GeneratedMessageReflection* - Request_Data_reflection_ = NULL; + Request_Validation_reflection_ = NULL; +const ::google::protobuf::Descriptor* Request_Transfer_descriptor_ = NULL; +const ::google::protobuf::internal::GeneratedMessageReflection* + Request_Transfer_reflection_ = NULL; const ::google::protobuf::EnumDescriptor* Request_Type_descriptor_ = NULL; } // namespace @@ -41,10 +44,11 @@ void protobuf_AssignDesc_Request_2eproto() { "Request.proto"); GOOGLE_CHECK(file != NULL); Request_descriptor_ = file->message_type(0); - static const int Request_offsets_[3] = { + static const int Request_offsets_[4] = { GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Request, type_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Request, authorization_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Request, data_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Request, validation_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Request, transfer_), }; Request_reflection_ = new ::google::protobuf::internal::GeneratedMessageReflection( @@ -73,22 +77,38 @@ void protobuf_AssignDesc_Request_2eproto() { ::google::protobuf::DescriptorPool::generated_pool(), ::google::protobuf::MessageFactory::generated_factory(), sizeof(Request_Authorization)); - Request_Data_descriptor_ = Request_descriptor_->nested_type(1); - static const int Request_Data_offsets_[2] = { - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Request_Data, file_version_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Request_Data, file_name_), + Request_Validation_descriptor_ = Request_descriptor_->nested_type(1); + static const int Request_Validation_offsets_[2] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Request_Validation, schema_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Request_Validation, table_), + }; + Request_Validation_reflection_ = + new ::google::protobuf::internal::GeneratedMessageReflection( + Request_Validation_descriptor_, + Request_Validation::default_instance_, + Request_Validation_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Request_Validation, _has_bits_[0]), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Request_Validation, _unknown_fields_), + -1, + ::google::protobuf::DescriptorPool::generated_pool(), + ::google::protobuf::MessageFactory::generated_factory(), + sizeof(Request_Validation)); + Request_Transfer_descriptor_ = Request_descriptor_->nested_type(2); + static const int Request_Transfer_offsets_[2] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Request_Transfer, file_version_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Request_Transfer, file_name_), }; - Request_Data_reflection_ = + Request_Transfer_reflection_ = new ::google::protobuf::internal::GeneratedMessageReflection( - Request_Data_descriptor_, - Request_Data::default_instance_, - Request_Data_offsets_, - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Request_Data, _has_bits_[0]), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Request_Data, _unknown_fields_), + Request_Transfer_descriptor_, + Request_Transfer::default_instance_, + Request_Transfer_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Request_Transfer, _has_bits_[0]), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Request_Transfer, _unknown_fields_), -1, ::google::protobuf::DescriptorPool::generated_pool(), ::google::protobuf::MessageFactory::generated_factory(), - sizeof(Request_Data)); + sizeof(Request_Transfer)); Request_Type_descriptor_ = Request_descriptor_->enum_type(0); } @@ -107,7 +127,9 @@ void protobuf_RegisterTypes(const ::std::string&) { ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( Request_Authorization_descriptor_, &Request_Authorization::default_instance()); ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( - Request_Data_descriptor_, &Request_Data::default_instance()); + Request_Validation_descriptor_, &Request_Validation::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + Request_Transfer_descriptor_, &Request_Transfer::default_instance()); } } // namespace @@ -117,8 +139,10 @@ void protobuf_ShutdownFile_Request_2eproto() { delete Request_reflection_; delete Request_Authorization::default_instance_; delete Request_Authorization_reflection_; - delete Request_Data::default_instance_; - delete Request_Data_reflection_; + delete Request_Validation::default_instance_; + delete Request_Validation_reflection_; + delete Request_Transfer::default_instance_; + delete Request_Transfer_reflection_; } void protobuf_AddDesc_Request_2eproto() { @@ -128,23 +152,29 @@ void protobuf_AddDesc_Request_2eproto() { GOOGLE_PROTOBUF_VERIFY_VERSION; ::google::protobuf::DescriptorPool::InternalAddGeneratedFile( - "\n\rRequest.proto\022\017DataExporter_ns\"\255\002\n\007Req" + "\n\rRequest.proto\022\017DataExporter_ns\"\302\003\n\007Req" "uest\022+\n\004type\030\001 \002(\0162\035.DataExporter_ns.Req" "uest.Type\022=\n\rauthorization\030\002 \001(\0132&.DataE" - "xporter_ns.Request.Authorization\022+\n\004data" - "\030\003 \001(\0132\035.DataExporter_ns.Request.Data\0323\n" - "\rAuthorization\022\020\n\010username\030\001 \002(\t\022\020\n\010pass" - "word\030\002 \002(\t\032/\n\004Data\022\024\n\014file_version\030\001 \002(\005" - "\022\021\n\tfile_name\030\002 \002(\t\"#\n\004Type\022\021\n\rAUTHORIZA" - "TION\020\000\022\010\n\004DATA\020\001", 336); + "xporter_ns.Request.Authorization\0227\n\nvali" + "dation\030\003 \001(\0132#.DataExporter_ns.Request.V" + "alidation\0223\n\010transfer\030\004 \001(\0132!.DataExport" + "er_ns.Request.Transfer\0323\n\rAuthorization\022" + "\020\n\010username\030\001 \002(\t\022\020\n\010password\030\002 \002(\t\032+\n\nV" + "alidation\022\016\n\006schema\030\001 \002(\t\022\r\n\005table\030\002 \002(\t" + "\0323\n\010Transfer\022\024\n\014file_version\030\001 \002(\005\022\021\n\tfi" + "le_name\030\002 \002(\t\"F\n\004Type\022\021\n\rAUTHORIZATION\020\000" + "\022\016\n\nVALIDATION\020\001\022\014\n\010TRANSFER\020\002\022\r\n\tKEEPAL" + "IVE\020\003", 485); ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile( "Request.proto", &protobuf_RegisterTypes); Request::default_instance_ = new Request(); Request_Authorization::default_instance_ = new Request_Authorization(); - Request_Data::default_instance_ = new Request_Data(); + Request_Validation::default_instance_ = new Request_Validation(); + Request_Transfer::default_instance_ = new Request_Transfer(); Request::default_instance_->InitAsDefaultInstance(); Request_Authorization::default_instance_->InitAsDefaultInstance(); - Request_Data::default_instance_->InitAsDefaultInstance(); + Request_Validation::default_instance_->InitAsDefaultInstance(); + Request_Transfer::default_instance_->InitAsDefaultInstance(); ::google::protobuf::internal::OnShutdown(&protobuf_ShutdownFile_Request_2eproto); } @@ -165,6 +195,8 @@ bool Request_Type_IsValid(int value) { switch(value) { case 0: case 1: + case 2: + case 3: return true; default: return false; @@ -173,7 +205,9 @@ bool Request_Type_IsValid(int value) { #ifndef _MSC_VER const Request_Type Request::AUTHORIZATION; -const Request_Type Request::DATA; +const Request_Type Request::VALIDATION; +const Request_Type Request::TRANSFER; +const Request_Type Request::KEEPALIVE; const Request_Type Request::Type_MIN; const Request_Type Request::Type_MAX; const int Request::Type_ARRAYSIZE; @@ -462,36 +496,319 @@ void Request_Authorization::Swap(Request_Authorization* other) { // ------------------------------------------------------------------- #ifndef _MSC_VER -const int Request_Data::kFileVersionFieldNumber; -const int Request_Data::kFileNameFieldNumber; +const int Request_Validation::kSchemaFieldNumber; +const int Request_Validation::kTableFieldNumber; +#endif // !_MSC_VER + +Request_Validation::Request_Validation() + : ::google::protobuf::Message() { + SharedCtor(); +} + +void Request_Validation::InitAsDefaultInstance() { +} + +Request_Validation::Request_Validation(const Request_Validation& from) + : ::google::protobuf::Message() { + SharedCtor(); + MergeFrom(from); +} + +void Request_Validation::SharedCtor() { + _cached_size_ = 0; + schema_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); + table_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +Request_Validation::~Request_Validation() { + SharedDtor(); +} + +void Request_Validation::SharedDtor() { + if (schema_ != &::google::protobuf::internal::kEmptyString) { + delete schema_; + } + if (table_ != &::google::protobuf::internal::kEmptyString) { + delete table_; + } + if (this != default_instance_) { + } +} + +void Request_Validation::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* Request_Validation::descriptor() { + protobuf_AssignDescriptorsOnce(); + return Request_Validation_descriptor_; +} + +const Request_Validation& Request_Validation::default_instance() { + if (default_instance_ == NULL) protobuf_AddDesc_Request_2eproto(); + return *default_instance_; +} + +Request_Validation* Request_Validation::default_instance_ = NULL; + +Request_Validation* Request_Validation::New() const { + return new Request_Validation; +} + +void Request_Validation::Clear() { + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (has_schema()) { + if (schema_ != &::google::protobuf::internal::kEmptyString) { + schema_->clear(); + } + } + if (has_table()) { + if (table_ != &::google::protobuf::internal::kEmptyString) { + table_->clear(); + } + } + } + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->Clear(); +} + +bool Request_Validation::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) return false + ::google::protobuf::uint32 tag; + while ((tag = input->ReadTag()) != 0) { + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // required string schema = 1; + case 1: { + if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_schema())); + ::google::protobuf::internal::WireFormat::VerifyUTF8String( + this->schema().data(), this->schema().length(), + ::google::protobuf::internal::WireFormat::PARSE); + } else { + goto handle_uninterpreted; + } + if (input->ExpectTag(18)) goto parse_table; + break; + } + + // required string table = 2; + case 2: { + if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { + parse_table: + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_table())); + ::google::protobuf::internal::WireFormat::VerifyUTF8String( + this->table().data(), this->table().length(), + ::google::protobuf::internal::WireFormat::PARSE); + } else { + goto handle_uninterpreted; + } + if (input->ExpectAtEnd()) return true; + break; + } + + default: { + handle_uninterpreted: + if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + return true; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, mutable_unknown_fields())); + break; + } + } + } + return true; +#undef DO_ +} + +void Request_Validation::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // required string schema = 1; + if (has_schema()) { + ::google::protobuf::internal::WireFormat::VerifyUTF8String( + this->schema().data(), this->schema().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE); + ::google::protobuf::internal::WireFormatLite::WriteString( + 1, this->schema(), output); + } + + // required string table = 2; + if (has_table()) { + ::google::protobuf::internal::WireFormat::VerifyUTF8String( + this->table().data(), this->table().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE); + ::google::protobuf::internal::WireFormatLite::WriteString( + 2, this->table(), output); + } + + if (!unknown_fields().empty()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } +} + +::google::protobuf::uint8* Request_Validation::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // required string schema = 1; + if (has_schema()) { + ::google::protobuf::internal::WireFormat::VerifyUTF8String( + this->schema().data(), this->schema().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 1, this->schema(), target); + } + + // required string table = 2; + if (has_table()) { + ::google::protobuf::internal::WireFormat::VerifyUTF8String( + this->table().data(), this->table().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 2, this->table(), target); + } + + if (!unknown_fields().empty()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + return target; +} + +int Request_Validation::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // required string schema = 1; + if (has_schema()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->schema()); + } + + // required string table = 2; + if (has_table()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->table()); + } + + } + if (!unknown_fields().empty()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void Request_Validation::MergeFrom(const ::google::protobuf::Message& from) { + GOOGLE_CHECK_NE(&from, this); + const Request_Validation* source = + ::google::protobuf::internal::dynamic_cast_if_available<const Request_Validation*>( + &from); + if (source == NULL) { + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + MergeFrom(*source); + } +} + +void Request_Validation::MergeFrom(const Request_Validation& from) { + GOOGLE_CHECK_NE(&from, this); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_schema()) { + set_schema(from.schema()); + } + if (from.has_table()) { + set_table(from.table()); + } + } + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); +} + +void Request_Validation::CopyFrom(const ::google::protobuf::Message& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void Request_Validation::CopyFrom(const Request_Validation& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool Request_Validation::IsInitialized() const { + if ((_has_bits_[0] & 0x00000003) != 0x00000003) return false; + + return true; +} + +void Request_Validation::Swap(Request_Validation* other) { + if (other != this) { + std::swap(schema_, other->schema_); + std::swap(table_, other->table_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _unknown_fields_.Swap(&other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); + } +} + +::google::protobuf::Metadata Request_Validation::GetMetadata() const { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::Metadata metadata; + metadata.descriptor = Request_Validation_descriptor_; + metadata.reflection = Request_Validation_reflection_; + return metadata; +} + + +// ------------------------------------------------------------------- + +#ifndef _MSC_VER +const int Request_Transfer::kFileVersionFieldNumber; +const int Request_Transfer::kFileNameFieldNumber; #endif // !_MSC_VER -Request_Data::Request_Data() +Request_Transfer::Request_Transfer() : ::google::protobuf::Message() { SharedCtor(); } -void Request_Data::InitAsDefaultInstance() { +void Request_Transfer::InitAsDefaultInstance() { } -Request_Data::Request_Data(const Request_Data& from) +Request_Transfer::Request_Transfer(const Request_Transfer& from) : ::google::protobuf::Message() { SharedCtor(); MergeFrom(from); } -void Request_Data::SharedCtor() { +void Request_Transfer::SharedCtor() { _cached_size_ = 0; file_version_ = 0; file_name_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); ::memset(_has_bits_, 0, sizeof(_has_bits_)); } -Request_Data::~Request_Data() { +Request_Transfer::~Request_Transfer() { SharedDtor(); } -void Request_Data::SharedDtor() { +void Request_Transfer::SharedDtor() { if (file_name_ != &::google::protobuf::internal::kEmptyString) { delete file_name_; } @@ -499,28 +816,28 @@ void Request_Data::SharedDtor() { } } -void Request_Data::SetCachedSize(int size) const { +void Request_Transfer::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); } -const ::google::protobuf::Descriptor* Request_Data::descriptor() { +const ::google::protobuf::Descriptor* Request_Transfer::descriptor() { protobuf_AssignDescriptorsOnce(); - return Request_Data_descriptor_; + return Request_Transfer_descriptor_; } -const Request_Data& Request_Data::default_instance() { +const Request_Transfer& Request_Transfer::default_instance() { if (default_instance_ == NULL) protobuf_AddDesc_Request_2eproto(); return *default_instance_; } -Request_Data* Request_Data::default_instance_ = NULL; +Request_Transfer* Request_Transfer::default_instance_ = NULL; -Request_Data* Request_Data::New() const { - return new Request_Data; +Request_Transfer* Request_Transfer::New() const { + return new Request_Transfer; } -void Request_Data::Clear() { +void Request_Transfer::Clear() { if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { file_version_ = 0; if (has_file_name()) { @@ -533,7 +850,7 @@ void Request_Data::Clear() { mutable_unknown_fields()->Clear(); } -bool Request_Data::MergePartialFromCodedStream( +bool Request_Transfer::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!(EXPRESSION)) return false ::google::protobuf::uint32 tag; @@ -587,7 +904,7 @@ bool Request_Data::MergePartialFromCodedStream( #undef DO_ } -void Request_Data::SerializeWithCachedSizes( +void Request_Transfer::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { // required int32 file_version = 1; if (has_file_version()) { @@ -609,7 +926,7 @@ void Request_Data::SerializeWithCachedSizes( } } -::google::protobuf::uint8* Request_Data::SerializeWithCachedSizesToArray( +::google::protobuf::uint8* Request_Transfer::SerializeWithCachedSizesToArray( ::google::protobuf::uint8* target) const { // required int32 file_version = 1; if (has_file_version()) { @@ -633,7 +950,7 @@ void Request_Data::SerializeWithCachedSizes( return target; } -int Request_Data::ByteSize() const { +int Request_Transfer::ByteSize() const { int total_size = 0; if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { @@ -663,10 +980,10 @@ int Request_Data::ByteSize() const { return total_size; } -void Request_Data::MergeFrom(const ::google::protobuf::Message& from) { +void Request_Transfer::MergeFrom(const ::google::protobuf::Message& from) { GOOGLE_CHECK_NE(&from, this); - const Request_Data* source = - ::google::protobuf::internal::dynamic_cast_if_available<const Request_Data*>( + const Request_Transfer* source = + ::google::protobuf::internal::dynamic_cast_if_available<const Request_Transfer*>( &from); if (source == NULL) { ::google::protobuf::internal::ReflectionOps::Merge(from, this); @@ -675,7 +992,7 @@ void Request_Data::MergeFrom(const ::google::protobuf::Message& from) { } } -void Request_Data::MergeFrom(const Request_Data& from) { +void Request_Transfer::MergeFrom(const Request_Transfer& from) { GOOGLE_CHECK_NE(&from, this); if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { if (from.has_file_version()) { @@ -688,25 +1005,25 @@ void Request_Data::MergeFrom(const Request_Data& from) { mutable_unknown_fields()->MergeFrom(from.unknown_fields()); } -void Request_Data::CopyFrom(const ::google::protobuf::Message& from) { +void Request_Transfer::CopyFrom(const ::google::protobuf::Message& from) { if (&from == this) return; Clear(); MergeFrom(from); } -void Request_Data::CopyFrom(const Request_Data& from) { +void Request_Transfer::CopyFrom(const Request_Transfer& from) { if (&from == this) return; Clear(); MergeFrom(from); } -bool Request_Data::IsInitialized() const { +bool Request_Transfer::IsInitialized() const { if ((_has_bits_[0] & 0x00000003) != 0x00000003) return false; return true; } -void Request_Data::Swap(Request_Data* other) { +void Request_Transfer::Swap(Request_Transfer* other) { if (other != this) { std::swap(file_version_, other->file_version_); std::swap(file_name_, other->file_name_); @@ -716,11 +1033,11 @@ void Request_Data::Swap(Request_Data* other) { } } -::google::protobuf::Metadata Request_Data::GetMetadata() const { +::google::protobuf::Metadata Request_Transfer::GetMetadata() const { protobuf_AssignDescriptorsOnce(); ::google::protobuf::Metadata metadata; - metadata.descriptor = Request_Data_descriptor_; - metadata.reflection = Request_Data_reflection_; + metadata.descriptor = Request_Transfer_descriptor_; + metadata.reflection = Request_Transfer_reflection_; return metadata; } @@ -730,7 +1047,8 @@ void Request_Data::Swap(Request_Data* other) { #ifndef _MSC_VER const int Request::kTypeFieldNumber; const int Request::kAuthorizationFieldNumber; -const int Request::kDataFieldNumber; +const int Request::kValidationFieldNumber; +const int Request::kTransferFieldNumber; #endif // !_MSC_VER Request::Request() @@ -740,7 +1058,8 @@ Request::Request() void Request::InitAsDefaultInstance() { authorization_ = const_cast< ::DataExporter_ns::Request_Authorization*>(&::DataExporter_ns::Request_Authorization::default_instance()); - data_ = const_cast< ::DataExporter_ns::Request_Data*>(&::DataExporter_ns::Request_Data::default_instance()); + validation_ = const_cast< ::DataExporter_ns::Request_Validation*>(&::DataExporter_ns::Request_Validation::default_instance()); + transfer_ = const_cast< ::DataExporter_ns::Request_Transfer*>(&::DataExporter_ns::Request_Transfer::default_instance()); } Request::Request(const Request& from) @@ -753,7 +1072,8 @@ void Request::SharedCtor() { _cached_size_ = 0; type_ = 0; authorization_ = NULL; - data_ = NULL; + validation_ = NULL; + transfer_ = NULL; ::memset(_has_bits_, 0, sizeof(_has_bits_)); } @@ -764,7 +1084,8 @@ Request::~Request() { void Request::SharedDtor() { if (this != default_instance_) { delete authorization_; - delete data_; + delete validation_; + delete transfer_; } } @@ -795,8 +1116,11 @@ void Request::Clear() { if (has_authorization()) { if (authorization_ != NULL) authorization_->::DataExporter_ns::Request_Authorization::Clear(); } - if (has_data()) { - if (data_ != NULL) data_->::DataExporter_ns::Request_Data::Clear(); + if (has_validation()) { + if (validation_ != NULL) validation_->::DataExporter_ns::Request_Validation::Clear(); + } + if (has_transfer()) { + if (transfer_ != NULL) transfer_->::DataExporter_ns::Request_Transfer::Clear(); } } ::memset(_has_bits_, 0, sizeof(_has_bits_)); @@ -839,17 +1163,31 @@ bool Request::MergePartialFromCodedStream( } else { goto handle_uninterpreted; } - if (input->ExpectTag(26)) goto parse_data; + if (input->ExpectTag(26)) goto parse_validation; break; } - // optional .DataExporter_ns.Request.Data data = 3; + // optional .DataExporter_ns.Request.Validation validation = 3; case 3: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { - parse_data: + parse_validation: DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( - input, mutable_data())); + input, mutable_validation())); + } else { + goto handle_uninterpreted; + } + if (input->ExpectTag(34)) goto parse_transfer; + break; + } + + // optional .DataExporter_ns.Request.Transfer transfer = 4; + case 4: { + if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { + parse_transfer: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_transfer())); } else { goto handle_uninterpreted; } @@ -887,10 +1225,16 @@ void Request::SerializeWithCachedSizes( 2, this->authorization(), output); } - // optional .DataExporter_ns.Request.Data data = 3; - if (has_data()) { + // optional .DataExporter_ns.Request.Validation validation = 3; + if (has_validation()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 3, this->validation(), output); + } + + // optional .DataExporter_ns.Request.Transfer transfer = 4; + if (has_transfer()) { ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( - 3, this->data(), output); + 4, this->transfer(), output); } if (!unknown_fields().empty()) { @@ -914,11 +1258,18 @@ void Request::SerializeWithCachedSizes( 2, this->authorization(), target); } - // optional .DataExporter_ns.Request.Data data = 3; - if (has_data()) { + // optional .DataExporter_ns.Request.Validation validation = 3; + if (has_validation()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 3, this->validation(), target); + } + + // optional .DataExporter_ns.Request.Transfer transfer = 4; + if (has_transfer()) { target = ::google::protobuf::internal::WireFormatLite:: WriteMessageNoVirtualToArray( - 3, this->data(), target); + 4, this->transfer(), target); } if (!unknown_fields().empty()) { @@ -945,11 +1296,18 @@ int Request::ByteSize() const { this->authorization()); } - // optional .DataExporter_ns.Request.Data data = 3; - if (has_data()) { + // optional .DataExporter_ns.Request.Validation validation = 3; + if (has_validation()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( - this->data()); + this->validation()); + } + + // optional .DataExporter_ns.Request.Transfer transfer = 4; + if (has_transfer()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->transfer()); } } @@ -985,8 +1343,11 @@ void Request::MergeFrom(const Request& from) { if (from.has_authorization()) { mutable_authorization()->::DataExporter_ns::Request_Authorization::MergeFrom(from.authorization()); } - if (from.has_data()) { - mutable_data()->::DataExporter_ns::Request_Data::MergeFrom(from.data()); + if (from.has_validation()) { + mutable_validation()->::DataExporter_ns::Request_Validation::MergeFrom(from.validation()); + } + if (from.has_transfer()) { + mutable_transfer()->::DataExporter_ns::Request_Transfer::MergeFrom(from.transfer()); } } mutable_unknown_fields()->MergeFrom(from.unknown_fields()); @@ -1010,8 +1371,11 @@ bool Request::IsInitialized() const { if (has_authorization()) { if (!this->authorization().IsInitialized()) return false; } - if (has_data()) { - if (!this->data().IsInitialized()) return false; + if (has_validation()) { + if (!this->validation().IsInitialized()) return false; + } + if (has_transfer()) { + if (!this->transfer().IsInitialized()) return false; } return true; } @@ -1020,7 +1384,8 @@ void Request::Swap(Request* other) { if (other != this) { std::swap(type_, other->type_); std::swap(authorization_, other->authorization_); - std::swap(data_, other->data_); + std::swap(validation_, other->validation_); + std::swap(transfer_, other->transfer_); std::swap(_has_bits_[0], other->_has_bits_[0]); _unknown_fields_.Swap(&other->_unknown_fields_); std::swap(_cached_size_, other->_cached_size_); diff --git a/src/Request.pb.h b/src/Request.pb.h index 8464a129d5b097c7886af826d856410f8b7fbb5c..ae326ccb857513f1fe8524d26b9cdff7f1348c91 100644 --- a/src/Request.pb.h +++ b/src/Request.pb.h @@ -36,15 +36,18 @@ void protobuf_ShutdownFile_Request_2eproto(); class Request; class Request_Authorization; -class Request_Data; +class Request_Validation; +class Request_Transfer; enum Request_Type { Request_Type_AUTHORIZATION = 0, - Request_Type_DATA = 1 + Request_Type_VALIDATION = 1, + Request_Type_TRANSFER = 2, + Request_Type_KEEPALIVE = 3 }; bool Request_Type_IsValid(int value); const Request_Type Request_Type_Type_MIN = Request_Type_AUTHORIZATION; -const Request_Type Request_Type_Type_MAX = Request_Type_DATA; +const Request_Type Request_Type_Type_MAX = Request_Type_KEEPALIVE; const int Request_Type_Type_ARRAYSIZE = Request_Type_Type_MAX + 1; const ::google::protobuf::EnumDescriptor* Request_Type_descriptor(); @@ -161,14 +164,14 @@ class Request_Authorization : public ::google::protobuf::Message { }; // ------------------------------------------------------------------- -class Request_Data : public ::google::protobuf::Message { +class Request_Validation : public ::google::protobuf::Message { public: - Request_Data(); - virtual ~Request_Data(); + Request_Validation(); + virtual ~Request_Validation(); - Request_Data(const Request_Data& from); + Request_Validation(const Request_Validation& from); - inline Request_Data& operator=(const Request_Data& from) { + inline Request_Validation& operator=(const Request_Validation& from) { CopyFrom(from); return *this; } @@ -182,17 +185,119 @@ class Request_Data : public ::google::protobuf::Message { } static const ::google::protobuf::Descriptor* descriptor(); - static const Request_Data& default_instance(); + static const Request_Validation& default_instance(); - void Swap(Request_Data* other); + void Swap(Request_Validation* other); // implements Message ---------------------------------------------- - Request_Data* New() const; + Request_Validation* New() const; void CopyFrom(const ::google::protobuf::Message& from); void MergeFrom(const ::google::protobuf::Message& from); - void CopyFrom(const Request_Data& from); - void MergeFrom(const Request_Data& from); + void CopyFrom(const Request_Validation& from); + void MergeFrom(const Request_Validation& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // required string schema = 1; + inline bool has_schema() const; + inline void clear_schema(); + static const int kSchemaFieldNumber = 1; + inline const ::std::string& schema() const; + inline void set_schema(const ::std::string& value); + inline void set_schema(const char* value); + inline void set_schema(const char* value, size_t size); + inline ::std::string* mutable_schema(); + inline ::std::string* release_schema(); + inline void set_allocated_schema(::std::string* schema); + + // required string table = 2; + inline bool has_table() const; + inline void clear_table(); + static const int kTableFieldNumber = 2; + inline const ::std::string& table() const; + inline void set_table(const ::std::string& value); + inline void set_table(const char* value); + inline void set_table(const char* value, size_t size); + inline ::std::string* mutable_table(); + inline ::std::string* release_table(); + inline void set_allocated_table(::std::string* table); + + // @@protoc_insertion_point(class_scope:DataExporter_ns.Request.Validation) + private: + inline void set_has_schema(); + inline void clear_has_schema(); + inline void set_has_table(); + inline void clear_has_table(); + + ::google::protobuf::UnknownFieldSet _unknown_fields_; + + ::std::string* schema_; + ::std::string* table_; + + mutable int _cached_size_; + ::google::protobuf::uint32 _has_bits_[(2 + 31) / 32]; + + friend void protobuf_AddDesc_Request_2eproto(); + friend void protobuf_AssignDesc_Request_2eproto(); + friend void protobuf_ShutdownFile_Request_2eproto(); + + void InitAsDefaultInstance(); + static Request_Validation* default_instance_; +}; +// ------------------------------------------------------------------- + +class Request_Transfer : public ::google::protobuf::Message { + public: + Request_Transfer(); + virtual ~Request_Transfer(); + + Request_Transfer(const Request_Transfer& from); + + inline Request_Transfer& operator=(const Request_Transfer& from) { + CopyFrom(from); + return *this; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const { + return _unknown_fields_; + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const Request_Transfer& default_instance(); + + void Swap(Request_Transfer* other); + + // implements Message ---------------------------------------------- + + Request_Transfer* New() const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const Request_Transfer& from); + void MergeFrom(const Request_Transfer& from); void Clear(); bool IsInitialized() const; @@ -234,7 +339,7 @@ class Request_Data : public ::google::protobuf::Message { inline ::std::string* release_file_name(); inline void set_allocated_file_name(::std::string* file_name); - // @@protoc_insertion_point(class_scope:DataExporter_ns.Request.Data) + // @@protoc_insertion_point(class_scope:DataExporter_ns.Request.Transfer) private: inline void set_has_file_version(); inline void clear_has_file_version(); @@ -254,7 +359,7 @@ class Request_Data : public ::google::protobuf::Message { friend void protobuf_ShutdownFile_Request_2eproto(); void InitAsDefaultInstance(); - static Request_Data* default_instance_; + static Request_Transfer* default_instance_; }; // ------------------------------------------------------------------- @@ -311,11 +416,14 @@ class Request : public ::google::protobuf::Message { // nested types ---------------------------------------------------- typedef Request_Authorization Authorization; - typedef Request_Data Data; + typedef Request_Validation Validation; + typedef Request_Transfer Transfer; typedef Request_Type Type; static const Type AUTHORIZATION = Request_Type_AUTHORIZATION; - static const Type DATA = Request_Type_DATA; + static const Type VALIDATION = Request_Type_VALIDATION; + static const Type TRANSFER = Request_Type_TRANSFER; + static const Type KEEPALIVE = Request_Type_KEEPALIVE; static inline bool Type_IsValid(int value) { return Request_Type_IsValid(value); } @@ -355,14 +463,23 @@ class Request : public ::google::protobuf::Message { inline ::DataExporter_ns::Request_Authorization* release_authorization(); inline void set_allocated_authorization(::DataExporter_ns::Request_Authorization* authorization); - // optional .DataExporter_ns.Request.Data data = 3; - inline bool has_data() const; - inline void clear_data(); - static const int kDataFieldNumber = 3; - inline const ::DataExporter_ns::Request_Data& data() const; - inline ::DataExporter_ns::Request_Data* mutable_data(); - inline ::DataExporter_ns::Request_Data* release_data(); - inline void set_allocated_data(::DataExporter_ns::Request_Data* data); + // optional .DataExporter_ns.Request.Validation validation = 3; + inline bool has_validation() const; + inline void clear_validation(); + static const int kValidationFieldNumber = 3; + inline const ::DataExporter_ns::Request_Validation& validation() const; + inline ::DataExporter_ns::Request_Validation* mutable_validation(); + inline ::DataExporter_ns::Request_Validation* release_validation(); + inline void set_allocated_validation(::DataExporter_ns::Request_Validation* validation); + + // optional .DataExporter_ns.Request.Transfer transfer = 4; + inline bool has_transfer() const; + inline void clear_transfer(); + static const int kTransferFieldNumber = 4; + inline const ::DataExporter_ns::Request_Transfer& transfer() const; + inline ::DataExporter_ns::Request_Transfer* mutable_transfer(); + inline ::DataExporter_ns::Request_Transfer* release_transfer(); + inline void set_allocated_transfer(::DataExporter_ns::Request_Transfer* transfer); // @@protoc_insertion_point(class_scope:DataExporter_ns.Request) private: @@ -370,17 +487,20 @@ class Request : public ::google::protobuf::Message { inline void clear_has_type(); inline void set_has_authorization(); inline void clear_has_authorization(); - inline void set_has_data(); - inline void clear_has_data(); + inline void set_has_validation(); + inline void clear_has_validation(); + inline void set_has_transfer(); + inline void clear_has_transfer(); ::google::protobuf::UnknownFieldSet _unknown_fields_; ::DataExporter_ns::Request_Authorization* authorization_; - ::DataExporter_ns::Request_Data* data_; + ::DataExporter_ns::Request_Validation* validation_; + ::DataExporter_ns::Request_Transfer* transfer_; int type_; mutable int _cached_size_; - ::google::protobuf::uint32 _has_bits_[(3 + 31) / 32]; + ::google::protobuf::uint32 _has_bits_[(4 + 31) / 32]; friend void protobuf_AddDesc_Request_2eproto(); friend void protobuf_AssignDesc_Request_2eproto(); @@ -538,78 +658,222 @@ inline void Request_Authorization::set_allocated_password(::std::string* passwor // ------------------------------------------------------------------- -// Request_Data +// Request_Validation + +// required string schema = 1; +inline bool Request_Validation::has_schema() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void Request_Validation::set_has_schema() { + _has_bits_[0] |= 0x00000001u; +} +inline void Request_Validation::clear_has_schema() { + _has_bits_[0] &= ~0x00000001u; +} +inline void Request_Validation::clear_schema() { + if (schema_ != &::google::protobuf::internal::kEmptyString) { + schema_->clear(); + } + clear_has_schema(); +} +inline const ::std::string& Request_Validation::schema() const { + return *schema_; +} +inline void Request_Validation::set_schema(const ::std::string& value) { + set_has_schema(); + if (schema_ == &::google::protobuf::internal::kEmptyString) { + schema_ = new ::std::string; + } + schema_->assign(value); +} +inline void Request_Validation::set_schema(const char* value) { + set_has_schema(); + if (schema_ == &::google::protobuf::internal::kEmptyString) { + schema_ = new ::std::string; + } + schema_->assign(value); +} +inline void Request_Validation::set_schema(const char* value, size_t size) { + set_has_schema(); + if (schema_ == &::google::protobuf::internal::kEmptyString) { + schema_ = new ::std::string; + } + schema_->assign(reinterpret_cast<const char*>(value), size); +} +inline ::std::string* Request_Validation::mutable_schema() { + set_has_schema(); + if (schema_ == &::google::protobuf::internal::kEmptyString) { + schema_ = new ::std::string; + } + return schema_; +} +inline ::std::string* Request_Validation::release_schema() { + clear_has_schema(); + if (schema_ == &::google::protobuf::internal::kEmptyString) { + return NULL; + } else { + ::std::string* temp = schema_; + schema_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); + return temp; + } +} +inline void Request_Validation::set_allocated_schema(::std::string* schema) { + if (schema_ != &::google::protobuf::internal::kEmptyString) { + delete schema_; + } + if (schema) { + set_has_schema(); + schema_ = schema; + } else { + clear_has_schema(); + schema_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); + } +} + +// required string table = 2; +inline bool Request_Validation::has_table() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +inline void Request_Validation::set_has_table() { + _has_bits_[0] |= 0x00000002u; +} +inline void Request_Validation::clear_has_table() { + _has_bits_[0] &= ~0x00000002u; +} +inline void Request_Validation::clear_table() { + if (table_ != &::google::protobuf::internal::kEmptyString) { + table_->clear(); + } + clear_has_table(); +} +inline const ::std::string& Request_Validation::table() const { + return *table_; +} +inline void Request_Validation::set_table(const ::std::string& value) { + set_has_table(); + if (table_ == &::google::protobuf::internal::kEmptyString) { + table_ = new ::std::string; + } + table_->assign(value); +} +inline void Request_Validation::set_table(const char* value) { + set_has_table(); + if (table_ == &::google::protobuf::internal::kEmptyString) { + table_ = new ::std::string; + } + table_->assign(value); +} +inline void Request_Validation::set_table(const char* value, size_t size) { + set_has_table(); + if (table_ == &::google::protobuf::internal::kEmptyString) { + table_ = new ::std::string; + } + table_->assign(reinterpret_cast<const char*>(value), size); +} +inline ::std::string* Request_Validation::mutable_table() { + set_has_table(); + if (table_ == &::google::protobuf::internal::kEmptyString) { + table_ = new ::std::string; + } + return table_; +} +inline ::std::string* Request_Validation::release_table() { + clear_has_table(); + if (table_ == &::google::protobuf::internal::kEmptyString) { + return NULL; + } else { + ::std::string* temp = table_; + table_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); + return temp; + } +} +inline void Request_Validation::set_allocated_table(::std::string* table) { + if (table_ != &::google::protobuf::internal::kEmptyString) { + delete table_; + } + if (table) { + set_has_table(); + table_ = table; + } else { + clear_has_table(); + table_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); + } +} + +// ------------------------------------------------------------------- + +// Request_Transfer // required int32 file_version = 1; -inline bool Request_Data::has_file_version() const { +inline bool Request_Transfer::has_file_version() const { return (_has_bits_[0] & 0x00000001u) != 0; } -inline void Request_Data::set_has_file_version() { +inline void Request_Transfer::set_has_file_version() { _has_bits_[0] |= 0x00000001u; } -inline void Request_Data::clear_has_file_version() { +inline void Request_Transfer::clear_has_file_version() { _has_bits_[0] &= ~0x00000001u; } -inline void Request_Data::clear_file_version() { +inline void Request_Transfer::clear_file_version() { file_version_ = 0; clear_has_file_version(); } -inline ::google::protobuf::int32 Request_Data::file_version() const { +inline ::google::protobuf::int32 Request_Transfer::file_version() const { return file_version_; } -inline void Request_Data::set_file_version(::google::protobuf::int32 value) { +inline void Request_Transfer::set_file_version(::google::protobuf::int32 value) { set_has_file_version(); file_version_ = value; } // required string file_name = 2; -inline bool Request_Data::has_file_name() const { +inline bool Request_Transfer::has_file_name() const { return (_has_bits_[0] & 0x00000002u) != 0; } -inline void Request_Data::set_has_file_name() { +inline void Request_Transfer::set_has_file_name() { _has_bits_[0] |= 0x00000002u; } -inline void Request_Data::clear_has_file_name() { +inline void Request_Transfer::clear_has_file_name() { _has_bits_[0] &= ~0x00000002u; } -inline void Request_Data::clear_file_name() { +inline void Request_Transfer::clear_file_name() { if (file_name_ != &::google::protobuf::internal::kEmptyString) { file_name_->clear(); } clear_has_file_name(); } -inline const ::std::string& Request_Data::file_name() const { +inline const ::std::string& Request_Transfer::file_name() const { return *file_name_; } -inline void Request_Data::set_file_name(const ::std::string& value) { +inline void Request_Transfer::set_file_name(const ::std::string& value) { set_has_file_name(); if (file_name_ == &::google::protobuf::internal::kEmptyString) { file_name_ = new ::std::string; } file_name_->assign(value); } -inline void Request_Data::set_file_name(const char* value) { +inline void Request_Transfer::set_file_name(const char* value) { set_has_file_name(); if (file_name_ == &::google::protobuf::internal::kEmptyString) { file_name_ = new ::std::string; } file_name_->assign(value); } -inline void Request_Data::set_file_name(const char* value, size_t size) { +inline void Request_Transfer::set_file_name(const char* value, size_t size) { set_has_file_name(); if (file_name_ == &::google::protobuf::internal::kEmptyString) { file_name_ = new ::std::string; } file_name_->assign(reinterpret_cast<const char*>(value), size); } -inline ::std::string* Request_Data::mutable_file_name() { +inline ::std::string* Request_Transfer::mutable_file_name() { set_has_file_name(); if (file_name_ == &::google::protobuf::internal::kEmptyString) { file_name_ = new ::std::string; } return file_name_; } -inline ::std::string* Request_Data::release_file_name() { +inline ::std::string* Request_Transfer::release_file_name() { clear_has_file_name(); if (file_name_ == &::google::protobuf::internal::kEmptyString) { return NULL; @@ -619,7 +883,7 @@ inline ::std::string* Request_Data::release_file_name() { return temp; } } -inline void Request_Data::set_allocated_file_name(::std::string* file_name) { +inline void Request_Transfer::set_allocated_file_name(::std::string* file_name) { if (file_name_ != &::google::protobuf::internal::kEmptyString) { delete file_name_; } @@ -697,41 +961,79 @@ inline void Request::set_allocated_authorization(::DataExporter_ns::Request_Auth } } -// optional .DataExporter_ns.Request.Data data = 3; -inline bool Request::has_data() const { +// optional .DataExporter_ns.Request.Validation validation = 3; +inline bool Request::has_validation() const { return (_has_bits_[0] & 0x00000004u) != 0; } -inline void Request::set_has_data() { +inline void Request::set_has_validation() { _has_bits_[0] |= 0x00000004u; } -inline void Request::clear_has_data() { +inline void Request::clear_has_validation() { _has_bits_[0] &= ~0x00000004u; } -inline void Request::clear_data() { - if (data_ != NULL) data_->::DataExporter_ns::Request_Data::Clear(); - clear_has_data(); +inline void Request::clear_validation() { + if (validation_ != NULL) validation_->::DataExporter_ns::Request_Validation::Clear(); + clear_has_validation(); +} +inline const ::DataExporter_ns::Request_Validation& Request::validation() const { + return validation_ != NULL ? *validation_ : *default_instance_->validation_; +} +inline ::DataExporter_ns::Request_Validation* Request::mutable_validation() { + set_has_validation(); + if (validation_ == NULL) validation_ = new ::DataExporter_ns::Request_Validation; + return validation_; +} +inline ::DataExporter_ns::Request_Validation* Request::release_validation() { + clear_has_validation(); + ::DataExporter_ns::Request_Validation* temp = validation_; + validation_ = NULL; + return temp; +} +inline void Request::set_allocated_validation(::DataExporter_ns::Request_Validation* validation) { + delete validation_; + validation_ = validation; + if (validation) { + set_has_validation(); + } else { + clear_has_validation(); + } +} + +// optional .DataExporter_ns.Request.Transfer transfer = 4; +inline bool Request::has_transfer() const { + return (_has_bits_[0] & 0x00000008u) != 0; +} +inline void Request::set_has_transfer() { + _has_bits_[0] |= 0x00000008u; +} +inline void Request::clear_has_transfer() { + _has_bits_[0] &= ~0x00000008u; +} +inline void Request::clear_transfer() { + if (transfer_ != NULL) transfer_->::DataExporter_ns::Request_Transfer::Clear(); + clear_has_transfer(); } -inline const ::DataExporter_ns::Request_Data& Request::data() const { - return data_ != NULL ? *data_ : *default_instance_->data_; +inline const ::DataExporter_ns::Request_Transfer& Request::transfer() const { + return transfer_ != NULL ? *transfer_ : *default_instance_->transfer_; } -inline ::DataExporter_ns::Request_Data* Request::mutable_data() { - set_has_data(); - if (data_ == NULL) data_ = new ::DataExporter_ns::Request_Data; - return data_; +inline ::DataExporter_ns::Request_Transfer* Request::mutable_transfer() { + set_has_transfer(); + if (transfer_ == NULL) transfer_ = new ::DataExporter_ns::Request_Transfer; + return transfer_; } -inline ::DataExporter_ns::Request_Data* Request::release_data() { - clear_has_data(); - ::DataExporter_ns::Request_Data* temp = data_; - data_ = NULL; +inline ::DataExporter_ns::Request_Transfer* Request::release_transfer() { + clear_has_transfer(); + ::DataExporter_ns::Request_Transfer* temp = transfer_; + transfer_ = NULL; return temp; } -inline void Request::set_allocated_data(::DataExporter_ns::Request_Data* data) { - delete data_; - data_ = data; - if (data) { - set_has_data(); +inline void Request::set_allocated_transfer(::DataExporter_ns::Request_Transfer* transfer) { + delete transfer_; + transfer_ = transfer; + if (transfer) { + set_has_transfer(); } else { - clear_has_data(); + clear_has_transfer(); } } diff --git a/src/Response.pb.cc b/src/Response.pb.cc index 6e1fcde68a5de253b6917e436c47cb9fcd99fbf9..e101c5203134b82506d340edb603b8561edd222d 100644 --- a/src/Response.pb.cc +++ b/src/Response.pb.cc @@ -27,10 +27,14 @@ const ::google::protobuf::Descriptor* Response_Authorization_descriptor_ = NULL; const ::google::protobuf::internal::GeneratedMessageReflection* Response_Authorization_reflection_ = NULL; const ::google::protobuf::EnumDescriptor* Response_Authorization_State_descriptor_ = NULL; -const ::google::protobuf::Descriptor* Response_Data_descriptor_ = NULL; +const ::google::protobuf::Descriptor* Response_Validation_descriptor_ = NULL; const ::google::protobuf::internal::GeneratedMessageReflection* - Response_Data_reflection_ = NULL; -const ::google::protobuf::EnumDescriptor* Response_Data_State_descriptor_ = NULL; + Response_Validation_reflection_ = NULL; +const ::google::protobuf::EnumDescriptor* Response_Validation_State_descriptor_ = NULL; +const ::google::protobuf::Descriptor* Response_Transfer_descriptor_ = NULL; +const ::google::protobuf::internal::GeneratedMessageReflection* + Response_Transfer_reflection_ = NULL; +const ::google::protobuf::EnumDescriptor* Response_Transfer_State_descriptor_ = NULL; const ::google::protobuf::EnumDescriptor* Response_Type_descriptor_ = NULL; } // namespace @@ -43,9 +47,11 @@ void protobuf_AssignDesc_Response_2eproto() { "Response.proto"); GOOGLE_CHECK(file != NULL); Response_descriptor_ = file->message_type(0); - static const int Response_offsets_[2] = { + static const int Response_offsets_[4] = { GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Response, type_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Response, authorization_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Response, validation_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Response, transfer_), }; Response_reflection_ = new ::google::protobuf::internal::GeneratedMessageReflection( @@ -75,27 +81,44 @@ void protobuf_AssignDesc_Response_2eproto() { ::google::protobuf::MessageFactory::generated_factory(), sizeof(Response_Authorization)); Response_Authorization_State_descriptor_ = Response_Authorization_descriptor_->enum_type(0); - Response_Data_descriptor_ = Response_descriptor_->nested_type(1); - static const int Response_Data_offsets_[6] = { - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Response_Data, state_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Response_Data, status_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Response_Data, file_path_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Response_Data, file_version_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Response_Data, file_name_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Response_Data, size_), + Response_Validation_descriptor_ = Response_descriptor_->nested_type(1); + static const int Response_Validation_offsets_[2] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Response_Validation, state_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Response_Validation, status_), + }; + Response_Validation_reflection_ = + new ::google::protobuf::internal::GeneratedMessageReflection( + Response_Validation_descriptor_, + Response_Validation::default_instance_, + Response_Validation_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Response_Validation, _has_bits_[0]), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Response_Validation, _unknown_fields_), + -1, + ::google::protobuf::DescriptorPool::generated_pool(), + ::google::protobuf::MessageFactory::generated_factory(), + sizeof(Response_Validation)); + Response_Validation_State_descriptor_ = Response_Validation_descriptor_->enum_type(0); + Response_Transfer_descriptor_ = Response_descriptor_->nested_type(2); + static const int Response_Transfer_offsets_[6] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Response_Transfer, state_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Response_Transfer, status_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Response_Transfer, file_path_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Response_Transfer, file_version_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Response_Transfer, file_name_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Response_Transfer, size_), }; - Response_Data_reflection_ = + Response_Transfer_reflection_ = new ::google::protobuf::internal::GeneratedMessageReflection( - Response_Data_descriptor_, - Response_Data::default_instance_, - Response_Data_offsets_, - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Response_Data, _has_bits_[0]), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Response_Data, _unknown_fields_), + Response_Transfer_descriptor_, + Response_Transfer::default_instance_, + Response_Transfer_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Response_Transfer, _has_bits_[0]), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Response_Transfer, _unknown_fields_), -1, ::google::protobuf::DescriptorPool::generated_pool(), ::google::protobuf::MessageFactory::generated_factory(), - sizeof(Response_Data)); - Response_Data_State_descriptor_ = Response_Data_descriptor_->enum_type(0); + sizeof(Response_Transfer)); + Response_Transfer_State_descriptor_ = Response_Transfer_descriptor_->enum_type(0); Response_Type_descriptor_ = Response_descriptor_->enum_type(0); } @@ -114,7 +137,9 @@ void protobuf_RegisterTypes(const ::std::string&) { ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( Response_Authorization_descriptor_, &Response_Authorization::default_instance()); ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( - Response_Data_descriptor_, &Response_Data::default_instance()); + Response_Validation_descriptor_, &Response_Validation::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + Response_Transfer_descriptor_, &Response_Transfer::default_instance()); } } // namespace @@ -124,8 +149,10 @@ void protobuf_ShutdownFile_Response_2eproto() { delete Response_reflection_; delete Response_Authorization::default_instance_; delete Response_Authorization_reflection_; - delete Response_Data::default_instance_; - delete Response_Data_reflection_; + delete Response_Validation::default_instance_; + delete Response_Validation_reflection_; + delete Response_Transfer::default_instance_; + delete Response_Transfer_reflection_; } void protobuf_AddDesc_Response_2eproto() { @@ -135,27 +162,36 @@ void protobuf_AddDesc_Response_2eproto() { GOOGLE_PROTOBUF_VERIFY_VERSION; ::google::protobuf::DescriptorPool::InternalAddGeneratedFile( - "\n\016Response.proto\022\017DataExporter_ns\"\337\003\n\010Re" + "\n\016Response.proto\022\017DataExporter_ns\"\370\005\n\010Re" "sponse\022,\n\004type\030\001 \002(\0162\036.DataExporter_ns.R" "esponse.Type\022>\n\rauthorization\030\002 \001(\0132\'.Da" - "taExporter_ns.Response.Authorization\032\202\001\n" - "\rAuthorization\022<\n\005state\030\001 \002(\0162-.DataExpo" - "rter_ns.Response.Authorization.State\022\016\n\006" - "status\030\002 \002(\t\"#\n\005State\022\014\n\010ACCEPTED\020\000\022\014\n\010R" - "EJECTED\020\001\032\272\001\n\004Data\0223\n\005state\030\001 \002(\0162$.Data" - "Exporter_ns.Response.Data.State\022\016\n\006statu" - "s\030\002 \002(\t\022\021\n\tfile_path\030\003 \002(\t\022\024\n\014file_versi" - "on\030\004 \002(\t\022\021\n\tfile_name\030\005 \002(\t\022\014\n\004size\030\006 \002(" - "\004\"#\n\005State\022\014\n\010ACCEPTED\020\000\022\014\n\010REJECTED\020\001\"#" - "\n\004Type\022\021\n\rAUTHORIZATION\020\000\022\010\n\004DATA\020\001", 515); + "taExporter_ns.Response.Authorization\0228\n\n" + "validation\030\003 \001(\0132$.DataExporter_ns.Respo" + "nse.Validation\0224\n\010transfer\030\004 \001(\0132\".DataE" + "xporter_ns.Response.Transfer\032\202\001\n\rAuthori" + "zation\022<\n\005state\030\001 \002(\0162-.DataExporter_ns." + "Response.Authorization.State\022\016\n\006status\030\002" + " \002(\t\"#\n\005State\022\014\n\010ACCEPTED\020\000\022\014\n\010REJECTED\020" + "\001\032|\n\nValidation\0229\n\005state\030\001 \002(\0162*.DataExp" + "orter_ns.Response.Validation.State\022\016\n\006st" + "atus\030\002 \002(\t\"#\n\005State\022\014\n\010ACCEPTED\020\000\022\014\n\010REJ" + "ECTED\020\001\032\302\001\n\010Transfer\0227\n\005state\030\001 \002(\0162(.Da" + "taExporter_ns.Response.Transfer.State\022\016\n" + "\006status\030\002 \002(\t\022\021\n\tfile_path\030\003 \001(\t\022\024\n\014file" + "_version\030\004 \001(\005\022\021\n\tfile_name\030\005 \001(\t\022\014\n\004siz" + "e\030\006 \001(\004\"#\n\005State\022\014\n\010ACCEPTED\020\000\022\014\n\010REJECT" + "ED\020\001\"F\n\004Type\022\021\n\rAUTHORIZATION\020\000\022\016\n\nVALID" + "ATION\020\001\022\014\n\010TRANSFER\020\002\022\r\n\tKEEPALIVE\020\003", 796); ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile( "Response.proto", &protobuf_RegisterTypes); Response::default_instance_ = new Response(); Response_Authorization::default_instance_ = new Response_Authorization(); - Response_Data::default_instance_ = new Response_Data(); + Response_Validation::default_instance_ = new Response_Validation(); + Response_Transfer::default_instance_ = new Response_Transfer(); Response::default_instance_->InitAsDefaultInstance(); Response_Authorization::default_instance_->InitAsDefaultInstance(); - Response_Data::default_instance_->InitAsDefaultInstance(); + Response_Validation::default_instance_->InitAsDefaultInstance(); + Response_Transfer::default_instance_->InitAsDefaultInstance(); ::google::protobuf::internal::OnShutdown(&protobuf_ShutdownFile_Response_2eproto); } @@ -176,6 +212,8 @@ bool Response_Type_IsValid(int value) { switch(value) { case 0: case 1: + case 2: + case 3: return true; default: return false; @@ -184,7 +222,9 @@ bool Response_Type_IsValid(int value) { #ifndef _MSC_VER const Response_Type Response::AUTHORIZATION; -const Response_Type Response::DATA; +const Response_Type Response::VALIDATION; +const Response_Type Response::TRANSFER; +const Response_Type Response::KEEPALIVE; const Response_Type Response::Type_MIN; const Response_Type Response::Type_MAX; const int Response::Type_ARRAYSIZE; @@ -482,11 +522,304 @@ void Response_Authorization::Swap(Response_Authorization* other) { // ------------------------------------------------------------------- -const ::google::protobuf::EnumDescriptor* Response_Data_State_descriptor() { +const ::google::protobuf::EnumDescriptor* Response_Validation_State_descriptor() { + protobuf_AssignDescriptorsOnce(); + return Response_Validation_State_descriptor_; +} +bool Response_Validation_State_IsValid(int value) { + switch(value) { + case 0: + case 1: + return true; + default: + return false; + } +} + +#ifndef _MSC_VER +const Response_Validation_State Response_Validation::ACCEPTED; +const Response_Validation_State Response_Validation::REJECTED; +const Response_Validation_State Response_Validation::State_MIN; +const Response_Validation_State Response_Validation::State_MAX; +const int Response_Validation::State_ARRAYSIZE; +#endif // _MSC_VER +#ifndef _MSC_VER +const int Response_Validation::kStateFieldNumber; +const int Response_Validation::kStatusFieldNumber; +#endif // !_MSC_VER + +Response_Validation::Response_Validation() + : ::google::protobuf::Message() { + SharedCtor(); +} + +void Response_Validation::InitAsDefaultInstance() { +} + +Response_Validation::Response_Validation(const Response_Validation& from) + : ::google::protobuf::Message() { + SharedCtor(); + MergeFrom(from); +} + +void Response_Validation::SharedCtor() { + _cached_size_ = 0; + state_ = 0; + status_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +Response_Validation::~Response_Validation() { + SharedDtor(); +} + +void Response_Validation::SharedDtor() { + if (status_ != &::google::protobuf::internal::kEmptyString) { + delete status_; + } + if (this != default_instance_) { + } +} + +void Response_Validation::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* Response_Validation::descriptor() { + protobuf_AssignDescriptorsOnce(); + return Response_Validation_descriptor_; +} + +const Response_Validation& Response_Validation::default_instance() { + if (default_instance_ == NULL) protobuf_AddDesc_Response_2eproto(); + return *default_instance_; +} + +Response_Validation* Response_Validation::default_instance_ = NULL; + +Response_Validation* Response_Validation::New() const { + return new Response_Validation; +} + +void Response_Validation::Clear() { + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + state_ = 0; + if (has_status()) { + if (status_ != &::google::protobuf::internal::kEmptyString) { + status_->clear(); + } + } + } + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->Clear(); +} + +bool Response_Validation::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) return false + ::google::protobuf::uint32 tag; + while ((tag = input->ReadTag()) != 0) { + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // required .DataExporter_ns.Response.Validation.State state = 1; + case 1: { + if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { + int value; + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + if (::DataExporter_ns::Response_Validation_State_IsValid(value)) { + set_state(static_cast< ::DataExporter_ns::Response_Validation_State >(value)); + } else { + mutable_unknown_fields()->AddVarint(1, value); + } + } else { + goto handle_uninterpreted; + } + if (input->ExpectTag(18)) goto parse_status; + break; + } + + // required string status = 2; + case 2: { + if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { + parse_status: + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_status())); + ::google::protobuf::internal::WireFormat::VerifyUTF8String( + this->status().data(), this->status().length(), + ::google::protobuf::internal::WireFormat::PARSE); + } else { + goto handle_uninterpreted; + } + if (input->ExpectAtEnd()) return true; + break; + } + + default: { + handle_uninterpreted: + if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + return true; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, mutable_unknown_fields())); + break; + } + } + } + return true; +#undef DO_ +} + +void Response_Validation::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // required .DataExporter_ns.Response.Validation.State state = 1; + if (has_state()) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 1, this->state(), output); + } + + // required string status = 2; + if (has_status()) { + ::google::protobuf::internal::WireFormat::VerifyUTF8String( + this->status().data(), this->status().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE); + ::google::protobuf::internal::WireFormatLite::WriteString( + 2, this->status(), output); + } + + if (!unknown_fields().empty()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } +} + +::google::protobuf::uint8* Response_Validation::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // required .DataExporter_ns.Response.Validation.State state = 1; + if (has_state()) { + target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( + 1, this->state(), target); + } + + // required string status = 2; + if (has_status()) { + ::google::protobuf::internal::WireFormat::VerifyUTF8String( + this->status().data(), this->status().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 2, this->status(), target); + } + + if (!unknown_fields().empty()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + return target; +} + +int Response_Validation::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // required .DataExporter_ns.Response.Validation.State state = 1; + if (has_state()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->state()); + } + + // required string status = 2; + if (has_status()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->status()); + } + + } + if (!unknown_fields().empty()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void Response_Validation::MergeFrom(const ::google::protobuf::Message& from) { + GOOGLE_CHECK_NE(&from, this); + const Response_Validation* source = + ::google::protobuf::internal::dynamic_cast_if_available<const Response_Validation*>( + &from); + if (source == NULL) { + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + MergeFrom(*source); + } +} + +void Response_Validation::MergeFrom(const Response_Validation& from) { + GOOGLE_CHECK_NE(&from, this); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_state()) { + set_state(from.state()); + } + if (from.has_status()) { + set_status(from.status()); + } + } + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); +} + +void Response_Validation::CopyFrom(const ::google::protobuf::Message& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void Response_Validation::CopyFrom(const Response_Validation& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool Response_Validation::IsInitialized() const { + if ((_has_bits_[0] & 0x00000003) != 0x00000003) return false; + + return true; +} + +void Response_Validation::Swap(Response_Validation* other) { + if (other != this) { + std::swap(state_, other->state_); + std::swap(status_, other->status_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _unknown_fields_.Swap(&other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); + } +} + +::google::protobuf::Metadata Response_Validation::GetMetadata() const { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::Metadata metadata; + metadata.descriptor = Response_Validation_descriptor_; + metadata.reflection = Response_Validation_reflection_; + return metadata; +} + + +// ------------------------------------------------------------------- + +const ::google::protobuf::EnumDescriptor* Response_Transfer_State_descriptor() { protobuf_AssignDescriptorsOnce(); - return Response_Data_State_descriptor_; + return Response_Transfer_State_descriptor_; } -bool Response_Data_State_IsValid(int value) { +bool Response_Transfer_State_IsValid(int value) { switch(value) { case 0: case 1: @@ -497,60 +830,57 @@ bool Response_Data_State_IsValid(int value) { } #ifndef _MSC_VER -const Response_Data_State Response_Data::ACCEPTED; -const Response_Data_State Response_Data::REJECTED; -const Response_Data_State Response_Data::State_MIN; -const Response_Data_State Response_Data::State_MAX; -const int Response_Data::State_ARRAYSIZE; +const Response_Transfer_State Response_Transfer::ACCEPTED; +const Response_Transfer_State Response_Transfer::REJECTED; +const Response_Transfer_State Response_Transfer::State_MIN; +const Response_Transfer_State Response_Transfer::State_MAX; +const int Response_Transfer::State_ARRAYSIZE; #endif // _MSC_VER #ifndef _MSC_VER -const int Response_Data::kStateFieldNumber; -const int Response_Data::kStatusFieldNumber; -const int Response_Data::kFilePathFieldNumber; -const int Response_Data::kFileVersionFieldNumber; -const int Response_Data::kFileNameFieldNumber; -const int Response_Data::kSizeFieldNumber; +const int Response_Transfer::kStateFieldNumber; +const int Response_Transfer::kStatusFieldNumber; +const int Response_Transfer::kFilePathFieldNumber; +const int Response_Transfer::kFileVersionFieldNumber; +const int Response_Transfer::kFileNameFieldNumber; +const int Response_Transfer::kSizeFieldNumber; #endif // !_MSC_VER -Response_Data::Response_Data() +Response_Transfer::Response_Transfer() : ::google::protobuf::Message() { SharedCtor(); } -void Response_Data::InitAsDefaultInstance() { +void Response_Transfer::InitAsDefaultInstance() { } -Response_Data::Response_Data(const Response_Data& from) +Response_Transfer::Response_Transfer(const Response_Transfer& from) : ::google::protobuf::Message() { SharedCtor(); MergeFrom(from); } -void Response_Data::SharedCtor() { +void Response_Transfer::SharedCtor() { _cached_size_ = 0; state_ = 0; status_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); file_path_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); - file_version_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); + file_version_ = 0; file_name_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); size_ = GOOGLE_ULONGLONG(0); ::memset(_has_bits_, 0, sizeof(_has_bits_)); } -Response_Data::~Response_Data() { +Response_Transfer::~Response_Transfer() { SharedDtor(); } -void Response_Data::SharedDtor() { +void Response_Transfer::SharedDtor() { if (status_ != &::google::protobuf::internal::kEmptyString) { delete status_; } if (file_path_ != &::google::protobuf::internal::kEmptyString) { delete file_path_; } - if (file_version_ != &::google::protobuf::internal::kEmptyString) { - delete file_version_; - } if (file_name_ != &::google::protobuf::internal::kEmptyString) { delete file_name_; } @@ -558,28 +888,28 @@ void Response_Data::SharedDtor() { } } -void Response_Data::SetCachedSize(int size) const { +void Response_Transfer::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); } -const ::google::protobuf::Descriptor* Response_Data::descriptor() { +const ::google::protobuf::Descriptor* Response_Transfer::descriptor() { protobuf_AssignDescriptorsOnce(); - return Response_Data_descriptor_; + return Response_Transfer_descriptor_; } -const Response_Data& Response_Data::default_instance() { +const Response_Transfer& Response_Transfer::default_instance() { if (default_instance_ == NULL) protobuf_AddDesc_Response_2eproto(); return *default_instance_; } -Response_Data* Response_Data::default_instance_ = NULL; +Response_Transfer* Response_Transfer::default_instance_ = NULL; -Response_Data* Response_Data::New() const { - return new Response_Data; +Response_Transfer* Response_Transfer::New() const { + return new Response_Transfer; } -void Response_Data::Clear() { +void Response_Transfer::Clear() { if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { state_ = 0; if (has_status()) { @@ -592,11 +922,7 @@ void Response_Data::Clear() { file_path_->clear(); } } - if (has_file_version()) { - if (file_version_ != &::google::protobuf::internal::kEmptyString) { - file_version_->clear(); - } - } + file_version_ = 0; if (has_file_name()) { if (file_name_ != &::google::protobuf::internal::kEmptyString) { file_name_->clear(); @@ -608,13 +934,13 @@ void Response_Data::Clear() { mutable_unknown_fields()->Clear(); } -bool Response_Data::MergePartialFromCodedStream( +bool Response_Transfer::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!(EXPRESSION)) return false ::google::protobuf::uint32 tag; while ((tag = input->ReadTag()) != 0) { switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { - // required .DataExporter_ns.Response.Data.State state = 1; + // required .DataExporter_ns.Response.Transfer.State state = 1; case 1: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { @@ -622,8 +948,8 @@ bool Response_Data::MergePartialFromCodedStream( DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( input, &value))); - if (::DataExporter_ns::Response_Data_State_IsValid(value)) { - set_state(static_cast< ::DataExporter_ns::Response_Data_State >(value)); + if (::DataExporter_ns::Response_Transfer_State_IsValid(value)) { + set_state(static_cast< ::DataExporter_ns::Response_Transfer_State >(value)); } else { mutable_unknown_fields()->AddVarint(1, value); } @@ -651,7 +977,7 @@ bool Response_Data::MergePartialFromCodedStream( break; } - // required string file_path = 3; + // optional string file_path = 3; case 3: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { @@ -664,20 +990,19 @@ bool Response_Data::MergePartialFromCodedStream( } else { goto handle_uninterpreted; } - if (input->ExpectTag(34)) goto parse_file_version; + if (input->ExpectTag(32)) goto parse_file_version; break; } - // required string file_version = 4; + // optional int32 file_version = 4; case 4: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { + ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { parse_file_version: - DO_(::google::protobuf::internal::WireFormatLite::ReadString( - input, this->mutable_file_version())); - ::google::protobuf::internal::WireFormat::VerifyUTF8String( - this->file_version().data(), this->file_version().length(), - ::google::protobuf::internal::WireFormat::PARSE); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &file_version_))); + set_has_file_version(); } else { goto handle_uninterpreted; } @@ -685,7 +1010,7 @@ bool Response_Data::MergePartialFromCodedStream( break; } - // required string file_name = 5; + // optional string file_name = 5; case 5: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { @@ -702,7 +1027,7 @@ bool Response_Data::MergePartialFromCodedStream( break; } - // required uint64 size = 6; + // optional uint64 size = 6; case 6: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { @@ -734,9 +1059,9 @@ bool Response_Data::MergePartialFromCodedStream( #undef DO_ } -void Response_Data::SerializeWithCachedSizes( +void Response_Transfer::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { - // required .DataExporter_ns.Response.Data.State state = 1; + // required .DataExporter_ns.Response.Transfer.State state = 1; if (has_state()) { ::google::protobuf::internal::WireFormatLite::WriteEnum( 1, this->state(), output); @@ -751,7 +1076,7 @@ void Response_Data::SerializeWithCachedSizes( 2, this->status(), output); } - // required string file_path = 3; + // optional string file_path = 3; if (has_file_path()) { ::google::protobuf::internal::WireFormat::VerifyUTF8String( this->file_path().data(), this->file_path().length(), @@ -760,16 +1085,12 @@ void Response_Data::SerializeWithCachedSizes( 3, this->file_path(), output); } - // required string file_version = 4; + // optional int32 file_version = 4; if (has_file_version()) { - ::google::protobuf::internal::WireFormat::VerifyUTF8String( - this->file_version().data(), this->file_version().length(), - ::google::protobuf::internal::WireFormat::SERIALIZE); - ::google::protobuf::internal::WireFormatLite::WriteString( - 4, this->file_version(), output); + ::google::protobuf::internal::WireFormatLite::WriteInt32(4, this->file_version(), output); } - // required string file_name = 5; + // optional string file_name = 5; if (has_file_name()) { ::google::protobuf::internal::WireFormat::VerifyUTF8String( this->file_name().data(), this->file_name().length(), @@ -778,7 +1099,7 @@ void Response_Data::SerializeWithCachedSizes( 5, this->file_name(), output); } - // required uint64 size = 6; + // optional uint64 size = 6; if (has_size()) { ::google::protobuf::internal::WireFormatLite::WriteUInt64(6, this->size(), output); } @@ -789,9 +1110,9 @@ void Response_Data::SerializeWithCachedSizes( } } -::google::protobuf::uint8* Response_Data::SerializeWithCachedSizesToArray( +::google::protobuf::uint8* Response_Transfer::SerializeWithCachedSizesToArray( ::google::protobuf::uint8* target) const { - // required .DataExporter_ns.Response.Data.State state = 1; + // required .DataExporter_ns.Response.Transfer.State state = 1; if (has_state()) { target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( 1, this->state(), target); @@ -807,7 +1128,7 @@ void Response_Data::SerializeWithCachedSizes( 2, this->status(), target); } - // required string file_path = 3; + // optional string file_path = 3; if (has_file_path()) { ::google::protobuf::internal::WireFormat::VerifyUTF8String( this->file_path().data(), this->file_path().length(), @@ -817,17 +1138,12 @@ void Response_Data::SerializeWithCachedSizes( 3, this->file_path(), target); } - // required string file_version = 4; + // optional int32 file_version = 4; if (has_file_version()) { - ::google::protobuf::internal::WireFormat::VerifyUTF8String( - this->file_version().data(), this->file_version().length(), - ::google::protobuf::internal::WireFormat::SERIALIZE); - target = - ::google::protobuf::internal::WireFormatLite::WriteStringToArray( - 4, this->file_version(), target); + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(4, this->file_version(), target); } - // required string file_name = 5; + // optional string file_name = 5; if (has_file_name()) { ::google::protobuf::internal::WireFormat::VerifyUTF8String( this->file_name().data(), this->file_name().length(), @@ -837,7 +1153,7 @@ void Response_Data::SerializeWithCachedSizes( 5, this->file_name(), target); } - // required uint64 size = 6; + // optional uint64 size = 6; if (has_size()) { target = ::google::protobuf::internal::WireFormatLite::WriteUInt64ToArray(6, this->size(), target); } @@ -849,11 +1165,11 @@ void Response_Data::SerializeWithCachedSizes( return target; } -int Response_Data::ByteSize() const { +int Response_Transfer::ByteSize() const { int total_size = 0; if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { - // required .DataExporter_ns.Response.Data.State state = 1; + // required .DataExporter_ns.Response.Transfer.State state = 1; if (has_state()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::EnumSize(this->state()); @@ -866,28 +1182,28 @@ int Response_Data::ByteSize() const { this->status()); } - // required string file_path = 3; + // optional string file_path = 3; if (has_file_path()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( this->file_path()); } - // required string file_version = 4; + // optional int32 file_version = 4; if (has_file_version()) { total_size += 1 + - ::google::protobuf::internal::WireFormatLite::StringSize( + ::google::protobuf::internal::WireFormatLite::Int32Size( this->file_version()); } - // required string file_name = 5; + // optional string file_name = 5; if (has_file_name()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( this->file_name()); } - // required uint64 size = 6; + // optional uint64 size = 6; if (has_size()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::UInt64Size( @@ -906,10 +1222,10 @@ int Response_Data::ByteSize() const { return total_size; } -void Response_Data::MergeFrom(const ::google::protobuf::Message& from) { +void Response_Transfer::MergeFrom(const ::google::protobuf::Message& from) { GOOGLE_CHECK_NE(&from, this); - const Response_Data* source = - ::google::protobuf::internal::dynamic_cast_if_available<const Response_Data*>( + const Response_Transfer* source = + ::google::protobuf::internal::dynamic_cast_if_available<const Response_Transfer*>( &from); if (source == NULL) { ::google::protobuf::internal::ReflectionOps::Merge(from, this); @@ -918,7 +1234,7 @@ void Response_Data::MergeFrom(const ::google::protobuf::Message& from) { } } -void Response_Data::MergeFrom(const Response_Data& from) { +void Response_Transfer::MergeFrom(const Response_Transfer& from) { GOOGLE_CHECK_NE(&from, this); if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { if (from.has_state()) { @@ -943,25 +1259,25 @@ void Response_Data::MergeFrom(const Response_Data& from) { mutable_unknown_fields()->MergeFrom(from.unknown_fields()); } -void Response_Data::CopyFrom(const ::google::protobuf::Message& from) { +void Response_Transfer::CopyFrom(const ::google::protobuf::Message& from) { if (&from == this) return; Clear(); MergeFrom(from); } -void Response_Data::CopyFrom(const Response_Data& from) { +void Response_Transfer::CopyFrom(const Response_Transfer& from) { if (&from == this) return; Clear(); MergeFrom(from); } -bool Response_Data::IsInitialized() const { - if ((_has_bits_[0] & 0x0000003f) != 0x0000003f) return false; +bool Response_Transfer::IsInitialized() const { + if ((_has_bits_[0] & 0x00000003) != 0x00000003) return false; return true; } -void Response_Data::Swap(Response_Data* other) { +void Response_Transfer::Swap(Response_Transfer* other) { if (other != this) { std::swap(state_, other->state_); std::swap(status_, other->status_); @@ -975,11 +1291,11 @@ void Response_Data::Swap(Response_Data* other) { } } -::google::protobuf::Metadata Response_Data::GetMetadata() const { +::google::protobuf::Metadata Response_Transfer::GetMetadata() const { protobuf_AssignDescriptorsOnce(); ::google::protobuf::Metadata metadata; - metadata.descriptor = Response_Data_descriptor_; - metadata.reflection = Response_Data_reflection_; + metadata.descriptor = Response_Transfer_descriptor_; + metadata.reflection = Response_Transfer_reflection_; return metadata; } @@ -989,6 +1305,8 @@ void Response_Data::Swap(Response_Data* other) { #ifndef _MSC_VER const int Response::kTypeFieldNumber; const int Response::kAuthorizationFieldNumber; +const int Response::kValidationFieldNumber; +const int Response::kTransferFieldNumber; #endif // !_MSC_VER Response::Response() @@ -998,6 +1316,8 @@ Response::Response() void Response::InitAsDefaultInstance() { authorization_ = const_cast< ::DataExporter_ns::Response_Authorization*>(&::DataExporter_ns::Response_Authorization::default_instance()); + validation_ = const_cast< ::DataExporter_ns::Response_Validation*>(&::DataExporter_ns::Response_Validation::default_instance()); + transfer_ = const_cast< ::DataExporter_ns::Response_Transfer*>(&::DataExporter_ns::Response_Transfer::default_instance()); } Response::Response(const Response& from) @@ -1010,6 +1330,8 @@ void Response::SharedCtor() { _cached_size_ = 0; type_ = 0; authorization_ = NULL; + validation_ = NULL; + transfer_ = NULL; ::memset(_has_bits_, 0, sizeof(_has_bits_)); } @@ -1020,6 +1342,8 @@ Response::~Response() { void Response::SharedDtor() { if (this != default_instance_) { delete authorization_; + delete validation_; + delete transfer_; } } @@ -1050,6 +1374,12 @@ void Response::Clear() { if (has_authorization()) { if (authorization_ != NULL) authorization_->::DataExporter_ns::Response_Authorization::Clear(); } + if (has_validation()) { + if (validation_ != NULL) validation_->::DataExporter_ns::Response_Validation::Clear(); + } + if (has_transfer()) { + if (transfer_ != NULL) transfer_->::DataExporter_ns::Response_Transfer::Clear(); + } } ::memset(_has_bits_, 0, sizeof(_has_bits_)); mutable_unknown_fields()->Clear(); @@ -1091,6 +1421,34 @@ bool Response::MergePartialFromCodedStream( } else { goto handle_uninterpreted; } + if (input->ExpectTag(26)) goto parse_validation; + break; + } + + // optional .DataExporter_ns.Response.Validation validation = 3; + case 3: { + if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { + parse_validation: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_validation())); + } else { + goto handle_uninterpreted; + } + if (input->ExpectTag(34)) goto parse_transfer; + break; + } + + // optional .DataExporter_ns.Response.Transfer transfer = 4; + case 4: { + if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { + parse_transfer: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_transfer())); + } else { + goto handle_uninterpreted; + } if (input->ExpectAtEnd()) return true; break; } @@ -1125,6 +1483,18 @@ void Response::SerializeWithCachedSizes( 2, this->authorization(), output); } + // optional .DataExporter_ns.Response.Validation validation = 3; + if (has_validation()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 3, this->validation(), output); + } + + // optional .DataExporter_ns.Response.Transfer transfer = 4; + if (has_transfer()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 4, this->transfer(), output); + } + if (!unknown_fields().empty()) { ::google::protobuf::internal::WireFormat::SerializeUnknownFields( unknown_fields(), output); @@ -1146,6 +1516,20 @@ void Response::SerializeWithCachedSizes( 2, this->authorization(), target); } + // optional .DataExporter_ns.Response.Validation validation = 3; + if (has_validation()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 3, this->validation(), target); + } + + // optional .DataExporter_ns.Response.Transfer transfer = 4; + if (has_transfer()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 4, this->transfer(), target); + } + if (!unknown_fields().empty()) { target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( unknown_fields(), target); @@ -1170,6 +1554,20 @@ int Response::ByteSize() const { this->authorization()); } + // optional .DataExporter_ns.Response.Validation validation = 3; + if (has_validation()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->validation()); + } + + // optional .DataExporter_ns.Response.Transfer transfer = 4; + if (has_transfer()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->transfer()); + } + } if (!unknown_fields().empty()) { total_size += @@ -1203,6 +1601,12 @@ void Response::MergeFrom(const Response& from) { if (from.has_authorization()) { mutable_authorization()->::DataExporter_ns::Response_Authorization::MergeFrom(from.authorization()); } + if (from.has_validation()) { + mutable_validation()->::DataExporter_ns::Response_Validation::MergeFrom(from.validation()); + } + if (from.has_transfer()) { + mutable_transfer()->::DataExporter_ns::Response_Transfer::MergeFrom(from.transfer()); + } } mutable_unknown_fields()->MergeFrom(from.unknown_fields()); } @@ -1225,6 +1629,12 @@ bool Response::IsInitialized() const { if (has_authorization()) { if (!this->authorization().IsInitialized()) return false; } + if (has_validation()) { + if (!this->validation().IsInitialized()) return false; + } + if (has_transfer()) { + if (!this->transfer().IsInitialized()) return false; + } return true; } @@ -1232,6 +1642,8 @@ void Response::Swap(Response* other) { if (other != this) { std::swap(type_, other->type_); std::swap(authorization_, other->authorization_); + std::swap(validation_, other->validation_); + std::swap(transfer_, other->transfer_); std::swap(_has_bits_[0], other->_has_bits_[0]); _unknown_fields_.Swap(&other->_unknown_fields_); std::swap(_cached_size_, other->_cached_size_); diff --git a/src/Response.pb.h b/src/Response.pb.h index 00b4817167e5083883bbfd44473f5478bb71b117..59a3a8c20528a898e0a3d94861840334b26c8536 100644 --- a/src/Response.pb.h +++ b/src/Response.pb.h @@ -36,7 +36,8 @@ void protobuf_ShutdownFile_Response_2eproto(); class Response; class Response_Authorization; -class Response_Data; +class Response_Validation; +class Response_Transfer; enum Response_Authorization_State { Response_Authorization_State_ACCEPTED = 0, @@ -57,32 +58,53 @@ inline bool Response_Authorization_State_Parse( return ::google::protobuf::internal::ParseNamedEnum<Response_Authorization_State>( Response_Authorization_State_descriptor(), name, value); } -enum Response_Data_State { - Response_Data_State_ACCEPTED = 0, - Response_Data_State_REJECTED = 1 +enum Response_Validation_State { + Response_Validation_State_ACCEPTED = 0, + Response_Validation_State_REJECTED = 1 }; -bool Response_Data_State_IsValid(int value); -const Response_Data_State Response_Data_State_State_MIN = Response_Data_State_ACCEPTED; -const Response_Data_State Response_Data_State_State_MAX = Response_Data_State_REJECTED; -const int Response_Data_State_State_ARRAYSIZE = Response_Data_State_State_MAX + 1; +bool Response_Validation_State_IsValid(int value); +const Response_Validation_State Response_Validation_State_State_MIN = Response_Validation_State_ACCEPTED; +const Response_Validation_State Response_Validation_State_State_MAX = Response_Validation_State_REJECTED; +const int Response_Validation_State_State_ARRAYSIZE = Response_Validation_State_State_MAX + 1; -const ::google::protobuf::EnumDescriptor* Response_Data_State_descriptor(); -inline const ::std::string& Response_Data_State_Name(Response_Data_State value) { +const ::google::protobuf::EnumDescriptor* Response_Validation_State_descriptor(); +inline const ::std::string& Response_Validation_State_Name(Response_Validation_State value) { return ::google::protobuf::internal::NameOfEnum( - Response_Data_State_descriptor(), value); + Response_Validation_State_descriptor(), value); } -inline bool Response_Data_State_Parse( - const ::std::string& name, Response_Data_State* value) { - return ::google::protobuf::internal::ParseNamedEnum<Response_Data_State>( - Response_Data_State_descriptor(), name, value); +inline bool Response_Validation_State_Parse( + const ::std::string& name, Response_Validation_State* value) { + return ::google::protobuf::internal::ParseNamedEnum<Response_Validation_State>( + Response_Validation_State_descriptor(), name, value); +} +enum Response_Transfer_State { + Response_Transfer_State_ACCEPTED = 0, + Response_Transfer_State_REJECTED = 1 +}; +bool Response_Transfer_State_IsValid(int value); +const Response_Transfer_State Response_Transfer_State_State_MIN = Response_Transfer_State_ACCEPTED; +const Response_Transfer_State Response_Transfer_State_State_MAX = Response_Transfer_State_REJECTED; +const int Response_Transfer_State_State_ARRAYSIZE = Response_Transfer_State_State_MAX + 1; + +const ::google::protobuf::EnumDescriptor* Response_Transfer_State_descriptor(); +inline const ::std::string& Response_Transfer_State_Name(Response_Transfer_State value) { + return ::google::protobuf::internal::NameOfEnum( + Response_Transfer_State_descriptor(), value); +} +inline bool Response_Transfer_State_Parse( + const ::std::string& name, Response_Transfer_State* value) { + return ::google::protobuf::internal::ParseNamedEnum<Response_Transfer_State>( + Response_Transfer_State_descriptor(), name, value); } enum Response_Type { Response_Type_AUTHORIZATION = 0, - Response_Type_DATA = 1 + Response_Type_VALIDATION = 1, + Response_Type_TRANSFER = 2, + Response_Type_KEEPALIVE = 3 }; bool Response_Type_IsValid(int value); const Response_Type Response_Type_Type_MIN = Response_Type_AUTHORIZATION; -const Response_Type Response_Type_Type_MAX = Response_Type_DATA; +const Response_Type Response_Type_Type_MAX = Response_Type_KEEPALIVE; const int Response_Type_Type_ARRAYSIZE = Response_Type_Type_MAX + 1; const ::google::protobuf::EnumDescriptor* Response_Type_descriptor(); @@ -218,14 +240,14 @@ class Response_Authorization : public ::google::protobuf::Message { }; // ------------------------------------------------------------------- -class Response_Data : public ::google::protobuf::Message { +class Response_Validation : public ::google::protobuf::Message { public: - Response_Data(); - virtual ~Response_Data(); + Response_Validation(); + virtual ~Response_Validation(); - Response_Data(const Response_Data& from); + Response_Validation(const Response_Validation& from); - inline Response_Data& operator=(const Response_Data& from) { + inline Response_Validation& operator=(const Response_Validation& from) { CopyFrom(from); return *this; } @@ -239,17 +261,17 @@ class Response_Data : public ::google::protobuf::Message { } static const ::google::protobuf::Descriptor* descriptor(); - static const Response_Data& default_instance(); + static const Response_Validation& default_instance(); - void Swap(Response_Data* other); + void Swap(Response_Validation* other); // implements Message ---------------------------------------------- - Response_Data* New() const; + Response_Validation* New() const; void CopyFrom(const ::google::protobuf::Message& from); void MergeFrom(const ::google::protobuf::Message& from); - void CopyFrom(const Response_Data& from); - void MergeFrom(const Response_Data& from); + void CopyFrom(const Response_Validation& from); + void MergeFrom(const Response_Validation& from); void Clear(); bool IsInitialized() const; @@ -270,38 +292,38 @@ class Response_Data : public ::google::protobuf::Message { // nested types ---------------------------------------------------- - typedef Response_Data_State State; - static const State ACCEPTED = Response_Data_State_ACCEPTED; - static const State REJECTED = Response_Data_State_REJECTED; + typedef Response_Validation_State State; + static const State ACCEPTED = Response_Validation_State_ACCEPTED; + static const State REJECTED = Response_Validation_State_REJECTED; static inline bool State_IsValid(int value) { - return Response_Data_State_IsValid(value); + return Response_Validation_State_IsValid(value); } static const State State_MIN = - Response_Data_State_State_MIN; + Response_Validation_State_State_MIN; static const State State_MAX = - Response_Data_State_State_MAX; + Response_Validation_State_State_MAX; static const int State_ARRAYSIZE = - Response_Data_State_State_ARRAYSIZE; + Response_Validation_State_State_ARRAYSIZE; static inline const ::google::protobuf::EnumDescriptor* State_descriptor() { - return Response_Data_State_descriptor(); + return Response_Validation_State_descriptor(); } static inline const ::std::string& State_Name(State value) { - return Response_Data_State_Name(value); + return Response_Validation_State_Name(value); } static inline bool State_Parse(const ::std::string& name, State* value) { - return Response_Data_State_Parse(name, value); + return Response_Validation_State_Parse(name, value); } // accessors ------------------------------------------------------- - // required .DataExporter_ns.Response.Data.State state = 1; + // required .DataExporter_ns.Response.Validation.State state = 1; inline bool has_state() const; inline void clear_state(); static const int kStateFieldNumber = 1; - inline ::DataExporter_ns::Response_Data_State state() const; - inline void set_state(::DataExporter_ns::Response_Data_State value); + inline ::DataExporter_ns::Response_Validation_State state() const; + inline void set_state(::DataExporter_ns::Response_Validation_State value); // required string status = 2; inline bool has_status() const; @@ -315,7 +337,128 @@ class Response_Data : public ::google::protobuf::Message { inline ::std::string* release_status(); inline void set_allocated_status(::std::string* status); - // required string file_path = 3; + // @@protoc_insertion_point(class_scope:DataExporter_ns.Response.Validation) + private: + inline void set_has_state(); + inline void clear_has_state(); + inline void set_has_status(); + inline void clear_has_status(); + + ::google::protobuf::UnknownFieldSet _unknown_fields_; + + ::std::string* status_; + int state_; + + mutable int _cached_size_; + ::google::protobuf::uint32 _has_bits_[(2 + 31) / 32]; + + friend void protobuf_AddDesc_Response_2eproto(); + friend void protobuf_AssignDesc_Response_2eproto(); + friend void protobuf_ShutdownFile_Response_2eproto(); + + void InitAsDefaultInstance(); + static Response_Validation* default_instance_; +}; +// ------------------------------------------------------------------- + +class Response_Transfer : public ::google::protobuf::Message { + public: + Response_Transfer(); + virtual ~Response_Transfer(); + + Response_Transfer(const Response_Transfer& from); + + inline Response_Transfer& operator=(const Response_Transfer& from) { + CopyFrom(from); + return *this; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const { + return _unknown_fields_; + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const Response_Transfer& default_instance(); + + void Swap(Response_Transfer* other); + + // implements Message ---------------------------------------------- + + Response_Transfer* New() const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const Response_Transfer& from); + void MergeFrom(const Response_Transfer& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + typedef Response_Transfer_State State; + static const State ACCEPTED = Response_Transfer_State_ACCEPTED; + static const State REJECTED = Response_Transfer_State_REJECTED; + static inline bool State_IsValid(int value) { + return Response_Transfer_State_IsValid(value); + } + static const State State_MIN = + Response_Transfer_State_State_MIN; + static const State State_MAX = + Response_Transfer_State_State_MAX; + static const int State_ARRAYSIZE = + Response_Transfer_State_State_ARRAYSIZE; + static inline const ::google::protobuf::EnumDescriptor* + State_descriptor() { + return Response_Transfer_State_descriptor(); + } + static inline const ::std::string& State_Name(State value) { + return Response_Transfer_State_Name(value); + } + static inline bool State_Parse(const ::std::string& name, + State* value) { + return Response_Transfer_State_Parse(name, value); + } + + // accessors ------------------------------------------------------- + + // required .DataExporter_ns.Response.Transfer.State state = 1; + inline bool has_state() const; + inline void clear_state(); + static const int kStateFieldNumber = 1; + inline ::DataExporter_ns::Response_Transfer_State state() const; + inline void set_state(::DataExporter_ns::Response_Transfer_State value); + + // required string status = 2; + inline bool has_status() const; + inline void clear_status(); + static const int kStatusFieldNumber = 2; + inline const ::std::string& status() const; + inline void set_status(const ::std::string& value); + inline void set_status(const char* value); + inline void set_status(const char* value, size_t size); + inline ::std::string* mutable_status(); + inline ::std::string* release_status(); + inline void set_allocated_status(::std::string* status); + + // optional string file_path = 3; inline bool has_file_path() const; inline void clear_file_path(); static const int kFilePathFieldNumber = 3; @@ -327,19 +470,14 @@ class Response_Data : public ::google::protobuf::Message { inline ::std::string* release_file_path(); inline void set_allocated_file_path(::std::string* file_path); - // required string file_version = 4; + // optional int32 file_version = 4; inline bool has_file_version() const; inline void clear_file_version(); static const int kFileVersionFieldNumber = 4; - inline const ::std::string& file_version() const; - inline void set_file_version(const ::std::string& value); - inline void set_file_version(const char* value); - inline void set_file_version(const char* value, size_t size); - inline ::std::string* mutable_file_version(); - inline ::std::string* release_file_version(); - inline void set_allocated_file_version(::std::string* file_version); - - // required string file_name = 5; + inline ::google::protobuf::int32 file_version() const; + inline void set_file_version(::google::protobuf::int32 value); + + // optional string file_name = 5; inline bool has_file_name() const; inline void clear_file_name(); static const int kFileNameFieldNumber = 5; @@ -351,14 +489,14 @@ class Response_Data : public ::google::protobuf::Message { inline ::std::string* release_file_name(); inline void set_allocated_file_name(::std::string* file_name); - // required uint64 size = 6; + // optional uint64 size = 6; inline bool has_size() const; inline void clear_size(); static const int kSizeFieldNumber = 6; inline ::google::protobuf::uint64 size() const; inline void set_size(::google::protobuf::uint64 value); - // @@protoc_insertion_point(class_scope:DataExporter_ns.Response.Data) + // @@protoc_insertion_point(class_scope:DataExporter_ns.Response.Transfer) private: inline void set_has_state(); inline void clear_has_state(); @@ -376,11 +514,11 @@ class Response_Data : public ::google::protobuf::Message { ::google::protobuf::UnknownFieldSet _unknown_fields_; ::std::string* status_; + int state_; + ::google::protobuf::int32 file_version_; ::std::string* file_path_; - ::std::string* file_version_; ::std::string* file_name_; ::google::protobuf::uint64 size_; - int state_; mutable int _cached_size_; ::google::protobuf::uint32 _has_bits_[(6 + 31) / 32]; @@ -390,7 +528,7 @@ class Response_Data : public ::google::protobuf::Message { friend void protobuf_ShutdownFile_Response_2eproto(); void InitAsDefaultInstance(); - static Response_Data* default_instance_; + static Response_Transfer* default_instance_; }; // ------------------------------------------------------------------- @@ -447,11 +585,14 @@ class Response : public ::google::protobuf::Message { // nested types ---------------------------------------------------- typedef Response_Authorization Authorization; - typedef Response_Data Data; + typedef Response_Validation Validation; + typedef Response_Transfer Transfer; typedef Response_Type Type; static const Type AUTHORIZATION = Response_Type_AUTHORIZATION; - static const Type DATA = Response_Type_DATA; + static const Type VALIDATION = Response_Type_VALIDATION; + static const Type TRANSFER = Response_Type_TRANSFER; + static const Type KEEPALIVE = Response_Type_KEEPALIVE; static inline bool Type_IsValid(int value) { return Response_Type_IsValid(value); } @@ -491,20 +632,44 @@ class Response : public ::google::protobuf::Message { inline ::DataExporter_ns::Response_Authorization* release_authorization(); inline void set_allocated_authorization(::DataExporter_ns::Response_Authorization* authorization); + // optional .DataExporter_ns.Response.Validation validation = 3; + inline bool has_validation() const; + inline void clear_validation(); + static const int kValidationFieldNumber = 3; + inline const ::DataExporter_ns::Response_Validation& validation() const; + inline ::DataExporter_ns::Response_Validation* mutable_validation(); + inline ::DataExporter_ns::Response_Validation* release_validation(); + inline void set_allocated_validation(::DataExporter_ns::Response_Validation* validation); + + // optional .DataExporter_ns.Response.Transfer transfer = 4; + inline bool has_transfer() const; + inline void clear_transfer(); + static const int kTransferFieldNumber = 4; + inline const ::DataExporter_ns::Response_Transfer& transfer() const; + inline ::DataExporter_ns::Response_Transfer* mutable_transfer(); + inline ::DataExporter_ns::Response_Transfer* release_transfer(); + inline void set_allocated_transfer(::DataExporter_ns::Response_Transfer* transfer); + // @@protoc_insertion_point(class_scope:DataExporter_ns.Response) private: inline void set_has_type(); inline void clear_has_type(); inline void set_has_authorization(); inline void clear_has_authorization(); + inline void set_has_validation(); + inline void clear_has_validation(); + inline void set_has_transfer(); + inline void clear_has_transfer(); ::google::protobuf::UnknownFieldSet _unknown_fields_; ::DataExporter_ns::Response_Authorization* authorization_; + ::DataExporter_ns::Response_Validation* validation_; + ::DataExporter_ns::Response_Transfer* transfer_; int type_; mutable int _cached_size_; - ::google::protobuf::uint32 _has_bits_[(2 + 31) / 32]; + ::google::protobuf::uint32 _has_bits_[(4 + 31) / 32]; friend void protobuf_AddDesc_Response_2eproto(); friend void protobuf_AssignDesc_Response_2eproto(); @@ -615,79 +780,79 @@ inline void Response_Authorization::set_allocated_status(::std::string* status) // ------------------------------------------------------------------- -// Response_Data +// Response_Validation -// required .DataExporter_ns.Response.Data.State state = 1; -inline bool Response_Data::has_state() const { +// required .DataExporter_ns.Response.Validation.State state = 1; +inline bool Response_Validation::has_state() const { return (_has_bits_[0] & 0x00000001u) != 0; } -inline void Response_Data::set_has_state() { +inline void Response_Validation::set_has_state() { _has_bits_[0] |= 0x00000001u; } -inline void Response_Data::clear_has_state() { +inline void Response_Validation::clear_has_state() { _has_bits_[0] &= ~0x00000001u; } -inline void Response_Data::clear_state() { +inline void Response_Validation::clear_state() { state_ = 0; clear_has_state(); } -inline ::DataExporter_ns::Response_Data_State Response_Data::state() const { - return static_cast< ::DataExporter_ns::Response_Data_State >(state_); +inline ::DataExporter_ns::Response_Validation_State Response_Validation::state() const { + return static_cast< ::DataExporter_ns::Response_Validation_State >(state_); } -inline void Response_Data::set_state(::DataExporter_ns::Response_Data_State value) { - assert(::DataExporter_ns::Response_Data_State_IsValid(value)); +inline void Response_Validation::set_state(::DataExporter_ns::Response_Validation_State value) { + assert(::DataExporter_ns::Response_Validation_State_IsValid(value)); set_has_state(); state_ = value; } // required string status = 2; -inline bool Response_Data::has_status() const { +inline bool Response_Validation::has_status() const { return (_has_bits_[0] & 0x00000002u) != 0; } -inline void Response_Data::set_has_status() { +inline void Response_Validation::set_has_status() { _has_bits_[0] |= 0x00000002u; } -inline void Response_Data::clear_has_status() { +inline void Response_Validation::clear_has_status() { _has_bits_[0] &= ~0x00000002u; } -inline void Response_Data::clear_status() { +inline void Response_Validation::clear_status() { if (status_ != &::google::protobuf::internal::kEmptyString) { status_->clear(); } clear_has_status(); } -inline const ::std::string& Response_Data::status() const { +inline const ::std::string& Response_Validation::status() const { return *status_; } -inline void Response_Data::set_status(const ::std::string& value) { +inline void Response_Validation::set_status(const ::std::string& value) { set_has_status(); if (status_ == &::google::protobuf::internal::kEmptyString) { status_ = new ::std::string; } status_->assign(value); } -inline void Response_Data::set_status(const char* value) { +inline void Response_Validation::set_status(const char* value) { set_has_status(); if (status_ == &::google::protobuf::internal::kEmptyString) { status_ = new ::std::string; } status_->assign(value); } -inline void Response_Data::set_status(const char* value, size_t size) { +inline void Response_Validation::set_status(const char* value, size_t size) { set_has_status(); if (status_ == &::google::protobuf::internal::kEmptyString) { status_ = new ::std::string; } status_->assign(reinterpret_cast<const char*>(value), size); } -inline ::std::string* Response_Data::mutable_status() { +inline ::std::string* Response_Validation::mutable_status() { set_has_status(); if (status_ == &::google::protobuf::internal::kEmptyString) { status_ = new ::std::string; } return status_; } -inline ::std::string* Response_Data::release_status() { +inline ::std::string* Response_Validation::release_status() { clear_has_status(); if (status_ == &::google::protobuf::internal::kEmptyString) { return NULL; @@ -697,7 +862,7 @@ inline ::std::string* Response_Data::release_status() { return temp; } } -inline void Response_Data::set_allocated_status(::std::string* status) { +inline void Response_Validation::set_allocated_status(::std::string* status) { if (status_ != &::google::protobuf::internal::kEmptyString) { delete status_; } @@ -710,54 +875,151 @@ inline void Response_Data::set_allocated_status(::std::string* status) { } } -// required string file_path = 3; -inline bool Response_Data::has_file_path() const { +// ------------------------------------------------------------------- + +// Response_Transfer + +// required .DataExporter_ns.Response.Transfer.State state = 1; +inline bool Response_Transfer::has_state() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void Response_Transfer::set_has_state() { + _has_bits_[0] |= 0x00000001u; +} +inline void Response_Transfer::clear_has_state() { + _has_bits_[0] &= ~0x00000001u; +} +inline void Response_Transfer::clear_state() { + state_ = 0; + clear_has_state(); +} +inline ::DataExporter_ns::Response_Transfer_State Response_Transfer::state() const { + return static_cast< ::DataExporter_ns::Response_Transfer_State >(state_); +} +inline void Response_Transfer::set_state(::DataExporter_ns::Response_Transfer_State value) { + assert(::DataExporter_ns::Response_Transfer_State_IsValid(value)); + set_has_state(); + state_ = value; +} + +// required string status = 2; +inline bool Response_Transfer::has_status() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +inline void Response_Transfer::set_has_status() { + _has_bits_[0] |= 0x00000002u; +} +inline void Response_Transfer::clear_has_status() { + _has_bits_[0] &= ~0x00000002u; +} +inline void Response_Transfer::clear_status() { + if (status_ != &::google::protobuf::internal::kEmptyString) { + status_->clear(); + } + clear_has_status(); +} +inline const ::std::string& Response_Transfer::status() const { + return *status_; +} +inline void Response_Transfer::set_status(const ::std::string& value) { + set_has_status(); + if (status_ == &::google::protobuf::internal::kEmptyString) { + status_ = new ::std::string; + } + status_->assign(value); +} +inline void Response_Transfer::set_status(const char* value) { + set_has_status(); + if (status_ == &::google::protobuf::internal::kEmptyString) { + status_ = new ::std::string; + } + status_->assign(value); +} +inline void Response_Transfer::set_status(const char* value, size_t size) { + set_has_status(); + if (status_ == &::google::protobuf::internal::kEmptyString) { + status_ = new ::std::string; + } + status_->assign(reinterpret_cast<const char*>(value), size); +} +inline ::std::string* Response_Transfer::mutable_status() { + set_has_status(); + if (status_ == &::google::protobuf::internal::kEmptyString) { + status_ = new ::std::string; + } + return status_; +} +inline ::std::string* Response_Transfer::release_status() { + clear_has_status(); + if (status_ == &::google::protobuf::internal::kEmptyString) { + return NULL; + } else { + ::std::string* temp = status_; + status_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); + return temp; + } +} +inline void Response_Transfer::set_allocated_status(::std::string* status) { + if (status_ != &::google::protobuf::internal::kEmptyString) { + delete status_; + } + if (status) { + set_has_status(); + status_ = status; + } else { + clear_has_status(); + status_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); + } +} + +// optional string file_path = 3; +inline bool Response_Transfer::has_file_path() const { return (_has_bits_[0] & 0x00000004u) != 0; } -inline void Response_Data::set_has_file_path() { +inline void Response_Transfer::set_has_file_path() { _has_bits_[0] |= 0x00000004u; } -inline void Response_Data::clear_has_file_path() { +inline void Response_Transfer::clear_has_file_path() { _has_bits_[0] &= ~0x00000004u; } -inline void Response_Data::clear_file_path() { +inline void Response_Transfer::clear_file_path() { if (file_path_ != &::google::protobuf::internal::kEmptyString) { file_path_->clear(); } clear_has_file_path(); } -inline const ::std::string& Response_Data::file_path() const { +inline const ::std::string& Response_Transfer::file_path() const { return *file_path_; } -inline void Response_Data::set_file_path(const ::std::string& value) { +inline void Response_Transfer::set_file_path(const ::std::string& value) { set_has_file_path(); if (file_path_ == &::google::protobuf::internal::kEmptyString) { file_path_ = new ::std::string; } file_path_->assign(value); } -inline void Response_Data::set_file_path(const char* value) { +inline void Response_Transfer::set_file_path(const char* value) { set_has_file_path(); if (file_path_ == &::google::protobuf::internal::kEmptyString) { file_path_ = new ::std::string; } file_path_->assign(value); } -inline void Response_Data::set_file_path(const char* value, size_t size) { +inline void Response_Transfer::set_file_path(const char* value, size_t size) { set_has_file_path(); if (file_path_ == &::google::protobuf::internal::kEmptyString) { file_path_ = new ::std::string; } file_path_->assign(reinterpret_cast<const char*>(value), size); } -inline ::std::string* Response_Data::mutable_file_path() { +inline ::std::string* Response_Transfer::mutable_file_path() { set_has_file_path(); if (file_path_ == &::google::protobuf::internal::kEmptyString) { file_path_ = new ::std::string; } return file_path_; } -inline ::std::string* Response_Data::release_file_path() { +inline ::std::string* Response_Transfer::release_file_path() { clear_has_file_path(); if (file_path_ == &::google::protobuf::internal::kEmptyString) { return NULL; @@ -767,7 +1029,7 @@ inline ::std::string* Response_Data::release_file_path() { return temp; } } -inline void Response_Data::set_allocated_file_path(::std::string* file_path) { +inline void Response_Transfer::set_allocated_file_path(::std::string* file_path) { if (file_path_ != &::google::protobuf::internal::kEmptyString) { delete file_path_; } @@ -780,124 +1042,76 @@ inline void Response_Data::set_allocated_file_path(::std::string* file_path) { } } -// required string file_version = 4; -inline bool Response_Data::has_file_version() const { +// optional int32 file_version = 4; +inline bool Response_Transfer::has_file_version() const { return (_has_bits_[0] & 0x00000008u) != 0; } -inline void Response_Data::set_has_file_version() { +inline void Response_Transfer::set_has_file_version() { _has_bits_[0] |= 0x00000008u; } -inline void Response_Data::clear_has_file_version() { +inline void Response_Transfer::clear_has_file_version() { _has_bits_[0] &= ~0x00000008u; } -inline void Response_Data::clear_file_version() { - if (file_version_ != &::google::protobuf::internal::kEmptyString) { - file_version_->clear(); - } +inline void Response_Transfer::clear_file_version() { + file_version_ = 0; clear_has_file_version(); } -inline const ::std::string& Response_Data::file_version() const { - return *file_version_; -} -inline void Response_Data::set_file_version(const ::std::string& value) { - set_has_file_version(); - if (file_version_ == &::google::protobuf::internal::kEmptyString) { - file_version_ = new ::std::string; - } - file_version_->assign(value); -} -inline void Response_Data::set_file_version(const char* value) { - set_has_file_version(); - if (file_version_ == &::google::protobuf::internal::kEmptyString) { - file_version_ = new ::std::string; - } - file_version_->assign(value); -} -inline void Response_Data::set_file_version(const char* value, size_t size) { - set_has_file_version(); - if (file_version_ == &::google::protobuf::internal::kEmptyString) { - file_version_ = new ::std::string; - } - file_version_->assign(reinterpret_cast<const char*>(value), size); -} -inline ::std::string* Response_Data::mutable_file_version() { - set_has_file_version(); - if (file_version_ == &::google::protobuf::internal::kEmptyString) { - file_version_ = new ::std::string; - } +inline ::google::protobuf::int32 Response_Transfer::file_version() const { return file_version_; } -inline ::std::string* Response_Data::release_file_version() { - clear_has_file_version(); - if (file_version_ == &::google::protobuf::internal::kEmptyString) { - return NULL; - } else { - ::std::string* temp = file_version_; - file_version_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); - return temp; - } -} -inline void Response_Data::set_allocated_file_version(::std::string* file_version) { - if (file_version_ != &::google::protobuf::internal::kEmptyString) { - delete file_version_; - } - if (file_version) { - set_has_file_version(); - file_version_ = file_version; - } else { - clear_has_file_version(); - file_version_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); - } +inline void Response_Transfer::set_file_version(::google::protobuf::int32 value) { + set_has_file_version(); + file_version_ = value; } -// required string file_name = 5; -inline bool Response_Data::has_file_name() const { +// optional string file_name = 5; +inline bool Response_Transfer::has_file_name() const { return (_has_bits_[0] & 0x00000010u) != 0; } -inline void Response_Data::set_has_file_name() { +inline void Response_Transfer::set_has_file_name() { _has_bits_[0] |= 0x00000010u; } -inline void Response_Data::clear_has_file_name() { +inline void Response_Transfer::clear_has_file_name() { _has_bits_[0] &= ~0x00000010u; } -inline void Response_Data::clear_file_name() { +inline void Response_Transfer::clear_file_name() { if (file_name_ != &::google::protobuf::internal::kEmptyString) { file_name_->clear(); } clear_has_file_name(); } -inline const ::std::string& Response_Data::file_name() const { +inline const ::std::string& Response_Transfer::file_name() const { return *file_name_; } -inline void Response_Data::set_file_name(const ::std::string& value) { +inline void Response_Transfer::set_file_name(const ::std::string& value) { set_has_file_name(); if (file_name_ == &::google::protobuf::internal::kEmptyString) { file_name_ = new ::std::string; } file_name_->assign(value); } -inline void Response_Data::set_file_name(const char* value) { +inline void Response_Transfer::set_file_name(const char* value) { set_has_file_name(); if (file_name_ == &::google::protobuf::internal::kEmptyString) { file_name_ = new ::std::string; } file_name_->assign(value); } -inline void Response_Data::set_file_name(const char* value, size_t size) { +inline void Response_Transfer::set_file_name(const char* value, size_t size) { set_has_file_name(); if (file_name_ == &::google::protobuf::internal::kEmptyString) { file_name_ = new ::std::string; } file_name_->assign(reinterpret_cast<const char*>(value), size); } -inline ::std::string* Response_Data::mutable_file_name() { +inline ::std::string* Response_Transfer::mutable_file_name() { set_has_file_name(); if (file_name_ == &::google::protobuf::internal::kEmptyString) { file_name_ = new ::std::string; } return file_name_; } -inline ::std::string* Response_Data::release_file_name() { +inline ::std::string* Response_Transfer::release_file_name() { clear_has_file_name(); if (file_name_ == &::google::protobuf::internal::kEmptyString) { return NULL; @@ -907,7 +1121,7 @@ inline ::std::string* Response_Data::release_file_name() { return temp; } } -inline void Response_Data::set_allocated_file_name(::std::string* file_name) { +inline void Response_Transfer::set_allocated_file_name(::std::string* file_name) { if (file_name_ != &::google::protobuf::internal::kEmptyString) { delete file_name_; } @@ -920,24 +1134,24 @@ inline void Response_Data::set_allocated_file_name(::std::string* file_name) { } } -// required uint64 size = 6; -inline bool Response_Data::has_size() const { +// optional uint64 size = 6; +inline bool Response_Transfer::has_size() const { return (_has_bits_[0] & 0x00000020u) != 0; } -inline void Response_Data::set_has_size() { +inline void Response_Transfer::set_has_size() { _has_bits_[0] |= 0x00000020u; } -inline void Response_Data::clear_has_size() { +inline void Response_Transfer::clear_has_size() { _has_bits_[0] &= ~0x00000020u; } -inline void Response_Data::clear_size() { +inline void Response_Transfer::clear_size() { size_ = GOOGLE_ULONGLONG(0); clear_has_size(); } -inline ::google::protobuf::uint64 Response_Data::size() const { +inline ::google::protobuf::uint64 Response_Transfer::size() const { return size_; } -inline void Response_Data::set_size(::google::protobuf::uint64 value) { +inline void Response_Transfer::set_size(::google::protobuf::uint64 value) { set_has_size(); size_ = value; } @@ -1007,6 +1221,82 @@ inline void Response::set_allocated_authorization(::DataExporter_ns::Response_Au } } +// optional .DataExporter_ns.Response.Validation validation = 3; +inline bool Response::has_validation() const { + return (_has_bits_[0] & 0x00000004u) != 0; +} +inline void Response::set_has_validation() { + _has_bits_[0] |= 0x00000004u; +} +inline void Response::clear_has_validation() { + _has_bits_[0] &= ~0x00000004u; +} +inline void Response::clear_validation() { + if (validation_ != NULL) validation_->::DataExporter_ns::Response_Validation::Clear(); + clear_has_validation(); +} +inline const ::DataExporter_ns::Response_Validation& Response::validation() const { + return validation_ != NULL ? *validation_ : *default_instance_->validation_; +} +inline ::DataExporter_ns::Response_Validation* Response::mutable_validation() { + set_has_validation(); + if (validation_ == NULL) validation_ = new ::DataExporter_ns::Response_Validation; + return validation_; +} +inline ::DataExporter_ns::Response_Validation* Response::release_validation() { + clear_has_validation(); + ::DataExporter_ns::Response_Validation* temp = validation_; + validation_ = NULL; + return temp; +} +inline void Response::set_allocated_validation(::DataExporter_ns::Response_Validation* validation) { + delete validation_; + validation_ = validation; + if (validation) { + set_has_validation(); + } else { + clear_has_validation(); + } +} + +// optional .DataExporter_ns.Response.Transfer transfer = 4; +inline bool Response::has_transfer() const { + return (_has_bits_[0] & 0x00000008u) != 0; +} +inline void Response::set_has_transfer() { + _has_bits_[0] |= 0x00000008u; +} +inline void Response::clear_has_transfer() { + _has_bits_[0] &= ~0x00000008u; +} +inline void Response::clear_transfer() { + if (transfer_ != NULL) transfer_->::DataExporter_ns::Response_Transfer::Clear(); + clear_has_transfer(); +} +inline const ::DataExporter_ns::Response_Transfer& Response::transfer() const { + return transfer_ != NULL ? *transfer_ : *default_instance_->transfer_; +} +inline ::DataExporter_ns::Response_Transfer* Response::mutable_transfer() { + set_has_transfer(); + if (transfer_ == NULL) transfer_ = new ::DataExporter_ns::Response_Transfer; + return transfer_; +} +inline ::DataExporter_ns::Response_Transfer* Response::release_transfer() { + clear_has_transfer(); + ::DataExporter_ns::Response_Transfer* temp = transfer_; + transfer_ = NULL; + return temp; +} +inline void Response::set_allocated_transfer(::DataExporter_ns::Response_Transfer* transfer) { + delete transfer_; + transfer_ = transfer; + if (transfer) { + set_has_transfer(); + } else { + clear_has_transfer(); + } +} + // @@protoc_insertion_point(namespace_scope) @@ -1021,8 +1311,12 @@ inline const EnumDescriptor* GetEnumDescriptor< ::DataExporter_ns::Response_Auth return ::DataExporter_ns::Response_Authorization_State_descriptor(); } template <> -inline const EnumDescriptor* GetEnumDescriptor< ::DataExporter_ns::Response_Data_State>() { - return ::DataExporter_ns::Response_Data_State_descriptor(); +inline const EnumDescriptor* GetEnumDescriptor< ::DataExporter_ns::Response_Validation_State>() { + return ::DataExporter_ns::Response_Validation_State_descriptor(); +} +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::DataExporter_ns::Response_Transfer_State>() { + return ::DataExporter_ns::Response_Transfer_State_descriptor(); } template <> inline const EnumDescriptor* GetEnumDescriptor< ::DataExporter_ns::Response_Type>() {