Microsoft Information Protection SDK - C++ 1.18
API Reference Documentation for C++
Loading...
Searching...
No Matches
cloud_discovery_delegate.h
Go to the documentation of this file.
1/*
2 *
3 * Copyright (c) Microsoft Corporation.
4 * All rights reserved.
5 *
6 * This code is licensed under the MIT License.
7 *
8 * Permission is hereby granted, free of charge, to any person obtaining a copy
9 * of this software and associated documentation files(the "Software"), to deal
10 * in the Software without restriction, including without limitation the rights
11 * to use, copy, modify, merge, publish, distribute, sublicense, and / or sell
12 * copies of the Software, and to permit persons to whom the Software is
13 * furnished to do so, subject to the following conditions :
14 *
15 * The above copyright notice and this permission notice shall be included in
16 * all copies or substantial portions of the Software.
17 *
18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE
21 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24 * THE SOFTWARE.
25 *
26 */
33#ifndef API_MIP_CLOUD_DISCOVERY_DELEGATE_H_
34#define API_MIP_CLOUD_DISCOVERY_DELEGATE_H_
35
36#include <functional>
37#include <string>
38#include <vector>
39
40#include "mip/common_types.h"
41#include "mip/mip_namespace.h"
42
43MIP_NAMESPACE_BEGIN
44
50public:
53 mUrl(""),
54 mResource(""),
55 mAuthority("") {
56 }
57
58 ServiceInfo(ServiceType serviceType, std::string url)
59 : ServiceInfo(serviceType, url, "", "") {
60 }
61
62 ServiceInfo(ServiceType serviceType, std::string url, std::string resource, std::string authority)
63 : mServiceType(serviceType),
64 mUrl(url),
65 mResource(resource),
66 mAuthority(authority) {
67 }
68
75
81 std::string GetUrl() const { return mUrl; }
82
88 std::string GetResource() const { return mResource; }
89
95 std::string GetAuthority() const { return mAuthority; }
96
97private:
99 std::string mUrl;
100 std::string mResource;
101 std::string mAuthority;
102};
103
104typedef std::vector<ServiceInfo> ServicesInfo;
105
110public:
119 virtual ServicesInfo GetServicesInfo() const = 0;
120
129 virtual bool IsSovereignCloud() const = 0;
130};
131
136public:
146 const std::string& domainInfo,
147 const std::shared_ptr<void>& context) = 0;
148
157 const std::string& domainInfo,
158 const std::shared_ptr<void>& context,
159 const std::function<void(const std::shared_ptr<CloudDiscoveryResult>& )>& callbackFn) = 0;
160
171 const mip::Cloud cloud,
172 const mip::DataBoundary dataBoundary,
173 const std::shared_ptr<void>& context) = 0;
174
184 const mip::Cloud cloud,
185 const mip::DataBoundary dataBoundary,
186 const std::shared_ptr<void>& context,
187 const std::function<void(const std::shared_ptr<CloudDiscoveryResult>& )>& callbackFn) = 0;
188
197 virtual bool IsSovereignCloud(
198 const std::string& domainInfo,
199 const std::shared_ptr<void>& context) = 0;
200
209 const std::string& domainInfo,
210 const std::shared_ptr<void>& context,
211 const std::function<void(const std::shared_ptr<CloudDiscoveryResult>& )>& callbackFn) = 0;
212
218 virtual bool IsOffline() const = 0;
219
222 virtual ~CloudDiscoveryDelegate() {}
223
224protected:
226
228};
229
230MIP_NAMESPACE_END
231#endif // API_MIP_CLOUD_DISCOVERY_DELEGATE_H_
232
Interface for overriding cloud discovery.
Definition cloud_discovery_delegate.h:135
virtual bool IsOffline() const =0
if this cloud discovery delegate is offline only.
virtual void IsSovereignCloudAsync(const std::string &domainInfo, const std::shared_ptr< void > &context, const std::function< void(const std::shared_ptr< CloudDiscoveryResult > &)> &callbackFn)=0
Asynchronously detect if the given domain info is a sovereign cloud.
virtual ServicesInfo GetServicesInfo(const mip::Cloud cloud, const mip::DataBoundary dataBoundary, const std::shared_ptr< void > &context)=0
Get all services information for the given cloud and data boundary.
virtual void GetServicesInfoAsync(const std::string &domainInfo, const std::shared_ptr< void > &context, const std::function< void(const std::shared_ptr< CloudDiscoveryResult > &)> &callbackFn)=0
Asynchronously get all services information for the given domain info.
virtual ServicesInfo GetServicesInfo(const std::string &domainInfo, const std::shared_ptr< void > &context)=0
Get all services information for the given domain info.
virtual bool IsSovereignCloud(const std::string &domainInfo, const std::shared_ptr< void > &context)=0
detect if the given domain info is a sovereign cloud.
virtual void GetServicesInfoAsync(const mip::Cloud cloud, const mip::DataBoundary dataBoundary, const std::shared_ptr< void > &context, const std::function< void(const std::shared_ptr< CloudDiscoveryResult > &)> &callbackFn)=0
Asynchronously get all services information for the given cloud and data boundary.
Interface for the result of cloud discovery.
Definition cloud_discovery_delegate.h:109
virtual bool IsSovereignCloud() const =0
detect if the given domain info is a sovereign cloud.
virtual ServicesInfo GetServicesInfo() const =0
Get the services information ServicesInfo.
Service information returned by cloud discovery.
Definition cloud_discovery_delegate.h:49
ServiceType mServiceType
Definition cloud_discovery_delegate.h:98
ServiceInfo()
Definition cloud_discovery_delegate.h:51
ServiceInfo(ServiceType serviceType, std::string url, std::string resource, std::string authority)
Definition cloud_discovery_delegate.h:62
std::string mResource
Definition cloud_discovery_delegate.h:100
std::string GetUrl() const
Gets the service URL like https://api.aadrm.com.
Definition cloud_discovery_delegate.h:81
std::string GetAuthority() const
Gets the authority string for authentication.
Definition cloud_discovery_delegate.h:95
ServiceType GetServiceType() const
Gets the service type of this ServiceInfo, like Protection, Policy, Telemetry, etc.
Definition cloud_discovery_delegate.h:74
std::string mUrl
Definition cloud_discovery_delegate.h:99
std::string mAuthority
Definition cloud_discovery_delegate.h:101
std::string GetResource() const
Gets the resource string for authentication.
Definition cloud_discovery_delegate.h:88
ServiceInfo(ServiceType serviceType, std::string url)
Definition cloud_discovery_delegate.h:58
std::vector< ServiceInfo > ServicesInfo
Definition cloud_discovery_delegate.h:104
A file Containing the common types used by the upe, file and protection modules.
ServiceType
Service type identifier.
Definition common_types.h:784
MIP namespace macros.