Microsoft Information Protection (MIP) SDK for C++: Reference 1.15
Doxygen-generated documentation for MIP SDK written in C++
Loading...
Searching...
No Matches
PolicyProfile::Settings Class Reference

Settings used by PolicyProfile during its creation and throughout its lifetime. More...

#include <src/api/mip/upe/policy_profile.h>

Public Member Functions

CacheStorageType GetCacheStorageType () const
 Get whether caches are stored in memory or on disk.
 
const std::vector< std::pair< std::string, std::string > > & GetCustomSettings () const
 Get the custom settings, used for feature gating and testing.
 
std::shared_ptr< HttpDelegateGetHttpDelegate () const
 Get the HTTP delegate (if any) provided by the application.
 
const std::shared_ptr< void > & GetLoggerContext () const
 Get logger context that will be opaquely passed to the logger delegate for logs associated with the created profile.
 
std::shared_ptr< MipContextGetMipContext () const
 Get MIP context which represents shared state across all profiles.
 
const std::shared_ptr< PolicyProfile::Observer > & GetObserver () const
 Get the event observer.
 
const std::string & GetSessionId () const
 
std::shared_ptr< StorageDelegateGetStorageDelegate () const
 Get the StorageDelegate (if any) provided by the application.
 
std::shared_ptr< TaskDispatcherDelegateGetTaskDispatcherDelegate () const
 Get the TaskDispatcher delegate (if any) provided by the application.
 
void SetCustomSettings (const std::vector< std::pair< std::string, std::string > > &customSettings)
 Set the custom settings, used for feature gating and testing.
 
void SetHttpDelegate (const std::shared_ptr< HttpDelegate > &httpDelegate)
 Override default HTTP stack with client's own.
 
void SetLoggerContext (const std::shared_ptr< void > &loggerContext)
 Sets the logger context that will be opaquely passed to the logger delegate for logs associated with the created profile.
 
void SetSessionId (const std::string &sessionId)
 
void SetStorageDelegate (const std::shared_ptr< StorageDelegate > &storageDelegate)
 Override default storage cache with client's own implementation.
 
void SetTaskDispatcherDelegate (const std::shared_ptr< TaskDispatcherDelegate > &taskDispatcherDelegate)
 Override default asynchronous task dispatching handling with client's own.
 
 Settings (const std::shared_ptr< MipContext > &mipContext, CacheStorageType cacheStorageType, const std::shared_ptr< PolicyProfile::Observer > &observer)
 Interface for configuring the profile.
 

Detailed Description

Settings used by PolicyProfile during its creation and throughout its lifetime.

Definition at line 192 of file policy_profile.h.

Constructor & Destructor Documentation

◆ Settings()

PolicyProfile::Settings::Settings ( const std::shared_ptr< MipContext > & mipContext,
CacheStorageType cacheStorageType,
const std::shared_ptr< PolicyProfile::Observer > & observer )
inline

Interface for configuring the profile.

Parameters
mipContextGlobal context settings
cacheStorageTypeStore any cached state in memory or on disk
observerA class implementing the PolicyProfile::Observer interface. Can be nullptr.

Definition at line 201 of file policy_profile.h.

205 : mMipContext(mipContext),
206 mCacheStorageType(cacheStorageType),
207 mObserver(observer) {}

Member Function Documentation

◆ GetCacheStorageType()

CacheStorageType PolicyProfile::Settings::GetCacheStorageType ( ) const
inline

Get whether caches are stored in memory or on disk.

Returns
storage type used

Definition at line 214 of file policy_profile.h.

214{ return mCacheStorageType; }

◆ GetCustomSettings()

const std::vector< std::pair< std::string, std::string > > & PolicyProfile::Settings::GetCustomSettings ( ) const
inline

Get the custom settings, used for feature gating and testing.

Returns
List of name/value pairs.

Definition at line 299 of file policy_profile.h.

299 {
300 return mCustomSettings;
301 }

◆ GetHttpDelegate()

std::shared_ptr< HttpDelegate > PolicyProfile::Settings::GetHttpDelegate ( ) const
inline

Get the HTTP delegate (if any) provided by the application.

Returns
Http delegate to be used for HTTP operations

Definition at line 235 of file policy_profile.h.

235{ return mHttpDelegate; }

◆ GetLoggerContext()

const std::shared_ptr< void > & PolicyProfile::Settings::GetLoggerContext ( ) const
inline

Get logger context that will be opaquely passed to the logger delegate for logs associated with the created profile.

Returns
The logger context

Definition at line 308 of file policy_profile.h.

308{ return mLoggerContext; }

◆ GetMipContext()

std::shared_ptr< MipContext > PolicyProfile::Settings::GetMipContext ( ) const
inline

Get MIP context which represents shared state across all profiles.

Returns
MIP context

Definition at line 228 of file policy_profile.h.

228{ return mMipContext; }

◆ GetObserver()

const std::shared_ptr< PolicyProfile::Observer > & PolicyProfile::Settings::GetObserver ( ) const
inline

Get the event observer.

Returns
the event observer.

Definition at line 221 of file policy_profile.h.

221{ return mObserver; }

◆ GetSessionId()

const std::string & PolicyProfile::Settings::GetSessionId ( ) const
inline

Definition at line 281 of file policy_profile.h.

281 {
282 return mSessionId;
283 }

◆ GetStorageDelegate()

std::shared_ptr< StorageDelegate > PolicyProfile::Settings::GetStorageDelegate ( ) const
inline

Get the StorageDelegate (if any) provided by the application.

Returns
StorageDelegate to be used for cache operations

Definition at line 249 of file policy_profile.h.

249{ return mStorageDelegate; }

◆ GetTaskDispatcherDelegate()

std::shared_ptr< TaskDispatcherDelegate > PolicyProfile::Settings::GetTaskDispatcherDelegate ( ) const
inline

Get the TaskDispatcher delegate (if any) provided by the application.

Returns
TaskDispatcher delegate to be used for executing asynchronous tasks

Definition at line 263 of file policy_profile.h.

263{ return mTaskDispatcherDelegate; }

◆ SetCustomSettings()

void PolicyProfile::Settings::SetCustomSettings ( const std::vector< std::pair< std::string, std::string > > & customSettings)
inline

Set the custom settings, used for feature gating and testing.

Parameters
customSettingsList of name/value pairs.

Definition at line 290 of file policy_profile.h.

290 {
291 mCustomSettings = customSettings;
292 }

◆ SetHttpDelegate()

void PolicyProfile::Settings::SetHttpDelegate ( const std::shared_ptr< HttpDelegate > & httpDelegate)
inline

Override default HTTP stack with client's own.

Parameters
httpDelegateHttp callback interface implemented by client application

Definition at line 242 of file policy_profile.h.

242{ mHttpDelegate = httpDelegate; }

◆ SetLoggerContext()

void PolicyProfile::Settings::SetLoggerContext ( const std::shared_ptr< void > & loggerContext)
inline

Sets the logger context that will be opaquely passed to the logger delegate for logs associated with the created profile.

Parameters
loggerContextThe logger context

Definition at line 316 of file policy_profile.h.

316 {
317 mLoggerContext = loggerContext;
318 }

◆ SetSessionId()

void PolicyProfile::Settings::SetSessionId ( const std::string & sessionId)
inline

Definition at line 277 of file policy_profile.h.

277 {
278 mSessionId = sessionId;
279 }

◆ SetStorageDelegate()

void PolicyProfile::Settings::SetStorageDelegate ( const std::shared_ptr< StorageDelegate > & storageDelegate)
inline

Override default storage cache with client's own implementation.

Parameters
storageDelegateStorageDelegate implemented by client application

Definition at line 256 of file policy_profile.h.

256{ mStorageDelegate = storageDelegate; }

◆ SetTaskDispatcherDelegate()

void PolicyProfile::Settings::SetTaskDispatcherDelegate ( const std::shared_ptr< TaskDispatcherDelegate > & taskDispatcherDelegate)
inline

Override default asynchronous task dispatching handling with client's own.

Parameters
taskDispatcherDelegateTask dispatching callback interface implemented by client application
Note
tasks can reference profile objects preventing its destruction as a result taskdispatcher queues should not be shared.

Definition at line 273 of file policy_profile.h.

273 {
274 mTaskDispatcherDelegate = taskDispatcherDelegate;
275 }

The documentation for this class was generated from the following file: