1 | /* $Id: CloudClientImpl.h 73337 2018-07-23 22:05:26Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * VirtualBox COM class implementation
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2006-2018 Oracle Corporation
|
---|
8 | *
|
---|
9 | * This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
10 | * available from http://www.virtualbox.org. This file is free software;
|
---|
11 | * you can redistribute it and/or modify it under the terms of the GNU
|
---|
12 | * General Public License (GPL) as published by the Free Software
|
---|
13 | * Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
14 | * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
15 | * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
16 | */
|
---|
17 |
|
---|
18 |
|
---|
19 | #ifndef ____H_CLOUDCLIENTIMPL
|
---|
20 | #define ____H_CLOUDCLIENTIMPL
|
---|
21 |
|
---|
22 | /* VBox includes */
|
---|
23 |
|
---|
24 | #include "CloudClientWrap.h"
|
---|
25 |
|
---|
26 | /* VBox forward declarations */
|
---|
27 | class CloudUserProfiles;
|
---|
28 |
|
---|
29 | class CloudClient :
|
---|
30 | public CloudClientWrap
|
---|
31 | {
|
---|
32 | public:
|
---|
33 | DECLARE_EMPTY_CTOR_DTOR(CloudClient)
|
---|
34 | // explicit CloudClient(CloudProviderId_T aCloudProvider);
|
---|
35 |
|
---|
36 | HRESULT FinalConstruct();
|
---|
37 | void FinalRelease();
|
---|
38 |
|
---|
39 | HRESULT init(VirtualBox *aVirtualBox);
|
---|
40 | HRESULT initCloudClient(CloudUserProfiles *aProfiles,
|
---|
41 | VirtualBox *aParent,
|
---|
42 | CloudProviderId_T aCloudProvider,
|
---|
43 | const com::Utf8Str &aProfileName);
|
---|
44 | void uninit();
|
---|
45 |
|
---|
46 | protected:
|
---|
47 | ComPtr<VirtualBox> const mParent; /**< Strong reference to the parent object (VirtualBox/IMachine). */
|
---|
48 | CloudProviderId_T mCloudProvider;
|
---|
49 | std::map <Utf8Str, Utf8Str> userProfile;
|
---|
50 |
|
---|
51 | private:
|
---|
52 | HRESULT getOperationParameters(CloudOperation_T aCloudOperation, com::Utf8Str &aJsonString);
|
---|
53 |
|
---|
54 | HRESULT createOperation(const com::Utf8Str &aProfileName,
|
---|
55 | CloudOperation_T aCloudOperation,
|
---|
56 | com::Guid &aOpId);
|
---|
57 | HRESULT runOperation(const com::Guid &aOpId,
|
---|
58 | LONG64 aTimeout);
|
---|
59 | HRESULT checkOperationResult(const com::Guid &aOpId,
|
---|
60 | LONG64 *aStartOpTime,
|
---|
61 | LONG64 *aLastTime,
|
---|
62 | CloudOperationResult_T *aResult);
|
---|
63 | HRESULT getOperationParameterNames(CloudOperation_T aCloudOperation,
|
---|
64 | std::vector<com::Utf8Str> &aParameterNames);
|
---|
65 | HRESULT getOperationParameterProperties(const com::Utf8Str &aOpParameterName,
|
---|
66 | com::Utf8Str &aOpParameterType,
|
---|
67 | com::Utf8Str &aOpParameterDesc,
|
---|
68 | std::vector<com::Utf8Str> &aOpParameterValues);
|
---|
69 | HRESULT setParametersForOperation(const com::Guid &aOpId,
|
---|
70 | const std::vector<com::Utf8Str> &aValues);
|
---|
71 | };
|
---|
72 |
|
---|
73 | class CloudClientOCI :
|
---|
74 | public CloudClient
|
---|
75 | {
|
---|
76 | public:
|
---|
77 | DECLARE_EMPTY_CTOR_DTOR(CloudClientOCI)
|
---|
78 |
|
---|
79 | HRESULT initCloudClient(CloudUserProfiles *aProfiles,
|
---|
80 | VirtualBox *aParent,
|
---|
81 | CloudProviderId_T aCloudProvider,
|
---|
82 | const com::Utf8Str &aProfileName);
|
---|
83 |
|
---|
84 | private:
|
---|
85 | HRESULT getOperationParameters(CloudOperation_T aCloudOperation, com::Utf8Str &aJsonString);
|
---|
86 |
|
---|
87 | HRESULT createOperation(const com::Utf8Str &aProfileName,
|
---|
88 | CloudOperation_T aCloudOperation,
|
---|
89 | com::Guid &aOpId);
|
---|
90 | HRESULT runOperation(const com::Guid &aOpId,
|
---|
91 | LONG64 aTimeout);
|
---|
92 | HRESULT checkOperationResult(const com::Guid &aOpId,
|
---|
93 | LONG64 *aStartOpTime,
|
---|
94 | LONG64 *aLastTime,
|
---|
95 | CloudOperationResult_T *aResult);
|
---|
96 | HRESULT getOperationParameterNames(CloudOperation_T aCloudOperation,
|
---|
97 | std::vector<com::Utf8Str> &aParameterNames);
|
---|
98 | HRESULT getOperationParameterProperties(const com::Utf8Str &aOpParameterName,
|
---|
99 | com::Utf8Str &aOpParameterType,
|
---|
100 | com::Utf8Str &aOpParameterDesc,
|
---|
101 | std::vector<com::Utf8Str> &aOpParameterValues);
|
---|
102 | HRESULT setParametersForOperation(const com::Guid &aOpId,
|
---|
103 | const std::vector<com::Utf8Str> &aValues);
|
---|
104 | };
|
---|
105 |
|
---|
106 | #endif // !____H_CLOUDCLIENTIMPL
|
---|
107 | /* vi: set tabstop=4 shiftwidth=4 expandtab: */
|
---|
108 |
|
---|