28#ifndef API_MIP_FILE_FILE_PROFILE_H_
29#define API_MIP_FILE_FILE_PROFILE_H_
70 const std::shared_ptr<mip::FileProfile>& profile,
71 const std::shared_ptr<void>& context) { UNUSED(profile); UNUSED(context); }
76 virtual void OnLoadFailure(
const std::exception_ptr& error,
const std::shared_ptr<void>& context) {
77 UNUSED(error); UNUSED(context); }
83 const std::vector<std::string>& engineIds,
84 const std::shared_ptr<void>& context) { UNUSED(engineIds); UNUSED(context); }
90 const std::exception_ptr& error,
91 const std::shared_ptr<void>& context) { UNUSED(error); UNUSED(context); }
102 const std::exception_ptr& error,
103 const std::shared_ptr<void>& context) { UNUSED(error); UNUSED(context); }
109 const std::shared_ptr<mip::FileEngine>& engine,
110 const std::shared_ptr<void>& context) { UNUSED(engine); UNUSED(context); }
115 virtual void OnAddEngineFailure(
const std::exception_ptr& error,
const std::shared_ptr<void>& context) {
116 UNUSED(error); UNUSED(context); }
127 const std::exception_ptr& error,
128 const std::shared_ptr<void>& context) { UNUSED(error); UNUSED(context); }
164 const std::shared_ptr<MipContext>& mipContext,
166 std::shared_ptr<ConsentDelegate> consentDelegate,
167 std::shared_ptr<Observer> observer)
168 : mMipContext(mipContext),
169 mCacheStorageType(cacheStorageType),
170 mConsentDelegate(consentDelegate),
172 mCanCacheLicenses(true),
198 std::shared_ptr<Observer>
GetObserver()
const {
return mObserver; }
219 void SetHttpDelegate(
const std::shared_ptr<HttpDelegate>& httpDelegate) { mHttpDelegate = httpDelegate; }
237 mTaskDispatcherDelegate = taskDispatcherDelegate;
246 mSessionId = sessionId;
267 mCanCacheLicenses = canCacheLicenses;
276 return mCanCacheLicenses;
279#if !defined(SWIG) && !defined(SWIG_DIRECTORS)
294 mLoggerContext = loggerContext;
303 return mDnsRedirection;
312 mDnsRedirection = dnsRedirection;
316 std::shared_ptr<MipContext> mMipContext;
319 std::shared_ptr<ConsentDelegate> mConsentDelegate;
320 std::shared_ptr<Observer> mObserver;
321 std::string mSessionId;
322 std::shared_ptr<HttpDelegate> mHttpDelegate;
323 std::shared_ptr<TaskDispatcherDelegate> mTaskDispatcherDelegate;
324 bool mCanCacheLicenses;
325 std::shared_ptr<void> mLoggerContext;
337 const std::shared_ptr<void>& context);
361 virtual std::shared_ptr<AsyncControl>
ListEnginesAsync(
const std::shared_ptr<void>& context) = 0;
370 const std::string&
id,
371 const std::shared_ptr<void>& context) = 0;
380 const FileEngine::Settings& settings,
381 const std::shared_ptr<void>& context) = 0;
390 const std::string&
id,
391 const std::shared_ptr<void>& context) = 0;
Observer interface for clients to get notifications for profile related events.
virtual void OnDeleteEngineSuccess(const std::shared_ptr< void > &context)
Called when an engine was deleted successfully.
virtual void OnListEnginesSuccess(const std::vector< std::string > &engineIds, const std::shared_ptr< void > &context)
Called when list of engines was generated successfully.
virtual void OnLoadSuccess(const std::shared_ptr< mip::FileProfile > &profile, const std::shared_ptr< void > &context)
Called when profile was loaded successfully.
virtual void OnAddPolicyEngineStarting(bool requiresPolicyFetch)
Called prior to engine creation to describe whether or not the policy engine's policy data must be fe...
virtual void OnAddEngineFailure(const std::exception_ptr &error, const std::shared_ptr< void > &context)
Called when adding a new engine caused an error.
virtual void OnAddEngineSuccess(const std::shared_ptr< mip::FileEngine > &engine, const std::shared_ptr< void > &context)
Called when a new engine was added successfully.
virtual void OnUnloadEngineFailure(const std::exception_ptr &error, const std::shared_ptr< void > &context)
Called when unloading an engine caused an error.
virtual void OnListEnginesFailure(const std::exception_ptr &error, const std::shared_ptr< void > &context)
Called when listing engines caused an error.
virtual void OnLoadFailure(const std::exception_ptr &error, const std::shared_ptr< void > &context)
Called when loading a profile caused an error.
virtual void OnDeleteEngineFailure(const std::exception_ptr &error, const std::shared_ptr< void > &context)
Called when deleting an engine caused an error.
virtual void OnUnloadEngineSuccess(const std::shared_ptr< void > &context)
Called when an engine was unloaded successfully.
virtual void OnPolicyChanged(const std::string &engineId)
Called when the policy has changed for the engine with the given ID.
Settings used by FileProfile during its creation and throughout its lifetime.
void SetCanCacheLicenses(bool canCacheLicenses)
Configures whether or not end user licenses (EULs) will be cached locally.
CacheStorageType GetCacheStorageType() const
Get whether caches are stored in memory or on disk.
void SetTaskDispatcherDelegate(const std::shared_ptr< TaskDispatcherDelegate > &taskDispatcherDelegate)
Override default asynchonous task dispatching handling with client's own.
std::shared_ptr< Observer > GetObserver() const
Gets the observer that receives notifications of events related to FileProfile.
void SetHttpDelegate(const std::shared_ptr< HttpDelegate > &httpDelegate)
Override default HTTP stack with client's own.
Settings(const std::shared_ptr< MipContext > &mipContext, CacheStorageType cacheStorageType, std::shared_ptr< ConsentDelegate > consentDelegate, std::shared_ptr< Observer > observer)
FileProfile::Settings constructor.
bool CanCacheLicenses() const
Gets whether or not end user licenses (EULs) are cached locally.
const std::string & GetSessionId() const
Gets the session ID.
std::shared_ptr< ConsentDelegate > GetConsentDelegate() const
Gets the consent delegate used to request user consent connecting to services.
DnsRedirection GetDnsRedirection() const
Gets the dns redirect mode.
void SetSessionId(const std::string &sessionId)
Sets the session ID.
std::shared_ptr< MipContext > GetMipContext() const
Get MIP context which represents shared state across all profiles.
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...
std::shared_ptr< HttpDelegate > GetHttpDelegate() const
Get the HTTP delegate (if any) provided by the application.
void SetDnsRedirection(DnsRedirection dnsRedirection)
Sets the dns redirection mode that controls how redirection is handled during online operations.
std::shared_ptr< TaskDispatcherDelegate > GetTaskDispatcherDelegate() const
Get the TaskDispatcher delegate (if any) provided by the application.
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 ...
FileProfile class is the root class for using the Microsoft Information Protection operations.
virtual std::shared_ptr< AsyncControl > ListEnginesAsync(const std::shared_ptr< void > &context)=0
Starts list engines operation.
virtual void AcquirePolicyAuthToken(Cloud cloud, const std::shared_ptr< AuthDelegate > &authDelegate) const =0
Trigger an authentication callback for policy.
static FILE_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 std::shared_ptr< AsyncControl > DeleteEngineAsync(const std::string &id, const std::shared_ptr< void > &context)=0
Starts deleting the file engine with the given ID.
virtual const Settings & GetSettings() const =0
Returns the profile settings.
virtual std::shared_ptr< AsyncControl > UnloadEngineAsync(const std::string &id, const std::shared_ptr< void > &context)=0
Starts unloading the file engine with the given ID.
virtual std::shared_ptr< AsyncControl > AddEngineAsync(const FileEngine::Settings &settings, const std::shared_ptr< void > &context)=0
Starts adding a new file engine to the profile.
static FILE_API const char *__CDECL GetVersion()
Gets library version.
A file Containing the common types used by the upe, file and protection modules.
Cloud
Azure cloud identifier.
CacheStorageType
Storage type for the caches.
A file Containing types used to control dns redirection.
DnsRedirection
Storage type for the caches.
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 containing the TaskDispatcherDelegate interface to be used to override MIP async task executor...