33#ifndef API_MIP_PROTECTION_PROTECTION_PROFILE_H_
34#define API_MIP_PROTECTION_PROTECTION_PROFILE_H_
83 const std::shared_ptr<ProtectionProfile>& profile,
84 const std::shared_ptr<void>& context) { UNUSED(profile); UNUSED(context); }
97 const std::exception_ptr& error,
98 const std::shared_ptr<void>& context) { UNUSED(error); UNUSED(context); }
107 const std::vector<std::string>& engineIds,
108 const std::shared_ptr<void>& context) { UNUSED(engineIds); UNUSED(context); }
117 const std::exception_ptr& error,
118 const std::shared_ptr<void>& context) { UNUSED(error); UNUSED(context); }
127 const std::shared_ptr<ProtectionEngine>& engine,
128 const std::shared_ptr<void>& context) { UNUSED(engine); UNUSED(context); }
137 const std::exception_ptr& error,
138 const std::shared_ptr<void>& context) { UNUSED(error); UNUSED(context); }
146 const std::shared_ptr<void>& context) { UNUSED(context); }
155 const std::exception_ptr& error,
156 const std::shared_ptr<void>& context) { UNUSED(error); UNUSED(context); }
179 const std::shared_ptr<MipContext>& mipContext,
181 const std::shared_ptr<ConsentDelegate>& consentDelegate,
182 const std::shared_ptr<ProtectionProfile::Observer>& observer)
188#if defined(MIP_OFFLINE_PUBLISHING_ENABLED) || defined(SWIG) || defined(SWIG_DIRECTORS)
189 mOfflinePublishing(false),
203 const std::shared_ptr<MipContext>& mipContext,
205 const std::shared_ptr<ConsentDelegate>& consentDelegate)
206 :
Settings(mipContext, cacheStorageType, consentDelegate, nullptr ) {
328 void SetCustomSettings(
const std::vector<std::pair<std::string, std::string>>& customSettings) {
341#if !defined(SWIG) && !defined(SWIG_DIRECTORS)
383#if defined(MIP_OFFLINE_PUBLISHING_ENABLED) || defined(SWIG) || defined(SWIG_DIRECTORS)
389 bool GetOfflinePublishing()
const {
390 return mOfflinePublishing;
399 void SetOfflinePublishing(
bool offlinePublishing) {
400 mOfflinePublishing = offlinePublishing;
435#if defined(MIP_OFFLINE_PUBLISHING_ENABLED) || defined(SWIG) || defined(SWIG_DIRECTORS)
436 bool mOfflinePublishing;
452 MIP_API
static std::shared_ptr<AsyncControl> __CDECL
LoadAsync(
454 const std::shared_ptr<void>& context);
463 MIP_API
static std::shared_ptr<ProtectionProfile> __CDECL
Load(
const Settings& settings);
488 virtual std::shared_ptr<AsyncControl>
ListEnginesAsync(
const std::shared_ptr<void>& context) = 0;
509 const std::shared_ptr<void>& context) = 0;
531 const std::string& engineId,
532 const std::shared_ptr<void>& context) = 0;
541#ifndef MIP_CORE_PACKAGE
551#if !defined(SWIG) && !defined(SWIG_DIRECTORS)
552 [[deprecated(
"ProtectionProfile::GetPublishingLicenseInfo(const std::vector<uint8_t>&) is deprecated, use ProtectionProfile::GetPublishingLicenseInfo(const std::vector<uint8_t>&, const std::shared_ptr<MipContext>&)")]]
555 const std::vector<uint8_t>& serializedPublishingLicense);
569 const std::vector<uint8_t>& serializedPublishingLicense,
570 const std::shared_ptr<MipContext>& mipContext);
Settings used by ProtectionEngine during its creation and throughout its lifetime.
Definition protection_engine.h:309
Interface that receives notifications related to ProtectionProfile.
Definition protection_profile.h:66
virtual void OnListEnginesSuccess(const std::vector< std::string > &engineIds, const std::shared_ptr< void > &context)
Called when list of engines was generated successfully.
Definition protection_profile.h:106
virtual void OnDeleteEngineSuccess(const std::shared_ptr< void > &context)
Called when an engine was deleted successfully.
Definition protection_profile.h:145
virtual void OnLoadSuccess(const std::shared_ptr< ProtectionProfile > &profile, const std::shared_ptr< void > &context)
Called when profile was loaded successfully.
Definition protection_profile.h:82
virtual void OnAddEngineFailure(const std::exception_ptr &error, const std::shared_ptr< void > &context)
Called when adding a new engine resulted in an error.
Definition protection_profile.h:136
virtual void OnDeleteEngineFailure(const std::exception_ptr &error, const std::shared_ptr< void > &context)
Called when deleting an engine resulted in an error.
Definition protection_profile.h:154
virtual void OnAddEngineSuccess(const std::shared_ptr< ProtectionEngine > &engine, const std::shared_ptr< void > &context)
Called when a new engine was added successfully.
Definition protection_profile.h:126
virtual void OnLoadFailure(const std::exception_ptr &error, const std::shared_ptr< void > &context)
Called when loading a profile caused an error.
Definition protection_profile.h:96
virtual void OnListEnginesFailure(const std::exception_ptr &error, const std::shared_ptr< void > &context)
Called when listing engines resulted in an error.
Definition protection_profile.h:116
Settings used by ProtectionProfile during its creation and throughout its lifetime.
Definition protection_profile.h:167
std::shared_ptr< MipContext > mMipContext
Definition protection_profile.h:423
std::shared_ptr< HttpDelegate > mHttpDelegate
Definition protection_profile.h:427
std::shared_ptr< TaskDispatcherDelegate > mTaskDispatcherDelegate
Definition protection_profile.h:428
std::map< std::string, std::string > mRedirectionUris
Definition protection_profile.h:433
std::shared_ptr< ConsentDelegate > mConsentDelegate
Definition protection_profile.h:425
std::shared_ptr< ConsentDelegate > GetConsentDelegate() const
Gets the consent delegate used for connecting to services.
Definition protection_profile.h:225
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.
Definition protection_profile.h:178
bool CanCacheLicenses() const
Gets whether or not end user licenses (EULs) are cached locally.
Definition protection_profile.h:319
std::shared_ptr< MipContext > GetMipContext() const
Get MIP context which represents shared state across all profiles.
Definition protection_profile.h:239
std::shared_ptr< StorageDelegate > mStorageDelegate
Definition protection_profile.h:434
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 ...
Definition protection_profile.h:356
std::shared_ptr< HttpDelegate > GetHttpDelegate() const
Get the HTTP delegate (if any) provided by the application.
Definition protection_profile.h:246
CacheStorageType GetCacheStorageType() const
Get whether caches are stored in memory or on disk.
Definition protection_profile.h:218
void SetDnsRedirection(DnsRedirection dnsRedirection)
Sets the dns redirection mode that controls how redirection is handled during online operations.
Definition protection_profile.h:418
CacheStorageType mCacheStorageType
Definition protection_profile.h:424
DnsRedirection mDnsRedirection
Definition protection_profile.h:438
void SetTaskDispatcherDelegate(const std::shared_ptr< TaskDispatcherDelegate > &taskDispatcherDelegate)
Override default asynchonous task dispatching handling with client's own.
Definition protection_profile.h:284
const std::map< std::string, std::string > & GetRedirectionUris() const
Gets the redirection uris.
Definition protection_profile.h:380
std::vector< std::pair< std::string, std::string > > mCustomSettings
Definition protection_profile.h:431
void SetCustomSettings(const std::vector< std::pair< std::string, std::string > > &customSettings)
Set the custom settings, used for feature gating and testing.
Definition protection_profile.h:328
void SetStorageDelegate(const std::shared_ptr< StorageDelegate > &storageDelegate)
Override default storage cache with client's own implementation.
Definition protection_profile.h:267
std::shared_ptr< ProtectionProfile::Observer > mObserver
Definition protection_profile.h:426
void SetCanCacheLicenses(bool canCacheLicenses)
Configures whether or not end user licenses (EULs) will be cached locally.
Definition protection_profile.h:310
std::shared_ptr< void > mLoggerContext
Definition protection_profile.h:432
std::string mSessionId
Definition protection_profile.h:429
void SetHttpDelegate(const std::shared_ptr< HttpDelegate > &httpDelegate)
Override default HTTP stack with client's own.
Definition protection_profile.h:253
bool mCanCacheLicenses
Definition protection_profile.h:430
void AddRedirectionUri(const std::string &originalUri, const std::string &redirectUri)
Adds a redirect uri.
Definition protection_profile.h:371
std::shared_ptr< ProtectionProfile::Observer > GetObserver() const
Gets the observer that receives notifications of events related to ProtectionProfile.
Definition protection_profile.h:232
std::shared_ptr< TaskDispatcherDelegate > GetTaskDispatcherDelegate() const
Get the TaskDispatcher delegate (if any) provided by the application.
Definition protection_profile.h:274
DnsRedirection GetDnsRedirection() const
Gets the dns redirect mode.
Definition protection_profile.h:409
const std::shared_ptr< void > & GetLoggerContext() const
Get logger context that will be opaquely passed to the logger delegate for logs associated with the c...
Definition protection_profile.h:347
Settings(const std::shared_ptr< MipContext > &mipContext, CacheStorageType cacheStorageType, const std::shared_ptr< ConsentDelegate > &consentDelegate)
ProtectionProfile::Settings constructor, used for synchronous operations.
Definition protection_profile.h:202
void SetSessionId(const std::string &sessionId)
Sets the session ID.
Definition protection_profile.h:293
const std::string & GetSessionId() const
Gets the session ID.
Definition protection_profile.h:300
std::shared_ptr< StorageDelegate > GetStorageDelegate() const
Get the StorageDelegate (if any) provided by the application.
Definition protection_profile.h:260
const std::vector< std::pair< std::string, std::string > > & GetCustomSettings() const
Get the custom settings, used for feature gating and testing.
Definition protection_profile.h:337
ProtectionProfile is the root class for performing protection operations.
Definition protection_profile.h:59
virtual std::shared_ptr< AsyncControl > AddEngineAsync(const ProtectionEngine::Settings &settings, const std::shared_ptr< void > &context)=0
Starts adding a new protection engine to the profile.
virtual std::vector< std::string > ListEngines()=0
List engines.
static MIP_API std::shared_ptr< PublishingLicenseInfo > __CDECL GetPublishingLicenseInfo(const std::vector< uint8_t > &serializedPublishingLicense)
Creates a holder for details of a Publishing License and can be used to create a Protection Handler.
static MIP_API std::shared_ptr< PublishingLicenseInfo > __CDECL GetPublishingLicenseInfo(const std::vector< uint8_t > &serializedPublishingLicense, const std::shared_ptr< MipContext > &mipContext)
Creates a holder for details of a Publishing License and can be used to create a Protection Handler....
static MIP_API std::shared_ptr< ProtectionProfile > __CDECL Load(const Settings &settings)
Loading a profile based on the provided settings.
static MIP_API const char *__CDECL GetVersion()
Gets library version.
virtual void DeleteEngine(const std::string &engineId)=0
Delete the protection engine with the given ID. All data for the given engine will be deleted.
virtual std::shared_ptr< AsyncControl > ListEnginesAsync(const std::shared_ptr< void > &context)=0
Starts list engines operation.
static MIP_API std::shared_ptr< AsyncControl > __CDECL LoadAsync(const Settings &settings, const std::shared_ptr< void > &context)
Starts loading a profile based on the provided settings.
virtual const Settings & GetSettings() const =0
Gets settings used by ProtectionProfile during its initialization and throughout its lifetime.
virtual std::shared_ptr< ProtectionEngine > AddEngine(const ProtectionEngine::Settings &settings)=0
Add a new protection engine to the profile.
virtual std::shared_ptr< AsyncControl > DeleteEngineAsync(const std::string &engineId, const std::shared_ptr< void > &context)=0
Starts deleting the protection engine with the given ID. All data for the given engine will be delete...
A file Containing the common types used by the upe, file and protection modules.
CacheStorageType
Storage type for the caches.
Definition common_types.h:710
A file Containing types used to control dns redirection.
DnsRedirection
Storage type for the caches.
Definition dns_redirection.h:43
A file containing the MIP SDK error types.
Contains HttpDelegate interface definition used to override MIP HTTP stack.
A file containing the LoggerDelegate class to be used to override MIP logger.
File containing definition of MipContext.
A file export/import macros.
A file containing the common types used by the protection module.
Defines ProtectionEngine interface.
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.