Skip to content
Snippets Groups Projects
Verified Commit 577bdea6 authored by Timm Fitschen's avatar Timm Fitschen
Browse files

Add license headers to new files

parent b2d5f3a7
No related branches found
No related tags found
1 merge request!11F files
This commit is part of merge request !11. Comments created here will be created in the context of that merge request.
Showing
with 666 additions and 25 deletions
/*
* This file is a part of the CaosDB Project.
* Copyright (C) 2021 Timm Fitschen <t.fitschen@indiscale.com>
* Copyright (C) 2021 IndiScale GmbH <info@indiscale.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
*********************************************************************************
*
* This is derived work which is heavily based on
* https://github.com/NeiRo21/grpcpp-bidi-streaming, Commit
* cd9cb78e5d6d72806c2ec4c703e5e856b223dc96, Aug 10, 2020
*
* The orginal work is licensed as
*
* > MIT License
* >
* > Copyright (c) 2019 NeiRo21
* >
* > Permission is hereby granted, free of charge, to any person obtaining a
* > copy of this software and associated documentation files (the "Software"),
* > to deal in the Software without restriction, including without limitation
* > the rights to use, copy, modify, merge, publish, distribute, sublicense,
* > and/or sell copies of the Software, and to permit persons to whom the
* > Software is furnished to do so, subject to the following conditions:
* >
* > The above copyright notice and this permission notice shall be included in
* > all copies or substantial portions of the Software.
* >
* > THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* > IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* > FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* > AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* > LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* > FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* > DEALINGS IN THE SOFTWARE.
*/
#ifndef CAOSDB_FILE_TRANSMISSION_DOWNLOAD_REQUEST_HANDLER_H
#define CAOSDB_FILE_TRANSMISSION_DOWNLOAD_REQUEST_HANDLER_H
#include "caosdb/entity.h" // for FileDescriptor
#include "caosdb/entity/v1alpha1/main.grpc.pb.h" // for FileTransmissionS...
#include "caosdb/entity/v1alpha1/main.pb.h" // for FileDownloadResponse
......@@ -66,3 +117,5 @@ protected:
};
} // namespace caosdb::transaction
#endif
#pragma once
/*
* This file is a part of the CaosDB Project.
* Copyright (C) 2021 Timm Fitschen <t.fitschen@indiscale.com>
* Copyright (C) 2021 IndiScale GmbH <info@indiscale.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
*********************************************************************************
*
* This is derived work which is heavily based on
* https://github.com/NeiRo21/grpcpp-bidi-streaming, Commit
* cd9cb78e5d6d72806c2ec4c703e5e856b223dc96, Aug 10, 2020
*
* The orginal work is licensed as
*
* > MIT License
* >
* > Copyright (c) 2019 NeiRo21
* >
* > Permission is hereby granted, free of charge, to any person obtaining a
* > copy of this software and associated documentation files (the "Software"),
* > to deal in the Software without restriction, including without limitation
* > the rights to use, copy, modify, merge, publish, distribute, sublicense,
* > and/or sell copies of the Software, and to permit persons to whom the
* > Software is furnished to do so, subject to the following conditions:
* >
* > The above copyright notice and this permission notice shall be included in
* > all copies or substantial portions of the Software.
* >
* > THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* > IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* > FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* > AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* > LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* > FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* > DEALINGS IN THE SOFTWARE.
*/
#ifndef CAOSDB_FILE_TRANSMISSION_FILE_ERROR_H
#define CAOSDB_FILE_TRANSMISSION_FILE_ERROR_H
#include <stdexcept>
#include <string>
......@@ -11,3 +60,5 @@ public:
};
} // namespace caosdb::transaction
#endif
#pragma once
/*
* This file is a part of the CaosDB Project.
* Copyright (C) 2021 Timm Fitschen <t.fitschen@indiscale.com>
* Copyright (C) 2021 IndiScale GmbH <info@indiscale.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
*********************************************************************************
*
* This is derived work which is heavily based on
* https://github.com/NeiRo21/grpcpp-bidi-streaming, Commit
* cd9cb78e5d6d72806c2ec4c703e5e856b223dc96, Aug 10, 2020
*
* The orginal work is licensed as
*
* > MIT License
* >
* > Copyright (c) 2019 NeiRo21
* >
* > Permission is hereby granted, free of charge, to any person obtaining a
* > copy of this software and associated documentation files (the "Software"),
* > to deal in the Software without restriction, including without limitation
* > the rights to use, copy, modify, merge, publish, distribute, sublicense,
* > and/or sell copies of the Software, and to permit persons to whom the
* > Software is furnished to do so, subject to the following conditions:
* >
* > The above copyright notice and this permission notice shall be included in
* > all copies or substantial portions of the Software.
* >
* > THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* > IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* > FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* > AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* > LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* > FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* > DEALINGS IN THE SOFTWARE.
*/
#ifndef CAOSDB_FILE_TRANSMISSION_FILE_READER_H
#define CAOSDB_FILE_TRANSMISSION_FILE_READER_H
#include <boost/filesystem/fstream.hpp> // for ifstream
#include <boost/filesystem/operations.hpp> // for exists
#include <boost/filesystem/path.hpp> // for path
#include <fstream> // for ifstream, size_t
#include <memory> // for shared_ptr
#include <string> // for string
namespace caosdb::transaction {
......@@ -37,3 +85,5 @@ private:
};
} // namespace caosdb::transaction
#endif
#pragma once
/*
* This file is a part of the CaosDB Project.
* Copyright (C) 2021 Timm Fitschen <t.fitschen@indiscale.com>
* Copyright (C) 2021 IndiScale GmbH <info@indiscale.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
*********************************************************************************
*
* This is derived work which is heavily based on
* https://github.com/NeiRo21/grpcpp-bidi-streaming, Commit
* cd9cb78e5d6d72806c2ec4c703e5e856b223dc96, Aug 10, 2020
*
* The orginal work is licensed as
*
* > MIT License
* >
* > Copyright (c) 2019 NeiRo21
* >
* > Permission is hereby granted, free of charge, to any person obtaining a
* > copy of this software and associated documentation files (the "Software"),
* > to deal in the Software without restriction, including without limitation
* > the rights to use, copy, modify, merge, publish, distribute, sublicense,
* > and/or sell copies of the Software, and to permit persons to whom the
* > Software is furnished to do so, subject to the following conditions:
* >
* > The above copyright notice and this permission notice shall be included in
* > all copies or substantial portions of the Software.
* >
* > THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* > IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* > FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* > AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* > LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* > FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* > DEALINGS IN THE SOFTWARE.
*/
#ifndef CAOSDB_FILE_TRANSMISSION_FILE_WRITER_H
#define CAOSDB_FILE_TRANSMISSION_FILE_WRITER_H
#include <boost/filesystem/path.hpp> // for path
#include <fstream> // for ofstream
#include <memory> // for shared_ptr
#include <string> // for string
namespace caosdb::transaction {
......@@ -29,3 +77,5 @@ private:
};
} // namespace caosdb::transaction
#endif
#pragma once
/*
* This file is a part of the CaosDB Project.
* Copyright (C) 2021 Timm Fitschen <t.fitschen@indiscale.com>
* Copyright (C) 2021 IndiScale GmbH <info@indiscale.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
*********************************************************************************
*
* This is derived work which is heavily based on
* https://github.com/NeiRo21/grpcpp-bidi-streaming, Commit
* cd9cb78e5d6d72806c2ec4c703e5e856b223dc96, Aug 10, 2020
*
* The orginal work is licensed as
*
* > MIT License
* >
* > Copyright (c) 2019 NeiRo21
* >
* > Permission is hereby granted, free of charge, to any person obtaining a
* > copy of this software and associated documentation files (the "Software"),
* > to deal in the Software without restriction, including without limitation
* > the rights to use, copy, modify, merge, publish, distribute, sublicense,
* > and/or sell copies of the Software, and to permit persons to whom the
* > Software is furnished to do so, subject to the following conditions:
* >
* > The above copyright notice and this permission notice shall be included in
* > all copies or substantial portions of the Software.
* >
* > THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* > IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* > FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* > AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* > LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* > FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* > DEALINGS IN THE SOFTWARE.
*/
#ifndef CAOSDB_FILE_TRANSMISSION_REGISTER_FILE_UPLOAD_H
#define CAOSDB_FILE_TRANSMISSION_REGISTER_FILE_UPLOAD_H
#include "caosdb/entity/v1alpha1/main.grpc.pb.h" // for FileTransmissionS...
#include "caosdb/entity/v1alpha1/main.pb.h" // for FileDownloadResponse
#include "caosdb/handler_interface.h" // for HandlerTag, Handl...
......@@ -30,7 +80,6 @@ public:
protected:
void handleNewCallState() override;
void handleReceivingFileState() override;
HandlerTag tag_;
......@@ -44,3 +93,5 @@ protected:
};
} // namespace caosdb::transaction
#endif
/*
* This file is a part of the CaosDB Project.
* Copyright (C) 2021 Timm Fitschen <t.fitschen@indiscale.com>
* Copyright (C) 2021 IndiScale GmbH <info@indiscale.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
*********************************************************************************
*
* This is derived work which is heavily based on
* https://github.com/NeiRo21/grpcpp-bidi-streaming, Commit
* cd9cb78e5d6d72806c2ec4c703e5e856b223dc96, Aug 10, 2020
*
* The orginal work is licensed as
*
* > MIT License
* >
* > Copyright (c) 2019 NeiRo21
* >
* > Permission is hereby granted, free of charge, to any person obtaining a
* > copy of this software and associated documentation files (the "Software"),
* > to deal in the Software without restriction, including without limitation
* > the rights to use, copy, modify, merge, publish, distribute, sublicense,
* > and/or sell copies of the Software, and to permit persons to whom the
* > Software is furnished to do so, subject to the following conditions:
* >
* > The above copyright notice and this permission notice shall be included in
* > all copies or substantial portions of the Software.
* >
* > THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* > IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* > FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* > AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* > LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* > FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* > DEALINGS IN THE SOFTWARE.
*/
#ifndef CAOSDB_FILE_TRANSMISSION_UPLOAD_REQUEST_HANDLER_H
#define CAOSDB_FILE_TRANSMISSION_UPLOAD_REQUEST_HANDLER_H
#include "caosdb/entity.h" // for FileDescriptor
#include "caosdb/entity/v1alpha1/main.grpc.pb.h" // for FileTransmissionS...
#include "caosdb/entity/v1alpha1/main.pb.h" // for FileUploadRequest
......@@ -74,3 +125,5 @@ protected:
};
} // namespace caosdb::transaction
#endif
......@@ -30,7 +30,6 @@ public:
protected:
virtual void handleNewCallState() override;
virtual void handleReceivingFileState() override;
HandlerTag tag_;
......
#pragma once
/*
* This file is a part of the CaosDB Project.
* Copyright (C) 2021 Timm Fitschen <t.fitschen@indiscale.com>
* Copyright (C) 2021 IndiScale GmbH <info@indiscale.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
*********************************************************************************
*
* This is derived work which is heavily based on
* https://github.com/NeiRo21/grpcpp-bidi-streaming, Commit
* cd9cb78e5d6d72806c2ec4c703e5e856b223dc96, Aug 10, 2020
*
* The orginal work is licensed as
*
* > MIT License
* >
* > Copyright (c) 2019 NeiRo21
* >
* > Permission is hereby granted, free of charge, to any person obtaining a
* > copy of this software and associated documentation files (the "Software"),
* > to deal in the Software without restriction, including without limitation
* > the rights to use, copy, modify, merge, publish, distribute, sublicense,
* > and/or sell copies of the Software, and to permit persons to whom the
* > Software is furnished to do so, subject to the following conditions:
* >
* > The above copyright notice and this permission notice shall be included in
* > all copies or substantial portions of the Software.
* >
* > THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* > IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* > FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* > AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* > LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* > FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* > DEALINGS IN THE SOFTWARE.
*/
#ifndef CAOSDB_UNARY_RPC_HANDLER_H
#define CAOSDB_UNARY_RPC_HANDLER_H
#include "caosdb/handler_interface.h" // for HandlerTag, Handl...
#include "caosdb/transaction_status.h" // for TransactionStatus
#include <grpcpp/impl/codegen/client_context.h> // for ClientContext
......@@ -24,10 +74,9 @@ public:
protected:
virtual void handleNewCallState() = 0;
virtual void handleReceivingFileState() = 0;
void handleCallCompleteState();
enum class CallState { NewCall, ReceivingFile, CallComplete };
enum class CallState { NewCall, CallComplete };
CallState state_;
grpc::CompletionQueue *completion_queue;
......@@ -36,3 +85,5 @@ protected:
};
} // namespace caosdb::transaction
#endif
/*
* This file is a part of the CaosDB Project.
* Copyright (C) 2021 Timm Fitschen <t.fitschen@indiscale.com>
* Copyright (C) 2021 IndiScale GmbH <info@indiscale.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
*********************************************************************************
*
* This is derived work which is heavily based on
* https://github.com/NeiRo21/grpcpp-bidi-streaming, Commit
* cd9cb78e5d6d72806c2ec4c703e5e856b223dc96, Aug 10, 2020
*
* The orginal work is licensed as
*
* > MIT License
* >
* > Copyright (c) 2019 NeiRo21
* >
* > Permission is hereby granted, free of charge, to any person obtaining a
* > copy of this software and associated documentation files (the "Software"),
* > to deal in the Software without restriction, including without limitation
* > the rights to use, copy, modify, merge, publish, distribute, sublicense,
* > and/or sell copies of the Software, and to permit persons to whom the
* > Software is furnished to do so, subject to the following conditions:
* >
* > The above copyright notice and this permission notice shall be included in
* > all copies or substantial portions of the Software.
* >
* > THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* > IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* > FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* > AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* > LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* > FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* > DEALINGS IN THE SOFTWARE.
*/
#include "caosdb/file_transmission/download_request_handler.h"
#include "caosdb/logging.h" // for CAOSDB_LOG_TRACE
#include "caosdb/protobuf_helper.h" // for get_arena
......@@ -91,6 +139,7 @@ void DownloadRequestHandler::handleNewCallState() {
rpc_ = stub_->PrepareAsyncFileDownload(&ctx_, *request_, cq_);
transaction_status = TransactionStatus::EXECUTING();
state_ = CallState::SendingRequest;
rpc_->StartCall(tag_);
CAOSDB_LOG_TRACE(logger_name)
......
/*
* This file is a part of the CaosDB Project.
* Copyright (C) 2021 Timm Fitschen <t.fitschen@indiscale.com>
* Copyright (C) 2021 IndiScale GmbH <info@indiscale.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
*********************************************************************************
*
* This is derived work which is heavily based on
* https://github.com/NeiRo21/grpcpp-bidi-streaming, Commit
* cd9cb78e5d6d72806c2ec4c703e5e856b223dc96, Aug 10, 2020
*
* The orginal work is licensed as
*
* > MIT License
* >
* > Copyright (c) 2019 NeiRo21
* >
* > Permission is hereby granted, free of charge, to any person obtaining a
* > copy of this software and associated documentation files (the "Software"),
* > to deal in the Software without restriction, including without limitation
* > the rights to use, copy, modify, merge, publish, distribute, sublicense,
* > and/or sell copies of the Software, and to permit persons to whom the
* > Software is furnished to do so, subject to the following conditions:
* >
* > The above copyright notice and this permission notice shall be included in
* > all copies or substantial portions of the Software.
* >
* > THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* > IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* > FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* > AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* > LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* > FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* > DEALINGS IN THE SOFTWARE.
*/
#include "caosdb/file_transmission/file_reader.h"
#include "caosdb/file_transmission/file_error.h" // for FileIOError
#include <boost/filesystem/path.hpp> // for path
......
/*
* This file is a part of the CaosDB Project.
* Copyright (C) 2021 Timm Fitschen <t.fitschen@indiscale.com>
* Copyright (C) 2021 IndiScale GmbH <info@indiscale.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
*********************************************************************************
*
* This is derived work which is heavily based on
* https://github.com/NeiRo21/grpcpp-bidi-streaming, Commit
* cd9cb78e5d6d72806c2ec4c703e5e856b223dc96, Aug 10, 2020
*
* The orginal work is licensed as
*
* > MIT License
* >
* > Copyright (c) 2019 NeiRo21
* >
* > Permission is hereby granted, free of charge, to any person obtaining a
* > copy of this software and associated documentation files (the "Software"),
* > to deal in the Software without restriction, including without limitation
* > the rights to use, copy, modify, merge, publish, distribute, sublicense,
* > and/or sell copies of the Software, and to permit persons to whom the
* > Software is furnished to do so, subject to the following conditions:
* >
* > The above copyright notice and this permission notice shall be included in
* > all copies or substantial portions of the Software.
* >
* > THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* > IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* > FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* > AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* > LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* > FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* > DEALINGS IN THE SOFTWARE.
*/
#include "caosdb/file_transmission/file_writer.h"
#include "caosdb/file_transmission/file_error.h" // for FileIOError
#include <boost/filesystem/path.hpp> // for path
......
/*
* This file is a part of the CaosDB Project.
* Copyright (C) 2021 Timm Fitschen <t.fitschen@indiscale.com>
* Copyright (C) 2021 IndiScale GmbH <info@indiscale.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
*********************************************************************************
*
* This is derived work which is heavily based on
* https://github.com/NeiRo21/grpcpp-bidi-streaming, Commit
* cd9cb78e5d6d72806c2ec4c703e5e856b223dc96, Aug 10, 2020
*
* The orginal work is licensed as
*
* > MIT License
* >
* > Copyright (c) 2019 NeiRo21
* >
* > Permission is hereby granted, free of charge, to any person obtaining a
* > copy of this software and associated documentation files (the "Software"),
* > to deal in the Software without restriction, including without limitation
* > the rights to use, copy, modify, merge, publish, distribute, sublicense,
* > and/or sell copies of the Software, and to permit persons to whom the
* > Software is furnished to do so, subject to the following conditions:
* >
* > The above copyright notice and this permission notice shall be included in
* > all copies or substantial portions of the Software.
* >
* > THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* > IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* > FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* > AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* > LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* > FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* > DEALINGS IN THE SOFTWARE.
*/
#include "caosdb/file_transmission/register_file_upload_handler.h"
#include "caosdb/logging.h" // for CAOSDB_LOG_TRACE
#include <boost/log/core/record.hpp> // for record
......@@ -33,6 +81,4 @@ void RegisterFileUploadHandler::handleNewCallState() {
<< "Leave RegisterFileUploadHandler::handleNewCallState";
}
void RegisterFileUploadHandler::handleReceivingFileState() {}
} // namespace caosdb::transaction
/*
* This file is a part of the CaosDB Project.
* Copyright (C) 2021 Timm Fitschen <t.fitschen@indiscale.com>
* Copyright (C) 2021 IndiScale GmbH <info@indiscale.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
*********************************************************************************
*
* This is derived work which is heavily based on
* https://github.com/NeiRo21/grpcpp-bidi-streaming, Commit
* cd9cb78e5d6d72806c2ec4c703e5e856b223dc96, Aug 10, 2020
*
* The orginal work is licensed as
*
* > MIT License
* >
* > Copyright (c) 2019 NeiRo21
* >
* > Permission is hereby granted, free of charge, to any person obtaining a
* > copy of this software and associated documentation files (the "Software"),
* > to deal in the Software without restriction, including without limitation
* > the rights to use, copy, modify, merge, publish, distribute, sublicense,
* > and/or sell copies of the Software, and to permit persons to whom the
* > Software is furnished to do so, subject to the following conditions:
* >
* > The above copyright notice and this permission notice shall be included in
* > all copies or substantial portions of the Software.
* >
* > THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* > IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* > FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* > AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* > LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* > FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* > DEALINGS IN THE SOFTWARE.
*/
#include "caosdb/file_transmission/upload_request_handler.h"
#include "caosdb/logging.h" // for CAOSDB_LOG_ERROR
#include "caosdb/protobuf_helper.h" // for get_arena
......
#include "caosdb/transaction_handler.h"
#include "caosdb/logging.h" // for CAOSDB_LOG_TRACE
#include <boost/log/core/record.hpp> // for record
#include <boost/log/sources/record_ostream.hpp> // for basic_record_...
#include <boost/preprocessor/seq/limits/enum_256.hpp> // for BOOST_PP_SEQ_...
#include <boost/preprocessor/seq/limits/size_256.hpp> // for BOOST_PP_SEQ_...
#include <exception> // IWYU pragma: keep
#include "caosdb/logging.h" // for CAOSDB_LOG_TRACE
#include <boost/log/core/record.hpp> // for record
#include <boost/log/detail/attachable_sstream_buf.hpp> // for basic_ostring...
#include <boost/log/sources/record_ostream.hpp> // for basic_record_...
#include <boost/preprocessor/seq/limits/enum_256.hpp> // for BOOST_PP_SEQ_...
#include <boost/preprocessor/seq/limits/size_256.hpp> // for BOOST_PP_SEQ_...
#include <exception> // IWYU pragma: keep
// IWYU pragma: no_include <bits/exception.h>
#include <grpcpp/impl/codegen/async_unary_call.h> // for ClientAsyncRes...
#include <grpcpp/impl/codegen/completion_queue.h> // for CompletionQueue
#include <iosfwd> // for streamsize
namespace caosdb::transaction {
......@@ -35,8 +37,4 @@ void EntityTransactionHandler::handleNewCallState() {
<< "Leave EntityTransactionHandler::handleNewCallState";
}
void EntityTransactionHandler::handleReceivingFileState() {
// TODO(tf) remove
}
} // namespace caosdb::transaction
/*
* This file is a part of the CaosDB Project.
* Copyright (C) 2021 Timm Fitschen <t.fitschen@indiscale.com>
* Copyright (C) 2021 IndiScale GmbH <info@indiscale.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
*********************************************************************************
*
* This is derived work which is heavily based on
* https://github.com/NeiRo21/grpcpp-bidi-streaming, Commit
* cd9cb78e5d6d72806c2ec4c703e5e856b223dc96, Aug 10, 2020
*
* The orginal work is licensed as
*
* > MIT License
* >
* > Copyright (c) 2019 NeiRo21
* >
* > Permission is hereby granted, free of charge, to any person obtaining a
* > copy of this software and associated documentation files (the "Software"),
* > to deal in the Software without restriction, including without limitation
* > the rights to use, copy, modify, merge, publish, distribute, sublicense,
* > and/or sell copies of the Software, and to permit persons to whom the
* > Software is furnished to do so, subject to the following conditions:
* >
* > The above copyright notice and this permission notice shall be included in
* > all copies or substantial portions of the Software.
* >
* > THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* > IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* > FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* > AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* > LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* > FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* > DEALINGS IN THE SOFTWARE.
*/
#include "caosdb/unary_rpc_handler.h"
#include "caosdb/logging.h" // for CAOSDB_LOG_TRACE
#include "caosdb/status_code.h" // for GENERIC_RPC_E...
......@@ -21,8 +69,6 @@ bool UnaryRpcHandler::OnNext(bool ok) {
if (ok) {
if (state_ == CallState::NewCall) {
this->handleNewCallState();
} else if (state_ == CallState::ReceivingFile) {
this->handleReceivingFileState();
} else if (state_ == CallState::CallComplete) {
this->handleCallCompleteState();
return false;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment