Microsoft Information Protection SDK - C++ 1.17
API Reference Documentation for C++
Loading...
Searching...
No Matches
mip_configuration.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_MIP_CONFIGURATION_H_
34#define API_MIP_MIP_CONFIGURATION_H_
35
36#include <map>
37#include <memory>
38
41#include "mip/json_delegate.h"
42#include "mip/logger_delegate.h"
45#include "mip/xml_delegate.h"
46
47MIP_NAMESPACE_BEGIN
48
54public:
56 const ApplicationInfo& appInfo,
57 const std::string& path,
58 LogLevel thresholdLogLevel,
59 bool isOfflineOnly)
60 : mAppInfo(appInfo),
61 mPath(path),
62 mThresholdLogLevel(thresholdLogLevel),
66
72 const ApplicationInfo& GetApplicationInfo() const { return mAppInfo; }
73
79 const std::string& GetPath() const { return mPath; }
80
87
93 const bool isOfflineOnly() const { return mIsOfflineOnly; }
99 std::shared_ptr<DiagnosticConfiguration> GetDiagnosticConfiguration() const { return mDiagnosticConfiguration; }
100
106 void SetDiagnosticConfiguration(const std::shared_ptr<DiagnosticConfiguration>& diagnosticConfiguration) { mDiagnosticConfiguration = diagnosticConfiguration; }
107
113 std::shared_ptr<LoggerDelegate> GetLoggerDelegate() const { return mLoggerDelegate; }
114
120 void SetLoggerDelegate(const std::shared_ptr<LoggerDelegate>& loggerDelegate) { mLoggerDelegate = loggerDelegate; }
121
127 std::shared_ptr<LoggerConfiguration> GetLoggerConfiguration() const { return mLoggerConfiguration; }
128
134 void SetLoggerConfiguration(const std::shared_ptr<LoggerConfiguration>& loggerConfiguration) { mLoggerConfiguration = loggerConfiguration; }
135
141 std::shared_ptr<StorageDelegate> GetStorageDelegate() const { return mStorageDelegate; }
142
148 void SetStorageDelegate(const std::shared_ptr<StorageDelegate>& storageDelegate) { mStorageDelegate = storageDelegate; }
149
155 std::shared_ptr<HttpDelegate> GetHttpDelegate() const { return mHttpDelegate; }
156
162 void SetHttpDelegate(const std::shared_ptr<HttpDelegate>& httpDelegate) { mHttpDelegate = httpDelegate; }
163
169 std::shared_ptr<JsonDelegate> GetJsonDelegate() const {
170 return mJsonDelegate;
171 }
172
180 std::shared_ptr<xml::XmlDelegate> GetXmlDelegate() const { return mXmlDelegate; }
181
187 std::map<FlightingFeature, bool> GetFeatureSettings() const { return mfeatureSettings; }
188
194 void SetFeatureSettings(const std::map<FlightingFeature, bool>& featureSettings) { mfeatureSettings = featureSettings; }
195
202
208 void SetApiLogCacheMaxMessages(size_t maxMessages) { mApiLogCacheMaxMessages = maxMessages; }
209
211
212protected:
213 std::shared_ptr<JsonDelegate> mJsonDelegate;
214 std::shared_ptr<xml::XmlDelegate> mXmlDelegate;
215
216private:
218 std::string mPath;
221 std::shared_ptr<LoggerDelegate> mLoggerDelegate;
222 std::shared_ptr<DiagnosticConfiguration> mDiagnosticConfiguration;
223 std::shared_ptr<StorageDelegate> mStorageDelegate;
224 std::map<FlightingFeature, bool> mfeatureSettings;
226 std::shared_ptr<HttpDelegate> mHttpDelegate;
227 std::shared_ptr<LoggerConfiguration> mLoggerConfiguration;
229 };
230
231MIP_NAMESPACE_END
232#endif // API_MIP_MIP_CONFIGURATION_H_
Configuration used by MIP sdk during its creation and throughout its lifetime.
Definition mip_configuration.h:53
std::shared_ptr< xml::XmlDelegate > mXmlDelegate
Definition mip_configuration.h:214
std::shared_ptr< DiagnosticConfiguration > GetDiagnosticConfiguration() const
Get the Diagnostic (if any) provided by the application.
Definition mip_configuration.h:99
ApplicationInfo mAppInfo
Definition mip_configuration.h:217
MipConfiguration(const ApplicationInfo &appInfo, const std::string &path, LogLevel thresholdLogLevel, bool isOfflineOnly)
Definition mip_configuration.h:55
LogLevel mThresholdLogLevel
Definition mip_configuration.h:219
std::shared_ptr< xml::XmlDelegate > GetXmlDelegate() const
Get the XmlDelegate (if any) override implementation. MipConfiguration needs to be derived from to ov...
Definition mip_configuration.h:180
const ApplicationInfo & GetApplicationInfo() const
Get the Description of host application.
Definition mip_configuration.h:72
void SetLoggerDelegate(const std::shared_ptr< LoggerDelegate > &loggerDelegate)
Set the LoggerDelegate (if any) override implementation.
Definition mip_configuration.h:120
size_t mApiLogCacheMaxMessages
Definition mip_configuration.h:225
std::shared_ptr< DiagnosticConfiguration > mDiagnosticConfiguration
Definition mip_configuration.h:222
const LogLevel & GetThresholdLogLevel() const
Get the Minimum log level for .miplog.
Definition mip_configuration.h:86
std::shared_ptr< LoggerDelegate > mLoggerDelegate
Definition mip_configuration.h:221
std::shared_ptr< JsonDelegate > mJsonDelegate
Definition mip_configuration.h:213
std::shared_ptr< HttpDelegate > mHttpDelegate
Definition mip_configuration.h:226
void SetFeatureSettings(const std::map< FlightingFeature, bool > &featureSettings)
Set the Flighting features which should be set to non-default values.
Definition mip_configuration.h:194
~MipConfiguration()
Definition mip_configuration.h:210
void SetLoggerConfiguration(const std::shared_ptr< LoggerConfiguration > &loggerConfiguration)
Override the default logger configuration.
Definition mip_configuration.h:134
std::map< FlightingFeature, bool > GetFeatureSettings() const
Get the Flighting features which should be set to non-default values.
Definition mip_configuration.h:187
const std::string & GetPath() const
Get the File path for logs, caches, etc.
Definition mip_configuration.h:79
std::string mPath
Definition mip_configuration.h:218
void SetHttpDelegate(const std::shared_ptr< HttpDelegate > &httpDelegate)
Set the HttpDelegate (if any) override implementation. It's a required delegate for MIP Core Context.
Definition mip_configuration.h:162
std::shared_ptr< StorageDelegate > GetStorageDelegate() const
Get the StorageDelegate (if any) override implementation.
Definition mip_configuration.h:141
const bool isOfflineOnly() const
whether Network operations is enabled or disabled(not all actions supported when offline)
Definition mip_configuration.h:93
std::shared_ptr< HttpDelegate > GetHttpDelegate() const
Get the HttpDelegate (if any) override implementation.
Definition mip_configuration.h:155
std::shared_ptr< JsonDelegate > GetJsonDelegate() const
Get the JsonDelegate (if any) override implementation.
Definition mip_configuration.h:169
std::shared_ptr< LoggerConfiguration > mLoggerConfiguration
Definition mip_configuration.h:227
std::shared_ptr< StorageDelegate > mStorageDelegate
Definition mip_configuration.h:223
std::shared_ptr< LoggerDelegate > GetLoggerDelegate() const
Get the LoggerDelegate (if any) override implementation.
Definition mip_configuration.h:113
void SetDiagnosticConfiguration(const std::shared_ptr< DiagnosticConfiguration > &diagnosticConfiguration)
Override default configuration of diagnostic.
Definition mip_configuration.h:106
std::shared_ptr< LoggerConfiguration > GetLoggerConfiguration() const
Get the override configuration (if any) for the default logger implementation.
Definition mip_configuration.h:127
std::map< FlightingFeature, bool > mfeatureSettings
Definition mip_configuration.h:224
size_t GetApiLogCacheMaxMessages() const
Get the max messages per Api call that will be logged in the api log cache.
Definition mip_configuration.h:201
void SetStorageDelegate(const std::shared_ptr< StorageDelegate > &storageDelegate)
Set the StorageDelegate (if any) override implementation. It's a required delegate for MIP Core Conte...
Definition mip_configuration.h:148
void SetApiLogCacheMaxMessages(size_t maxMessages)
Set the max messages per Api call that will be logged in the api log cache. Setting this to 0 will di...
Definition mip_configuration.h:208
bool mIsOfflineOnly
Definition mip_configuration.h:220
Defines custom telemetry or audit configurations.
A file containing the FlightingFeature definition.
Contains the JsonDelegate interface used to parse and produce JSON data.
LogLevel
Different log levels used across the MIP SDK.
Definition log_message_data.h:48
A file containing the LoggerDelegate class to be used to override MIP logger.
Defines StorageDelegate interface.
A struct that includes application specific information.
Definition common_types.h:523
A file containing the TaskDispatcherDelegate interface to be used to override MIP async task executor...
Contains XmlDelegate interface definition used to parse xml recieved by mip.