comparison Framework/TransferToolbox.h @ 0:95226b754d9e

initial release
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 17 Sep 2018 11:34:55 +0200
parents
children 1ed03945c057
comparison
equal deleted inserted replaced
-1:000000000000 0:95226b754d9e
1 /**
2 * Transfers accelerator plugin for Orthanc
3 * Copyright (C) 2018 Osimis, Belgium
4 *
5 * This program is free software: you can redistribute it and/or
6 * modify it under the terms of the GNU Affero General Public License
7 * as published by the Free Software Foundation, either version 3 of
8 * the License, or (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Affero General Public License for more details.
14 *
15 * You should have received a copy of the GNU Affero General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 **/
18
19
20 #pragma once
21
22 #include <stdint.h>
23 #include <string>
24
25 static const unsigned int KB = 1024;
26 static const unsigned int MB = 1024 * 1024;
27
28 static const char* const JOB_TYPE_PULL = "PullTransfer";
29 static const char* const JOB_TYPE_PUSH = "PushTransfer";
30
31 static const char* const PLUGIN_NAME = "transfers";
32
33 static const char* const KEY_BIDIRECTIONAL_PEERS = "BidirectionalPeers";
34 static const char* const KEY_BUCKETS = "Buckets";
35 static const char* const KEY_COMPRESSION = "Compression";
36 static const char* const KEY_ID = "ID";
37 static const char* const KEY_INSTANCES = "Instances";
38 static const char* const KEY_LEVEL = "Level";
39 static const char* const KEY_OFFSET = "Offset";
40 static const char* const KEY_ORIGINATOR_UUID = "Originator";
41 static const char* const KEY_PATH = "Path";
42 static const char* const KEY_PEER = "Peer";
43 static const char* const KEY_PLUGIN_CONFIGURATION = "Transfers";
44 static const char* const KEY_PRIORITY = "Priority";
45 static const char* const KEY_REMOTE_JOB = "RemoteJob";
46 static const char* const KEY_RESOURCES = "Resources";
47 static const char* const KEY_SIZE = "Size";
48 static const char* const KEY_URL = "URL";
49
50 static const char* const URI_CHUNKS = "/transfers/chunks";
51 static const char* const URI_JOBS = "/jobs";
52 static const char* const URI_LOOKUP = "/transfers/lookup";
53 static const char* const URI_PEERS = "/transfers/peers";
54 static const char* const URI_PLUGINS = "/plugins";
55 static const char* const URI_PULL = "/transfers/pull";
56 static const char* const URI_PUSH = "/transfers/push";
57 static const char* const URI_SEND = "/transfers/send";
58
59
60 namespace OrthancPlugins
61 {
62 enum BucketCompression
63 {
64 BucketCompression_None,
65 BucketCompression_Gzip
66 };
67
68 unsigned int ConvertToMegabytes(uint64_t value);
69
70 unsigned int ConvertToKilobytes(uint64_t value);
71
72 BucketCompression StringToBucketCompression(const std::string& value);
73
74 const char* EnumerationToString(BucketCompression compression);
75 }