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

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

#include <protection_engine.h>

Public Member Functions

 Settings (const Identity &identity, const std::shared_ptr< AuthDelegate > &authDelegate, const std::string &clientData, const std::string &locale="")
 ProtectionEngine::Settings constructor for creating a new engine.
 
 Settings (const std::string &engineId, const std::shared_ptr< AuthDelegate > &authDelegate, const std::string &clientData, const std::string &locale="")
 ProtectionEngine::Settings constructor for loading an existing engine.
 
const std::string & GetEngineId () const
 Gets the engine ID.
 
void SetEngineId (const std::string &engineId)
 Sets the engine ID.
 
const IdentityGetIdentity () const
 Gets the user Identity associated with the engine.
 
void SetIdentity (const Identity &identity)
 Sets the user Identity associated with the engine.
 
const std::string & GetClientData () const
 Gets custom data specified by client.
 
void SetClientData (const std::string &clientData)
 Sets custom data specified by client.
 
const std::string & GetLocale () const
 Gets the locale in which engine data will be written.
 
void SetCustomSettings (const std::vector< std::pair< std::string, std::string > > &value)
 Sets name/value pairs used for testing and experimentation.
 
const std::vector< std::pair< std::string, std::string > > & GetCustomSettings () const
 Gets name/value pairs used for testing and experimentation.
 
void SetSessionId (const std::string &sessionId)
 Sets the engine session ID, used for correlation of logging/telemetry.
 
const std::string & GetSessionId () const
 Gets the engine session ID.
 
void SetCloud (Cloud cloud)
 Optionally sets the target cloud.
 
Cloud GetCloud () const
 Gets the target cloud used by all service requests.
 
void SetDataBoundary (DataBoundary dataBoundary)
 Optionally sets the target diagnostic region.
 
DataBoundary GetDataBoundary () const
 Gets the data boundary region.
 
void SetCloudEndpointBaseUrl (const std::string &cloudEndpointBaseUrl)
 Sets the cloud endpoint base URL for custom cloud.
 
const std::string & GetCloudEndpointBaseUrl () const
 Gets the cloud base URL used by all service requests, if specified.
 
void SetAuthDelegate (const std::shared_ptr< AuthDelegate > &authDelegate)
 Set the Engine Auth Delegate.
 
std::shared_ptr< AuthDelegateGetAuthDelegate () const
 Get the Engine Auth Delegate.
 
const std::string & GetUnderlyingApplicationId () const
 Gets the Underlying Application ID.
 
void SetUnderlyingApplicationId (const std::string &underlyingApplicationId)
 Sets the Underlying Application ID.
 
bool GetAllowCloudServiceOnly () const
 Gets whether or not only cloud service is allowed.
 
void SetAllowCloudServiceOnly (bool allowCloudServiceOnly)
 Sets whether or not only cloud service is allowed.
 
std::chrono::hours GetTemplateRefreshInterval () const
 Gets the refresh rate of the protection templates.
 
int GetTemplateBatchSize () const
 Gets the number of templates to be requested in each batch during GetTemplates.
 
void SetTemplateRefreshArgs (std::chrono::hours templateRefreshRateHours, int templateBatchSize=kMaxTemplateBatchNum)
 Sets a custom refresh rate for templates.
 
MIP_API void AddRmsCapability (const std::string &capability)
 Add a capability which will be passed along to RMS when fetching usage rights.
 
MIP_API bool RemoveRmsCapability (const std::string &capability)
 Remove one of the added usage rights capabilities which get passed to RMS.
 
std::vector< std::string > GetRmsCapabilities () const
 The the full set of client capabilities supported when fetching usage rights from RMS.
 
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 engine.
 
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 engine.
 

Detailed Description

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

Constructor & Destructor Documentation

◆ Settings() [1/2]

ProtectionEngine::Settings::Settings ( const Identity & identity,
const std::shared_ptr< AuthDelegate > & authDelegate,
const std::string & clientData,
const std::string & locale = "" )
inline

ProtectionEngine::Settings constructor for creating a new engine.

Parameters
identityIdentity that will be associated with ProtectionEngine
authDelegateThe authentication delegate used by the SDK to acquire authentication tokens, will override the PolicyProfile::Settings::authDelegate if both provided
clientDatacustomizable client data that can be stored with the engine when unloaded and can be retrieved from a loaded engine.
localeEngine output will be provided in this locale.

◆ Settings() [2/2]

ProtectionEngine::Settings::Settings ( const std::string & engineId,
const std::shared_ptr< AuthDelegate > & authDelegate,
const std::string & clientData,
const std::string & locale = "" )
inline

ProtectionEngine::Settings constructor for loading an existing engine.

Parameters
engineIdUnique identifier of engine that will be loaded
authDelegateThe authentication delegate used by the SDK to acquire authentication tokens, will override the PolicyProfile::Settings::authDelegate if both provided
clientDatacustomizable client data that can be stored with the engine when unloaded and can be retrieved from a loaded engine.
localeEngine output will be provided in this locale.

Member Function Documentation

◆ AddRmsCapability()

MIP_API void ProtectionEngine::Settings::AddRmsCapability ( const std::string & capability)

Add a capability which will be passed along to RMS when fetching usage rights.

Parameters
capabilityThe header representing a capability that RMS should support

◆ GetAllowCloudServiceOnly()

bool ProtectionEngine::Settings::GetAllowCloudServiceOnly ( ) const
inline

Gets whether or not only cloud service is allowed.

Returns
A boolean value indicating whether or not only cloud service is allowed

◆ GetAuthDelegate()

std::shared_ptr< AuthDelegate > ProtectionEngine::Settings::GetAuthDelegate ( ) const
inline

Get the Engine Auth Delegate.

Returns
the Engine Auth Delegate.

◆ GetClientData()

const std::string & ProtectionEngine::Settings::GetClientData ( ) const
inline

Gets custom data specified by client.

Returns
Custom data specified by client

◆ GetCloud()

Cloud ProtectionEngine::Settings::GetCloud ( ) const
inline

Gets the target cloud used by all service requests.

Returns
cloud

◆ GetCloudEndpointBaseUrl()

const std::string & ProtectionEngine::Settings::GetCloudEndpointBaseUrl ( ) const
inline

Gets the cloud base URL used by all service requests, if specified.

Returns
base URL

◆ GetCustomSettings()

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

Gets name/value pairs used for testing and experimentation.

Returns
Name/value pairs used for testing and experimentation

◆ GetDataBoundary()

DataBoundary ProtectionEngine::Settings::GetDataBoundary ( ) const
inline

Gets the data boundary region.

Returns
DataBoundary

◆ GetEngineId()

const std::string & ProtectionEngine::Settings::GetEngineId ( ) const
inline

Gets the engine ID.

Returns
Engine ID

◆ GetIdentity()

const Identity & ProtectionEngine::Settings::GetIdentity ( ) const
inline

Gets the user Identity associated with the engine.

Returns
User Identity associated with the engine

◆ GetLocale()

const std::string & ProtectionEngine::Settings::GetLocale ( ) const
inline

Gets the locale in which engine data will be written.

Returns
Locale in which engine data will be written

◆ GetLoggerContext()

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

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

Returns
The logger context

◆ GetRmsCapabilities()

std::vector< std::string > ProtectionEngine::Settings::GetRmsCapabilities ( ) const
inline

The the full set of client capabilities supported when fetching usage rights from RMS.

◆ GetSessionId()

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

Gets the engine session ID.

Returns
Engine session ID

◆ GetTemplateBatchSize()

int ProtectionEngine::Settings::GetTemplateBatchSize ( ) const
inline

Gets the number of templates to be requested in each batch during GetTemplates.

Returns
The number of full template data requests per batch if offline publishing is enabled

◆ GetTemplateRefreshInterval()

std::chrono::hours ProtectionEngine::Settings::GetTemplateRefreshInterval ( ) const
inline

Gets the refresh rate of the protection templates.

Returns
The refresh rate of protection templates as chrono::hours
Note
A refresh rate of 0 hours means that templates will always be fetched from the service and never cached

◆ GetUnderlyingApplicationId()

const std::string & ProtectionEngine::Settings::GetUnderlyingApplicationId ( ) const
inline

Gets the Underlying Application ID.

Returns
Underlying Application ID

◆ RemoveRmsCapability()

MIP_API bool ProtectionEngine::Settings::RemoveRmsCapability ( const std::string & capability)

Remove one of the added usage rights capabilities which get passed to RMS.

Parameters
capabilityThe capability which should be removed.

◆ SetAllowCloudServiceOnly()

void ProtectionEngine::Settings::SetAllowCloudServiceOnly ( bool allowCloudServiceOnly)
inline

Sets whether or not only cloud service is allowed.

Parameters
allowCloudServiceOnlyA boolean value indicating whether or not only cloud service is allowed

◆ SetAuthDelegate()

void ProtectionEngine::Settings::SetAuthDelegate ( const std::shared_ptr< AuthDelegate > & authDelegate)
inline

Set the Engine Auth Delegate.

Parameters
authDelegatethe Auth delegate

◆ SetClientData()

void ProtectionEngine::Settings::SetClientData ( const std::string & clientData)
inline

Sets custom data specified by client.

Parameters
Customdata specified by client

◆ SetCloud()

void ProtectionEngine::Settings::SetCloud ( Cloud cloud)
inline

Optionally sets the target cloud.

Parameters
CloudCloud
Note
If cloud is not specified, then it will be determined by DNS lookup of the engine's identity domain if possible, else fall back to global cloud.

◆ SetCloudEndpointBaseUrl()

void ProtectionEngine::Settings::SetCloudEndpointBaseUrl ( const std::string & cloudEndpointBaseUrl)
inline

Sets the cloud endpoint base URL for custom cloud.

Parameters
cloudEndpointBaseUrlthe base URL used by all service requests (for example, "https://api.aadrm.com")
Note
This value will only be read and must be set for Cloud = Custom

◆ SetCustomSettings()

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

Sets name/value pairs used for testing and experimentation.

Parameters
customSettingsName/value pairs used for testing and experimentation

◆ SetDataBoundary()

void ProtectionEngine::Settings::SetDataBoundary ( DataBoundary dataBoundary)
inline

Optionally sets the target diagnostic region.

Parameters
dataBoundaryData boundary region
Note
If dataBoundary is not specified, then it will default to global diagnostic region.

◆ SetEngineId()

void ProtectionEngine::Settings::SetEngineId ( const std::string & engineId)
inline

Sets the engine ID.

Parameters
engineIdengine ID.

◆ SetIdentity()

void ProtectionEngine::Settings::SetIdentity ( const Identity & identity)
inline

Sets the user Identity associated with the engine.

Parameters
identityUser Identity associated with the engine

◆ SetLoggerContext()

void ProtectionEngine::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 engine.

Parameters
loggerContextThe logger context

◆ SetSessionId()

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

Sets the engine session ID, used for correlation of logging/telemetry.

Parameters
sessionIdEngine session ID, used for correlation of logging/telemetry

◆ SetTemplateRefreshArgs()

void ProtectionEngine::Settings::SetTemplateRefreshArgs ( std::chrono::hours templateRefreshRateHours,
int templateBatchSize = kMaxTemplateBatchNum )
inline

Sets a custom refresh rate for templates.

Warning
Engines will not refresh automatically on that interval, only on engine call to GetTemplates or GetTemplatesAsync
Parameters
templateRefreshRateHoursHow often to allow use of cached templates for protection. will always refresh by default. If hours are less than 0 will throw exception.
templateBatchSizeIf offline protection is enabled, how many template data responses are carried in a single request during fetching. Between 1 and 25.
Note
Will only refresh templates if outside of interval during an API that uses them. Will not automatically refresh in background.

◆ SetUnderlyingApplicationId()

void ProtectionEngine::Settings::SetUnderlyingApplicationId ( const std::string & underlyingApplicationId)
inline

Sets the Underlying Application ID.

Parameters
UnderlyingApplicationIdUnderlying Application ID.

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