class ProtectionEngine::Observer
接收 ProtectionEngine 相關通知的介面。 此介面必須由使用保護 SDK 的應用程式實作
摘要
成員 | Description |
---|---|
public virtual void OnGetTemplatesSuccess(const std::vector<std::shared_ptr<TemplateDescriptor& templateDescriptors>>, const std::shared_ptr<void>& context) | 成功擷取範本時呼叫。 |
public virtual void OnGetTemplatesFailure(const std::exception_ptr& error, const std::shared_ptr<void>& context) | 擷取範本時呼叫會產生錯誤。 |
public virtual void OnGetRightsForLabelIdSuccess(const std::shared_ptr<std::vector<std::string>>& rights, const std::shared_ptr<void>& context) | 成功擷取許可權時呼叫。 |
public virtual void OnGetRightsForLabelIdFailure(const std::exception_ptr& error, const std::shared_ptr<void>& context) | 擷取使用者標籤標識碼的許可權時呼叫。 |
public virtual void OnLoadUserCertSuccess(const std::shared_ptr<void>& context) | 成功載入用戶憑證時呼叫。 |
public virtual void OnLoadUserCertFailure(const std::exception_ptr& error, const std::shared_ptr<void>& context) | 用戶憑證載入失敗時呼叫。 |
public virtual void OnRegisterContentForTrackingAndRevocationSuccess(const std::shared_ptr<void>& context) | 成功註冊追蹤和撤銷的內容時呼叫。 |
public virtual void OnRegisterContentForTrackingAndRevocationFailure(const std::exception_ptr& error, const std::shared_ptr<void>& context) | 當追蹤和撤銷的內容註冊失敗時呼叫。 |
public virtual void OnRevokeContentSuccess(const std::shared_ptr<void>& context) | 撤銷成功時呼叫。 |
public virtual void OnRevokeContentFailure(const std::exception_ptr& error, const std::shared_ptr<void>& context) | 撤銷內容失敗時呼叫。 |
public virtual void OnCreateDelegatedLicensesSuccess(std::vector<std::shared_ptr<DelegationLicense delegatedLicenses>> , const std::shared_ptr<void>& context) | 建立委派授權成功時呼叫。 |
public virtual void OnCreateDelegatedLicensesFailure(const std::exception_ptr& error, const std::shared_ptr<void>& context) | 建立委派授權失敗時呼叫。 |
public virtual void OnGetTenantInformationAsyncSuccess(const std::shared_ptr<TenantInformation>& tenantInformation, const std::shared_ptr<void>& context) | 當 GetTenantInformationAsync 成功時呼叫。 |
public virtual void OnGetTenantInformationAsyncFailure(const std::exception_ptr& error, const std::shared_ptr<void>& context) | GetTenantInformationAsync 失敗時呼叫。 |
public virtual void OnGetLicenseRightsDataSuccess(const std::shared_ptr<LicenseRightsData>& licenseRightsData, const std::shared_ptr<void>& context) | 成功擷取授權許可權數據時呼叫。 |
public virtual void OnGetLicenseRightsDataFailure(const std::exception_ptr& error, const std::shared_ptr<void>& context) | 擷取授權許可權數據失敗時呼叫。 |
成員
OnGetTemplatesSuccess 函式
成功擷取範本時呼叫。
參數:
templateDescriptors:範本描述元清單的參考
context:傳遞至 ProtectionEngine::GetTemplatesAsync 的相同內容
應用程式可以將任何類型的內容(例如 std::p romise、std::function)傳遞至 ProtectionEngine::GetTemplatesAsync,並將相同的內容依原狀轉送至 ProtectionEngine::Observer::OnGetTemplatesSuccess 或 ProtectionEngine::Observer::OnGetTemplatesFailure
OnGetTemplatesFailure 函式
擷取範本時呼叫會產生錯誤。
參數:
錯誤:擷取範本時發生的錯誤
context:傳遞至 ProtectionEngine::GetTemplatesAsync 的相同內容
應用程式可以將任何類型的內容(例如 std::p romise、std::function)傳遞至 ProtectionEngine::GetTemplatesAsync,並將相同的內容依原狀轉送至 ProtectionEngine::Observer::OnGetTemplatesSuccess 或 ProtectionEngine::Observer::OnGetTemplatesFailure
OnGetRightsForLabelIdSuccess 函式
成功擷取許可權時呼叫。
參數:
rights:擷取之許可權清單的參考
context:傳遞至 ProtectionEngine::GetRightsForLabelIdAsync 的相同內容
應用程式可以將任何類型的內容(例如 std::p romise、std::function)傳遞至 ProtectionEngine::GetRightsForLabelIdAsync,並將相同的內容轉送至 ProtectionEngine::Observer::OnGetRightsForLabelIdSuccess 或 ProtectionEngine::Observer::OnGetRightsForLabelIdFailure
OnGetRightsForLabelIdFailure 函式
擷取使用者標籤標識碼的許可權時呼叫。
參數:
錯誤:擷取許可權時發生的錯誤
context:傳遞至 ProtectionEngine::GetRightsForLabelIdAsync 的相同內容
應用程式可以將任何類型的內容(例如 std::p romise、std::function)傳遞至 ProtectionEngine::GetRightsForLabelIdAsync,並將相同的內容轉送至 ProtectionEngine::Observer::OnGetRightsForLabelIdSuccess 或 ProtectionEngine::Observer::OnGetRightsForLabelIdFailure
OnLoadUserCertSuccess 函式
成功載入用戶憑證時呼叫。
參數:
- context:傳遞至 ProtectionEngine::LoadUserCert 的相同內容
應用程式可以將任何類型的內容(例如 std::p romise、std::function)傳遞至 ProtectionEngine::LoadUserCertAsync,並將相同的內容原樣轉送至 ProtectionEngine::Observer::OnLoadUserCertSuccess 或 ProtectionEngine::Observer::OnLoadUserCertFailure
OnLoadUserCertFailure 函式
用戶憑證載入失敗時呼叫。
參數:
錯誤:擷取許可權時發生的錯誤
context:傳遞至 ProtectionEngine::LoadUserCert 的相同內容
應用程式可以將任何類型的內容(例如 std::p romise、std::function)傳遞至 ProtectionEngine::LoadUserCertAsync,並將相同的內容原樣轉送至 ProtectionEngine::Observer::OnLoadUserCertSuccess 或 ProtectionEngine::Observer::OnLoadUserCertFailure
OnRegisterContentForTrackingAndRevocationSuccess 函式
成功註冊追蹤和撤銷的內容時呼叫。
參數:
- context:傳遞至 ProtectionEngine::RegisterContentForTrackingAndRevocationAsync 的相同內容
應用程式可以傳遞任何類型的內容(例如 std::p romise,std::function) 至 ProtectionEngine::RegisterContentForTrackingAndRevocationAsync,並將相同的內容依原樣轉送至 ProtectionEngine::Observer::OnRegisterContentForTrackingAndRevocationSuccess 或 ProtectionEngine::Observer::OnRegisterContentForTrackingAndRevocationFailure
OnRegisterContentForTrackingAndRevocationFailure 函式
當追蹤和撤銷的內容註冊失敗時呼叫。
參數:
錯誤:註冊內容時發生的錯誤
context:傳遞至 ProtectionEngine::RegisterContentForTrackingAndRevocationAsync 的相同內容
應用程式可以傳遞任何類型的內容(例如 std::p romise,std::function) 至 ProtectionEngine::RegisterContentForTrackingAndRevocationAsync,並將相同的內容依原樣轉送至 ProtectionEngine::Observer::OnRegisterContentForTrackingAndRevocationSuccess 或 ProtectionEngine::Observer::OnRegisterContentForTrackingAndRevocationFailure
OnRevokeContentSuccess 函式
撤銷成功時呼叫。
參數:
- context:傳遞至 ProtectionEngine::RevokeContentAsync 的相同內容
應用程式可以將任何類型的內容(例如 std::p romise、std::function)傳遞至 ProtectionEngine::RevokeContentAsync,並將相同的內容原狀轉送至 ProtectionEngine::Observer::OnRevokeContentSuccess 或 ProtectionEngine::Observer::OnRevokeContentFailure
OnRevokeContentFailure 函式
撤銷內容失敗時呼叫。
參數:
錯誤:撤銷內容時發生的錯誤
context:傳遞至 ProtectionEngine::RevokeContentAsync 的相同內容
應用程式可以將任何類型的內容(例如 std::p romise、std::function)傳遞至 ProtectionEngine::RevokeContentAsync,並將相同的內容原狀轉送至 ProtectionEngine::Observer::OnRevokeContentSuccess 或 ProtectionEngine::Observer::OnRevokeContentFailure
OnCreateDelegatedLicensesSuccess 函式
建立委派授權成功時呼叫。
參數:
- context:傳遞至 ProtectionEngine::CreateDelegationLicensesAsync 的相同內容
應用程式可以將任何類型的內容(例如 std::p romise、std::function)傳遞至 ProtectionEngine::CreateDelegationLicensesAsync,並將相同的內容依原樣轉送至 ProtectionEngine::Observer::OnCreateDelegatedLicensesSuccess 或 ProtectionEngine::Observer::OnCreateDelegatedLicensesFailure
OnCreateDelegatedLicensesFailure 函式
建立委派授權失敗時呼叫。
參數:
error:發生錯誤
context:傳遞至 ProtectionEngine::CreateDelegationLicensesAsync 的相同內容
應用程式可以將任何類型的內容(例如 std::p romise、std::function)傳遞至 ProtectionEngine::CreateDelegationLicensesAsync,並將相同的內容依原樣轉送至 ProtectionEngine::Observer::OnCreateDelegatedLicensesSuccess 或 ProtectionEngine::Observer::OnCreateDelegatedLicensesFailure
OnGetTenantInformationAsyncSuccess 函式
當 GetTenantInformationAsync 成功時呼叫。
參數:
- context:傳遞至 ProtectionEngine::GetTenantInformationAsync 的相同內容
應用程式可以將任何類型的內容(例如 std::p romise、std::function)傳遞至 ProtectionEngine::GetTenantInformationAsync,並將相同的內容依原狀轉送至 ProtectionEngine::Observer::OnGetTenantInformationAsyncSuccess 或 ProtectionEngine::Observer::OnGetTenantInformationAsyncFailure
OnGetTenantInformationAsyncFailure 函式
GetTenantInformationAsync 失敗時呼叫。
參數:
error:發生錯誤
context:傳遞至 ProtectionEngine::GetTenantInformationAsync 的相同內容
應用程式可以將任何類型的內容(例如 std::p romise、std::function)傳遞至 ProtectionEngine::GetTenantInformationAsync,並將相同的內容依原狀轉送至 ProtectionEngine::Observer::OnGetTenantInformationAsyncSuccess 或 ProtectionEngine::Observer::OnGetTenantInformationAsyncFailure
OnGetLicenseRightsDataSuccess 函式
成功擷取授權許可權數據時呼叫。
參數:
rights:擷取授權許可權數據的參考
context:傳遞至 ProtectionEngine::GetLicenseRightsDataAsync 的相同內容
應用程式可以將任何類型的內容(例如 std::p romise、std::function)傳遞至 ProtectionEngine::GetLicenseRightsDataAsync,並將相同的內容依原樣轉送至 ProtectionEngine::Observer::OnGetLicenseRightsDataSuccess 或 ProtectionEngine::Observer::OnGetLicenseRightsDataFailure
OnGetLicenseRightsDataFailure 函式
擷取授權許可權數據失敗時呼叫。
參數:
錯誤:擷取授權許可權數據時發生的錯誤
context:傳遞至 ProtectionEngine::GetLicenseRightsDataAsync 的相同內容
應用程式可以將任何類型的內容(例如 std::p romise、std::function)傳遞至 ProtectionEngine::GetLicenseRightsDataAsync,並將相同的內容依原樣轉送至 ProtectionEngine::Observer::OnGetLicenseRightsDataSuccess 或 ProtectionEngine::Observer::OnGetLicenseRightsDataFailure