Microsoft Information Protection SDK - C++ 1.17
API Reference Documentation for C++
Loading...
Searching...
No Matches
execution_state.h
Go to the documentation of this file.
1/*
2 *
3 * Copyright (c) Microsoft Corporation.
4 * All rights reserved.
5 *
6 * This code is licensed under the MIT License.
7 *
8 * Permission is hereby granted, free of charge, to any person obtaining a copy
9 * of this software and associated documentation files(the "Software"), to deal
10 * in the Software without restriction, including without limitation the rights
11 * to use, copy, modify, merge, publish, distribute, sublicense, and / or sell
12 * copies of the Software, and to permit persons to whom the Software is
13 * furnished to do so, subject to the following conditions :
14 *
15 * The above copyright notice and this permission notice shall be included in
16 * all copies or substantial portions of the Software.
17 *
18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE
21 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24 * THE SOFTWARE.
25 *
26 */
32#ifndef API_MIP_UPE_EXECUTION_STATE_H_
33#define API_MIP_UPE_EXECUTION_STATE_H_
34
35#include <map>
36#include <memory>
37#include <utility>
38#include <vector>
39
40#include "mip/common_types.h"
41#include "mip/mip_namespace.h"
43#include "mip/upe/action.h"
46#include "mip/upe/label.h"
49
50MIP_NAMESPACE_BEGIN
51
53
57 inline std::string Sender() { return "Sender"; }
58 inline std::string Recipients() { return "Recipients"; }
59 inline std::string LastModifiedBy() { return "LastModifiedBy"; }
60 inline std::string LastModifiedDate() { return "LastModifiedDate"; }
61}
62
71public:
77 virtual std::shared_ptr<Label> GetNewLabel() const = 0;
78
88 virtual std::string GetContentIdentifier() const = 0;
89
95 virtual std::string GetApplicationScenarioId() const {
96 return std::string();
97 };
98
104 virtual DataState GetDataState() const {
105 return DataState::USE;
106 };
107
114 virtual std::pair<bool, std::string> IsDowngradeJustified() const = 0;
115
123
129 virtual std::vector<std::pair<std::string, std::string>> GetNewLabelExtendedProperties() const {
130 return std::vector<std::pair<std::string, std::string>>();
131 }
132
139 virtual std::vector<MetadataEntry> GetContentMetadata(
140 const std::vector<std::string>& names,
141 const std::vector<std::string>& namePrefixes) const = 0;
142
148 virtual std::shared_ptr<ProtectionDescriptor> GetProtectionDescriptor() const = 0;
149
155 virtual std::string GetContentFormat() const = 0;
156
167
176 virtual ActionType GetSupportedActions() const = 0;
177
185 virtual std::shared_ptr<ClassificationResults> GetClassificationResults(
186 const std::vector<std::shared_ptr<ClassificationRequest>>& /*classificationIds*/) const {
187 return nullptr;
188 }
189
201 virtual std::map<std::string, std::string> GetAuditMetadata() const {
202 return std::map<std::string, std::string>();
203 }
204
206 virtual ~ExecutionState() { }
207
208protected:
209 ExecutionState() { }
211};
212
213MIP_NAMESPACE_END
214
215#endif // API_MIP_UPE_EXECUTION_STATE_H_
A file containing the Action base class and the ActionType enumerator.
ActionType
Different action types.
Definition action.h:46
Interface for all the state needed to execute the engine.
Definition execution_state.h:70
virtual std::shared_ptr< ClassificationResults > GetClassificationResults(const std::vector< std::shared_ptr< ClassificationRequest > > &) const
Return a map of classification results.
Definition execution_state.h:185
virtual std::shared_ptr< Label > GetNewLabel() const =0
Gets the sensitivity label ID that should be applied on the document.
virtual std::vector< std::pair< std::string, std::string > > GetNewLabelExtendedProperties() const
Return new label's extended properties.
Definition execution_state.h:129
virtual std::pair< bool, std::string > IsDowngradeJustified() const =0
Implementation should pass if justification to downgrade an existing label was given.
virtual std::string GetApplicationScenarioId() const
Return an identifier which correlates application events with the corresponding audit or protection s...
Definition execution_state.h:95
virtual std::shared_ptr< ProtectionDescriptor > GetProtectionDescriptor() const =0
Get the Protection Descriptor.
virtual MetadataVersion GetContentMetadataVersion() const
Gets the highest metadata version supported by the application for the tenant.
Definition execution_state.h:164
virtual std::string GetContentFormat() const =0
Gets the content format.
virtual ActionType GetSupportedActions() const =0
Gets a masked enum describing all the supported action types.
virtual DataState GetDataState() const
Gets the state of the content while the application is interacting with it.
Definition execution_state.h:104
virtual AssignmentMethod GetNewLabelAssignmentMethod() const =0
Get the new label's assignment method.
virtual std::vector< MetadataEntry > GetContentMetadata(const std::vector< std::string > &names, const std::vector< std::string > &namePrefixes) const =0
Get the meta-data items from the content.
virtual std::string GetContentIdentifier() const =0
Gets the content description that describes the document. example for a file: [path\filename] example...
virtual std::map< std::string, std::string > GetAuditMetadata() const
Return a map of application specific audit key-value pairs.
Definition execution_state.h:201
Interface for a MetadataVersion. MetadataVersion determines which metadata is active and how it is pr...
Definition metadata_version.h:73
This file contains the ClassificationRequest class.
This file contains the ClassificationResult class.
A file Containing the common types used by the upe, file and protection modules.
AssignmentMethod
The assignment method of the label on the document. Whether the Assignment of the label was done auto...
Definition common_types.h:75
DataState
Defines what state of the data is the application acting upon.
Definition common_types.h:94
This file contains the Label class.
This file contains the MetadataEntry class.
A file containing the MetadataVersion class and the MetadataVersionFormat enumerator.
MIP namespace macros.
Definition execution_state.h:52
std::string Sender()
Audit metadata keys in string representation.
Definition execution_state.h:57
std::string LastModifiedBy()
Definition execution_state.h:59
std::string LastModifiedDate()
Definition execution_state.h:60
std::string Recipients()
Definition execution_state.h:58
Defines ProtectionDescriptor interface.