ExecutionState を実装する

MIP SDK に情報を渡して、現在の状態と目的の状態に基づいて実行する必要があるアクションを計算するには、mip::ExecutionState クラスを介して実装します。 SDK の他のクラスと同様に、ExecutionState は、抽象クラスであり、開発者が実装する必要があります。

ExecutionState 実装の完全な例については、次のサンプル・ソースを参照してください。

mip::ExecutionState Members

ExecutionState は、次の仮想メンバーを公開します。 それぞれがポリシー エンジンに何らかのコンテキストを提供して、アプリケーションで実行する必要があるアクションに関する情報を返します。 さらに、この情報を使用して、[Azure 情報保護レポート] 機能に監査情報を提供できます。

メンバー 返品
std::shared_ptr<mip::Label> GetNewLabel() オブジェクトに適用するラベルを返します。
mip::DataState GetDataState() オブジェクトの mip::DataState を返します。
std::pair<bool, std::string> IsDowngradeJustified() ダウングレードが正当化されているかどうかとその正当性を表す std::pair を返します。
std::string GetContentIdentifier() コンテンツ識別子を返します。 オブジェクトの場所を示す、人間が判読できる識別子である必要があります。
mip::ActionSource GetNewLabelActionSource() ラベルの mip::ActionSource を返します。
mip::AssignmentMethod GetNewLabelAssignmentMethod() ラベルの mip::AssignmentMethod を返します。
std::vector<std::pair<std::string, std::string>> GetNewLabelExtendedProperties() ドキュメントに適用されるカスタム メタデータを含む、文字列の std::pairs の std::vector を返します。
std::vector<std::pair<std::string, std::string>> GetContentMetadata() 現在のコンテンツ メタデータを含む文字列の std::pairs の std::vector を返します。
std::shared_ptr<mip::ProtectionDescriptor> GetProtectionDescriptor() mip::ProtectionDescriptor へのポインターを返します。
std::string GetContentFormat() 文字列を返します
mip::ActionType GetSupportedActions() ラベルの mip::ActionTypes を返します。
std::shared_ptr<mip::ClassificationResults> 実装されている場合、分類結果の一覧を返します。

それぞれは、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 から派生したクラスのコンストラクターに渡されます。 この情報は、実行するアクションを決定するために使用されます。 mip::ExecutionState で提供されたデータは、Azure Information Protection Analytics でも表示されます。

次のステップ