Microsoft Information Protection SDK - C++ 1.17
API Reference Documentation for C++
Loading...
Searching...
No Matches
ProtectionProfile::Settings Class Reference

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

#include <protection_profile.h>

Public Member Functions

 Settings (const std::shared_ptr< MipContext > &mipContext, CacheStorageType cacheStorageType, const std::shared_ptr< ConsentDelegate > &consentDelegate, const std::shared_ptr< ProtectionProfile::Observer > &observer)
 ProtectionProfile::Settings constructor that specifies an observer to be used for async operations.
 
 Settings (const std::shared_ptr< MipContext > &mipContext, CacheStorageType cacheStorageType, const std::shared_ptr< ConsentDelegate > &consentDelegate)
 ProtectionProfile::Settings constructor, used for synchronous operations.
 
CacheStorageType GetCacheStorageType () const
 Get whether caches are stored in memory or on disk.
 
std::shared_ptr< ConsentDelegateGetConsentDelegate () const
 Gets the consent delegate used for connecting to services.
 
std::shared_ptr< ProtectionProfile::ObserverGetObserver () const
 Gets the observer that receives notifications of events related to ProtectionProfile.
 
std::shared_ptr< MipContextGetMipContext () const
 Get MIP context which represents shared state across all profiles.
 
std::shared_ptr< HttpDelegateGetHttpDelegate () const
 Get the HTTP delegate (if any) provided by the application.
 
void SetHttpDelegate (const std::shared_ptr< HttpDelegate > &httpDelegate)
 Override default HTTP stack with client's own.
 
std::shared_ptr< StorageDelegateGetStorageDelegate () const
 Get the StorageDelegate (if any) provided by the application.
 
void SetStorageDelegate (const std::shared_ptr< StorageDelegate > &storageDelegate)
 Override default storage cache with client's own implementation.
 
std::shared_ptr< TaskDispatcherDelegateGetTaskDispatcherDelegate () const
 Get the TaskDispatcher delegate (if any) provided by the application.
 
void SetTaskDispatcherDelegate (const std::shared_ptr< TaskDispatcherDelegate > &taskDispatcherDelegate)
 Override default asynchonous task dispatching handling with client's own.
 
void SetSessionId (const std::string &sessionId)
 Sets the session ID.
 
const std::string & GetSessionId () const
 Gets the session ID.
 
void SetCanCacheLicenses (bool canCacheLicenses)
 Configures whether or not end user licenses (EULs) will be cached locally.
 
bool CanCacheLicenses () const
 Gets whether or not end user licenses (EULs) are cached locally.
 
void SetCustomSettings (const std::vector< std::pair< std::string, std::string > > &customSettings)
 Set the custom settings, used for feature gating and testing.
 
const std::vector< std::pair< std::string, std::string > > & GetCustomSettings () const
 Get the custom settings, used for feature gating and testing.
 
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.
 
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 AddRedirectionUri (const std::string &originalUri, const std::string &redirectUri)
 Adds a redirect uri.
 
const std::map< std::string, std::string > & GetRedirectionUris () const
 Gets the redirection uris.
 
DnsRedirection GetDnsRedirection () const
 Gets the dns redirect mode.
 
void SetDnsRedirection (DnsRedirection dnsRedirection)
 Sets the dns redirection mode that controls how redirection is handled during online operations.
 

Private Attributes

std::shared_ptr< MipContextmMipContext
 
CacheStorageType mCacheStorageType
 
std::shared_ptr< ConsentDelegatemConsentDelegate
 
std::shared_ptr< ProtectionProfile::ObservermObserver
 
std::shared_ptr< HttpDelegatemHttpDelegate
 
std::shared_ptr< TaskDispatcherDelegatemTaskDispatcherDelegate
 
std::string mSessionId
 
bool mCanCacheLicenses = true
 
std::vector< std::pair< std::string, std::string > > mCustomSettings
 
std::shared_ptr< void > mLoggerContext
 
std::map< std::string, std::string > mRedirectionUris
 
std::shared_ptr< StorageDelegatemStorageDelegate
 
DnsRedirection mDnsRedirection
 

Detailed Description

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

Constructor & Destructor Documentation

◆ Settings() [1/2]

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

ProtectionProfile::Settings constructor that specifies an observer to be used for async operations.

Parameters
mipContextGlobal context settings
cacheStorageTypeStore any cached state in memory or on disk
consentDelegateDelegate used to obtain user permission to access external resources
observerObserver instance that will receive notifications of events related to ProtectionProfile
applicationInfoInfo about application that is consuming the protection SDK

◆ Settings() [2/2]

ProtectionProfile::Settings::Settings ( const std::shared_ptr< MipContext > & mipContext,
CacheStorageType cacheStorageType,
const std::shared_ptr< ConsentDelegate > & consentDelegate )
inline

ProtectionProfile::Settings constructor, used for synchronous operations.

Parameters
mipContextGlobal context settings
cacheStorageTypeStore any cached state in memory or on disk
consentDelegateDelegate used to obtain user permission to access external resources
applicationInfoInfo about application which is consuming the protection SDK

Member Function Documentation

◆ AddRedirectionUri()

void ProtectionProfile::Settings::AddRedirectionUri ( const std::string & originalUri,
const std::string & redirectUri )
inline

Adds a redirect uri.

Parameters
originalUriThe uri that should be redirected from
redirectUriThe uri that will replace the originalUri
Note
Use this function to provide a domain that should be redirected to another Uri The originalUri will be normalized before comparison with the domain for the current request. If the domain of the current request matches that of the originalUri then the redirectUri will be used instead This redirection will occur before DNS lookup redirection

◆ CanCacheLicenses()

bool ProtectionProfile::Settings::CanCacheLicenses ( ) const
inline

Gets whether or not end user licenses (EULs) are cached locally.

Returns
License caching configuration

◆ GetCacheStorageType()

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

Get whether caches are stored in memory or on disk.

Returns
storage type used

◆ GetConsentDelegate()

std::shared_ptr< ConsentDelegate > ProtectionProfile::Settings::GetConsentDelegate ( ) const
inline

Gets the consent delegate used for connecting to services.

Returns
Consent delegate used for connecting to services

◆ GetCustomSettings()

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

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

Returns
List of name/value pairs.

◆ GetDnsRedirection()

DnsRedirection ProtectionProfile::Settings::GetDnsRedirection ( ) const
inline

Gets the dns redirect mode.

Returns
The redirect mode used

◆ GetHttpDelegate()

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

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

Returns
HTTP delegate to be used for HTTP operations

◆ GetLoggerContext()

const std::shared_ptr< void > & ProtectionProfile::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

◆ GetMipContext()

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

Get MIP context which represents shared state across all profiles.

Returns
MIP context

◆ GetObserver()

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

Gets the observer that receives notifications of events related to ProtectionProfile.

Returns
Observer that receives notifications of events related to ProtectionProfile

◆ GetRedirectionUris()

const std::map< std::string, std::string > & ProtectionProfile::Settings::GetRedirectionUris ( ) const
inline

Gets the redirection uris.

Returns
Map of redirection uris

◆ GetSessionId()

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

Gets the session ID.

Returns
Session ID that will be used to correlate logs/telemetry

◆ GetStorageDelegate()

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

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

Returns
StorageDelegate to be used for caching

◆ GetTaskDispatcherDelegate()

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

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

Returns
TaskDispatcher delegate to be used for executing asynchronous tasks

◆ SetCanCacheLicenses()

void ProtectionProfile::Settings::SetCanCacheLicenses ( bool canCacheLicenses)
inline

Configures whether or not end user licenses (EULs) will be cached locally.

Parameters
canCacheLicensesWhether or not engine should cache a license when opening protected content
Note
If true, opening protected content will cache the associated license locally. If false, opening protected content will always perform HTTP operation to acquire the license from the RMS service.

◆ SetCustomSettings()

void ProtectionProfile::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.

◆ SetDnsRedirection()

void ProtectionProfile::Settings::SetDnsRedirection ( DnsRedirection dnsRedirection)
inline

Sets the dns redirection mode that controls how redirection is handled during online operations.

Parameters
dnsRedirectionThe redirection mode to use

◆ SetHttpDelegate()

void ProtectionProfile::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

◆ SetLoggerContext()

void ProtectionProfile::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

◆ SetSessionId()

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

Sets the session ID.

Parameters
sessionIdSession ID that will be used to correlate logs/telemetry

◆ SetStorageDelegate()

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

Override default storage cache with client's own implementation.

Parameters
storageDelegateStorageDelegate interface implemented by client application

◆ SetTaskDispatcherDelegate()

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

Override default asynchonous 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.

Member Data Documentation

◆ mCacheStorageType

CacheStorageType ProtectionProfile::Settings::mCacheStorageType
private

◆ mCanCacheLicenses

bool ProtectionProfile::Settings::mCanCacheLicenses = true
private

◆ mConsentDelegate

std::shared_ptr<ConsentDelegate> ProtectionProfile::Settings::mConsentDelegate
private

◆ mCustomSettings

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

◆ mDnsRedirection

DnsRedirection ProtectionProfile::Settings::mDnsRedirection
private

◆ mHttpDelegate

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

◆ mLoggerContext

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

◆ mMipContext

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

◆ mObserver

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

◆ mRedirectionUris

std::map<std::string, std::string> ProtectionProfile::Settings::mRedirectionUris
private

◆ mSessionId

std::string ProtectionProfile::Settings::mSessionId
private

◆ mStorageDelegate

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

◆ mTaskDispatcherDelegate

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

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