현재 상태 및 원하는 상태에 따라 작업을 계산하려면 클래스를 구현하여 MIP SDK에 정보를 전달합니다 mip::ExecutionState . SDK ExecutionState 의 다른 클래스와 마찬가지로 추상 클래스이며 개발자는 이를 구현해야 합니다.
mip::ExecutionState 멤버
ExecutionState 는 다음 가상 멤버를 노출합니다. 각 멤버는 애플리케이션이 수행해야 하는 작업에 대한 정보를 반환할 수 있도록 정책 엔진에 컨텍스트를 제공합니다. SDK는 이 정보를 사용하여 Microsoft Purview 감사 정보를 제공할 수도 있습니다.
| 회원 | 반품 |
|---|---|
std::shared_ptr<mip::Label> GetNewLabel() |
SDK가 개체에 적용되는 레이블을 반환합니다. |
mip::DataState GetDataState() |
개체의 mip::D ataState를 반환합니다. |
std::pair<bool, std::string> IsDowngradeJustified() |
다운그레이드가 정당한지 여부와 그 근거를 나타내는 std::pair를 반환합니다. |
std::string GetContentIdentifier() |
콘텐츠 식별자를 반환합니다. 개체의 위치를 나타내는 사람이 읽을 수 있는 식별자를 사용합니다. |
std::string GetApplicationScenarioId() |
애플리케이션 이벤트와 해당 감사 또는 보호 서비스 REST 요청의 상관 관계를 지정하는 식별자를 반환합니다. |
mip::AssignmentMethod GetNewLabelAssignmentMethod() |
레이블의 mip::AssignmentMethod를 반환합니다. |
std::vector<std::pair<std::string, std::string>> GetNewLabelExtendedProperties() |
SDK가 문서에 적용하는 사용자 지정 메타데이터를 포함하는 문자열 std::pair의 std::vector를 반환합니다. |
std::vector<mip::MetadataEntry> GetContentMetadata() |
현재 콘텐츠 메타데이터를 포함하는 mip::MetadataEntry 개체의 std::vector를 반환합니다. |
std::shared_ptr<mip::ProtectionDescriptor> GetProtectionDescriptor() |
mip::ProtectionDescriptor에 대한 포인터를 반환합니다. |
std::string GetContentFormat() |
문자열을 반환합니다. |
mip::ActionType GetSupportedActions() |
레이블에 대한 mip::ActionTypes를 반환합니다. |
std::shared_ptr<mip::ClassificationResults> GetClassificationResults() |
구현된 경우 분류 결과 목록을 반환합니다. |
에서 파생된 mip::ExecutionState클래스의 구현에서 각 멤버를 재정의합니다. 앞의 샘플 애플리케이션에서는 샘플이 ExecutionStateOptions라는 구조체를 구현하고 해당 구조체를 파생 클래스의 생성자에 전달합니다.
이 예제에서는 다음과 같은 ExecutionStateOptions구조체를 정의합니다.
struct ExecutionStateOptions {
std::unordered_map<std::string, std::string> metadata;
std::string newLabelId;
std::string contentIdentifier;
mip::ActionSource actionSource = mip::ActionSource::MANUAL;
mip::DataState dataState = mip::DataState::USE;
mip::AssignmentMethod assignmentMethod = mip::AssignmentMethod::STANDARD;
bool isDowngradeJustified = false;
std::string downgradeJustification;
std::string templateId;
std::string contentFormat = mip::GetFileContentFormat();
mip::ActionType supportedActions;
bool generateAuditEvent;
};
애플리케이션에서 각 속성을 설정한 다음 ExecutionStateOptions에서 파생된 클래스의 생성자에 mip::ExecutionState를 전달합니다. SDK는 이 정보를 사용하여 수행할 작업을 결정합니다. Microsoft Purview 감사 보고서에는 제공된 mip::ExecutionState데이터도 표시됩니다.
다음 단계
- 현재 및 원하는 상태에 따라 새 레이블 또는 기존 레이블에 대한 컴퓨팅 작업을 확인하는 방법을 알아봅니다.
- GitHub 정책 SDK 샘플을 다운로드하고 정책 SDK를 사용해 보세요.