Microsoft Information Protection (MIP) SDK for C++: Reference 1.16
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>

Collaboration diagram for PolicyProfile::Settings:

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.
 
 ~Settings ()
 

Private Attributes

CacheStorageType mCacheStorageType
 
std::vector< std::pair< std::string, std::string > > mCustomSettings
 
std::shared_ptr< HttpDelegatemHttpDelegate
 
std::shared_ptr< void > mLoggerContext
 
std::shared_ptr< MipContextmMipContext
 
std::shared_ptr< PolicyProfile::ObservermObserver
 
std::string mSessionId
 
std::shared_ptr< StorageDelegatemStorageDelegate
 
std::shared_ptr< TaskDispatcherDelegatemTaskDispatcherDelegate
 

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) {}
CacheStorageType mCacheStorageType
std::shared_ptr< MipContext > mMipContext
std::shared_ptr< PolicyProfile::Observer > mObserver

◆ ~Settings()

PolicyProfile::Settings::~Settings ( )
inline

Definition at line 320 of file policy_profile.h.

320{ }

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; }

References 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 }
std::vector< std::pair< std::string, std::string > > mCustomSettings

References mCustomSettings.

◆ 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; }
std::shared_ptr< HttpDelegate > mHttpDelegate

References 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; }
std::shared_ptr< void > mLoggerContext

References 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; }

References 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; }

References mObserver.

◆ GetSessionId()

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

Definition at line 281 of file policy_profile.h.

281 {
282 return mSessionId;
283 }

References mSessionId.

◆ 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; }
std::shared_ptr< StorageDelegate > mStorageDelegate

References 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; }
std::shared_ptr< TaskDispatcherDelegate > mTaskDispatcherDelegate

References 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 }

References mCustomSettings.

◆ 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; }

References mHttpDelegate.

◆ 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 }

References mLoggerContext.

◆ SetSessionId()

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

Definition at line 277 of file policy_profile.h.

277 {
278 mSessionId = sessionId;
279 }

References mSessionId.

◆ 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; }

References mStorageDelegate.

◆ 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 }

References mTaskDispatcherDelegate.

Member Data Documentation

◆ mCacheStorageType

CacheStorageType PolicyProfile::Settings::mCacheStorageType
private

Definition at line 323 of file policy_profile.h.

Referenced by GetCacheStorageType().

◆ mCustomSettings

std::vector<std::pair<std::string, std::string> > PolicyProfile::Settings::mCustomSettings
private

Definition at line 328 of file policy_profile.h.

Referenced by GetCustomSettings(), and SetCustomSettings().

◆ mHttpDelegate

std::shared_ptr<HttpDelegate> PolicyProfile::Settings::mHttpDelegate
private

Definition at line 325 of file policy_profile.h.

Referenced by GetHttpDelegate(), and SetHttpDelegate().

◆ mLoggerContext

std::shared_ptr<void> PolicyProfile::Settings::mLoggerContext
private

Definition at line 329 of file policy_profile.h.

Referenced by GetLoggerContext(), and SetLoggerContext().

◆ mMipContext

std::shared_ptr<MipContext> PolicyProfile::Settings::mMipContext
private

Definition at line 322 of file policy_profile.h.

Referenced by GetMipContext().

◆ mObserver

std::shared_ptr<PolicyProfile::Observer> PolicyProfile::Settings::mObserver
private

Definition at line 324 of file policy_profile.h.

Referenced by GetObserver().

◆ mSessionId

std::string PolicyProfile::Settings::mSessionId
private

Definition at line 327 of file policy_profile.h.

Referenced by GetSessionId(), and SetSessionId().

◆ mStorageDelegate

std::shared_ptr<StorageDelegate> PolicyProfile::Settings::mStorageDelegate
private

Definition at line 330 of file policy_profile.h.

Referenced by GetStorageDelegate(), and SetStorageDelegate().

◆ mTaskDispatcherDelegate

std::shared_ptr<TaskDispatcherDelegate> PolicyProfile::Settings::mTaskDispatcherDelegate
private

Definition at line 326 of file policy_profile.h.

Referenced by GetTaskDispatcherDelegate(), and SetTaskDispatcherDelegate().


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