|
MineTrustConnectorSDK.CPP
|
Classes | |
| struct | IncludeConfiguration |
| struct | PackageConfiguration |
| struct | PackageMetrics |
| struct | PackageFileChange |
| struct | ConfigSchemaItem |
| struct | ConfigSchema |
| struct | LocalTagRecord |
| struct | LocalFileRecord |
| struct | MTConnectorEvent |
| struct | ServerRegistration |
| struct | PackageSummary |
Typedefs | |
| using | RegistrationWrapper = std::unique_ptr<RegistrationWrapperImpl, void(*)(RegistrationWrapperImpl*)> |
Functions | |
| MT_CONNECTOR_EXPORT bool | LoadPackageConfiguration (const std::string &packageUID, PackageConfiguration &instance) |
| MT_CONNECTOR_EXPORT bool | SavePackageConfiguration (const PackageConfiguration &instance) |
| MT_CONNECTOR_EXPORT RegisterServerResultCodes | RegisterServer (const std::string &serverURL, bool showUI=false) |
| MT_CONNECTOR_EXPORT concurrency::task< RegisterServerResultCodes > | RegisterServerTask (const std::string &serverURL, bool showUI=false, concurrency::cancellation_token cancel=concurrency::cancellation_token::none()) |
| MT_CONNECTOR_EXPORT EnablePackageResultCodes | EnablePackage (const std::string &packageUID, const std::string &localRoot="", const std::string &serverURL="", bool showUI=false) |
| MT_CONNECTOR_EXPORT concurrency::task< EnablePackageResultCodes > | EnablePackageTask (const std::string &packageUID, const std::string &localRoot="", const std::string &serverURL="", bool showUI=false, concurrency::cancellation_token cancel=concurrency::cancellation_token::none()) |
| MT_CONNECTOR_EXPORT CreateVersionResultCodes | CreateVersion (const std::string &packageUID, const std::string &comment="", bool showUI=false) |
| MT_CONNECTOR_EXPORT concurrency::task< CreateVersionResultCodes > | CreateVersionTask (const std::string &packageUID, const std::string &comment="", bool showUI=false, concurrency::cancellation_token cancel=concurrency::cancellation_token::none()) |
| MT_CONNECTOR_EXPORT LockPackageResultCodes | LockPackage (const std::string &packageUID, const int &ownerProcess=0, bool showUI=false) |
| MT_CONNECTOR_EXPORT concurrency::task< LockPackageResultCodes > | LockPackageTask (const std::string &packageUID, const int &ownerProcess=0, bool showUI=false, concurrency::cancellation_token cancel=concurrency::cancellation_token::none()) |
| MT_CONNECTOR_EXPORT UnlockPackageResultCodes | UnlockPackage (const std::string &packageUID, bool discardChanges=false, bool showUI=false) |
| MT_CONNECTOR_EXPORT concurrency::task< UnlockPackageResultCodes > | UnlockPackageTask (const std::string &packageUID, bool discardChanges=false, bool showUI=false, concurrency::cancellation_token cancel=concurrency::cancellation_token::none()) |
| MT_CONNECTOR_EXPORT SyncNowResultCodes | SyncNow (const std::string &packageUID, bool showUI=false) |
| MT_CONNECTOR_EXPORT concurrency::task< SyncNowResultCodes > | SyncNowTask (const std::string &packageUID, bool showUI=false, concurrency::cancellation_token cancel=concurrency::cancellation_token::none()) |
| MT_CONNECTOR_EXPORT UpdateServerResultCodes | UpdateServer (const std::string &packageUID, const std::string &filePath, bool showUI=false) |
| MT_CONNECTOR_EXPORT concurrency::task< UpdateServerResultCodes > | UpdateServerTask (const std::string &packageUID, const std::string &filePath, bool showUI=false, concurrency::cancellation_token cancel=concurrency::cancellation_token::none()) |
| MT_CONNECTOR_EXPORT UpdateLocalResultCodes | UpdateLocal (const std::string &packageUID, const std::string &filePath, bool showUI=false) |
| MT_CONNECTOR_EXPORT concurrency::task< UpdateLocalResultCodes > | UpdateLocalTask (const std::string &packageUID, const std::string &filePath, bool showUI=false, concurrency::cancellation_token cancel=concurrency::cancellation_token::none()) |
| MT_CONNECTOR_EXPORT PrintDiagnosticsResultCodes | PrintDiagnostics (bool showUI=false) |
| MT_CONNECTOR_EXPORT concurrency::task< PrintDiagnosticsResultCodes > | PrintDiagnosticsTask (bool showUI=false, concurrency::cancellation_token cancel=concurrency::cancellation_token::none()) |
| MT_CONNECTOR_EXPORT std::vector< std::string > | ListServerURLs () |
| MT_CONNECTOR_EXPORT std::vector< ServerRegistration > | ListServerRegistrations () |
| MT_CONNECTOR_EXPORT bool | GetServerRegistrationForServerURL (const std::string &serverUrl, ServerRegistration &instance) |
| MT_CONNECTOR_EXPORT bool | GetServerRegistrationForServiceUID (const std::string &serviceUID, ServerRegistration &instance) |
| MT_CONNECTOR_EXPORT std::vector< PackageSummary > | GetAvailablePackages (const ServerRegistration ®istration) |
| MT_CONNECTOR_EXPORT std::vector< PackageConfiguration > | ListServerConfigurations () |
| MT_CONNECTOR_EXPORT std::vector< PackageConfiguration > | ListPackageConfigurations () |
| MT_CONNECTOR_EXPORT std::vector< PackageConfiguration > | FindPackageConfigurations (const std::string &jsonPath, const std::string &testValue, bool negate=false) |
| MT_CONNECTOR_EXPORT std::vector< LocalTagRecord > | FindTags (const std::string &tagNameFilter="", const std::string &tagValueFilter="", const std::string &serviceUID="", bool fuzzyMatch=false) |
| MT_CONNECTOR_EXPORT std::vector< LocalFileRecord > | FindFiles (const std::string &tagName, const std::string &tagValue, const std::string &serviceUID="", bool fuzzyMatch=false) |
| MT_CONNECTOR_EXPORT std::vector< LocalFileRecord > | FindFiles (const std::unordered_map< std::string, std::string > &tagCriteria, const std::string &serviceUID="", bool fuzzyMatch=false) |
| MT_CONNECTOR_EXPORT std::vector< LocalFileRecord > | FindFiles (const std::string &tagName, const std::string &tagValue, const std::string &fileNamePattern, const std::string &serviceUID="", bool fuzzyMatch=false) |
| MT_CONNECTOR_EXPORT std::vector< LocalFileRecord > | FindFiles (const std::unordered_map< std::string, std::string > &tagCriteria, const std::string &fileNamePattern, const std::string &serviceUID="", bool fuzzyMatch=false) |
| MT_CONNECTOR_EXPORT std::vector< LocalFileRecord > | EvaluateFilter (const std::string &filter, const std::string &packageUID="", const std::string &serviceUID="") |
| MT_CONNECTOR_EXPORT std::vector< std::string > | GetAccessiblePackages (const std::string &serviceUID="") |
| MT_CONNECTOR_EXPORT std::vector< std::string > | GetInaccessiblePackages (const std::string &serviceUID="") |
| MT_CONNECTOR_EXPORT std::vector< std::string > | GetDeletedPackages (const std::string &serviceUID="") |
| MT_CONNECTOR_EXPORT std::vector< std::string > | GetArchivedPackages (const std::string &serviceUID="") |
| MT_CONNECTOR_EXPORT PackageMetrics | LoadPackageMetrics (const std::string &packageUID, const std::string &serviceUID="") |
| MT_CONNECTOR_EXPORT std::unique_ptr< std::vector< PackageFileChange > > | GetPackageChanges (const std::string &packageUID) |
| MT_CONNECTOR_EXPORT ConfigSchema | LoadConfigSchema (const std::string &root) |
| MT_CONNECTOR_EXPORT std::vector< std::string > | GetPermittedValues (const std::string &configPath) |
| MT_CONNECTOR_EXPORT bool | IsMineTrustConnectorInstalled () |
| MT_CONNECTOR_EXPORT bool | IsMineTrustConnectorRunning () |
| MT_CONNECTOR_EXPORT RegistrationWrapper | RegisterEvents (std::function< void(const MTConnectorEvent &)> callback, const std::list< LogEvent > &eventIDs={}) |
| MT_CONNECTOR_EXPORT std::vector< std::string > | EnumerateLocalContents (const std::string &packageUID) |
| MT_CONNECTOR_EXPORT std::vector< std::string > | EnumerateLocalFilesByTag (const std::string &packageUID, const std::string &tagName, const std::string &tagValue) |
| MT_CONNECTOR_EXPORT bool | IsInScope (const std::string &packageUID, const std::string &localFilePath) |
| MT_CONNECTOR_EXPORT void | IncludeInPackage (PackageConfiguration &instance, const std::string &localFilePath, std::function< void(IncludeConfiguration &)> configureInclusion) |
| MT_CONNECTOR_EXPORT void | ExcludeFromPackage (PackageConfiguration &instance, const std::string &localFilePath) |
| MT_CONNECTOR_EXPORT void | TagFile (PackageConfiguration &instance, const std::string &localFilePath, const std::string &tagName, const std::string &tagValue) |
| MT_CONNECTOR_EXPORT void | RemoveTag (PackageConfiguration &instance, const std::string &localFilePath, const std::string &tagName) |
| MT_CONNECTOR_EXPORT concurrency::task< void > | ReceiveFiles (const std::vector< LocalFileRecord > &selection, std::function< void(const std::vector< LocalFileRecord > &)> filesReceivedCallback, concurrency::cancellation_token cancel=concurrency::cancellation_token::none()) |
| MT_CONNECTOR_EXPORT concurrency::task< void > | SendFiles (const std::vector< LocalFileRecord > &selection, std::function< PackageConfiguration(const LocalFileRecord &)> packageSelectionCallback, concurrency::cancellation_token cancel=concurrency::cancellation_token::none()) |
Exposes MineTrustConnector SDK functionality to a native C++ application via a C++/CLI wrapper. This allows the native application to interact with the MineTrust Connector service, enabling features such as loading and saving package configurations, finding tags and files, evaluating filters, and receiving events from the service.
| using MTConnectorSDK::RegistrationWrapper = std::unique_ptr<RegistrationWrapperImpl, void(*)(RegistrationWrapperImpl*)> |
Internal handle returned when registering event callbacks.
|
strong |
Return codes for CreateVersion() and their meaning
|
strong |
Return codes for EnablePackage() and their meaning
|
strong |
Return codes for LockPackage() and their meaning
|
strong |
Enumeration of the log event IDs and formats that are shared by both the Dashboard and Service components
|
strong |
|
strong |
Return codes for PrintDiagnostics() and their meaning
| Enumerator | |
|---|---|
| Success | 0 = Success |
| GeneralError | 1 = A general error occurred |
| IncompatibleClient | 2 = The client does not meet the version requirements of the server |
|
strong |
Return codes for RegisterServer() and their meaning
|
strong |
Return codes for SyncNow() and their meaning
|
strong |
Return codes for UnlockPackage() and their meaning
|
strong |
Return codes for UpdateLocal() and their meaning
|
strong |
Return codes for UpdateServer() and their meaning
| MT_CONNECTOR_EXPORT CreateVersionResultCodes MTConnectorSDK::CreateVersion | ( | const std::string & | packageUID, |
| const std::string & | comment = "", | ||
| bool | showUI = false ) |
Creates a new version of the specified package, capturing all file versions as they currently exist for that package within MineTrust
| MT_CONNECTOR_EXPORT concurrency::task< CreateVersionResultCodes > MTConnectorSDK::CreateVersionTask | ( | const std::string & | packageUID, |
| const std::string & | comment = "", | ||
| bool | showUI = false, | ||
| concurrency::cancellation_token | cancel = concurrency::cancellation_token::none() ) |
Asynchronous counterpart of CreateVersion()
| MT_CONNECTOR_EXPORT EnablePackageResultCodes MTConnectorSDK::EnablePackage | ( | const std::string & | packageUID, |
| const std::string & | localRoot = "", | ||
| const std::string & | serverURL = "", | ||
| bool | showUI = false ) |
Enables the package configuration for the specified package UID for synchronisation on the local machine. A local registration for the specified ServerURL is created if it doesn't already exist
| MT_CONNECTOR_EXPORT concurrency::task< EnablePackageResultCodes > MTConnectorSDK::EnablePackageTask | ( | const std::string & | packageUID, |
| const std::string & | localRoot = "", | ||
| const std::string & | serverURL = "", | ||
| bool | showUI = false, | ||
| concurrency::cancellation_token | cancel = concurrency::cancellation_token::none() ) |
Asynchronous counterpart of EnablePackage()
| MT_CONNECTOR_EXPORT std::vector< std::string > MTConnectorSDK::EnumerateLocalContents | ( | const std::string & | packageUID | ) |
Enumerates the contents of this package with respect to the local machine.
| MT_CONNECTOR_EXPORT std::vector< std::string > MTConnectorSDK::EnumerateLocalFilesByTag | ( | const std::string & | packageUID, |
| const std::string & | tagName, | ||
| const std::string & | tagValue ) |
Enumerates the contents of this package with respect to the local machine, filtering by those results which matched the specified tag criterion.
| MT_CONNECTOR_EXPORT std::vector< LocalFileRecord > MTConnectorSDK::EvaluateFilter | ( | const std::string & | filter, |
| const std::string & | packageUID = "", | ||
| const std::string & | serviceUID = "" ) |
Evaluates the specified filter string against the backing tag cache, returning an enumeration of the records which result from the specified query. The query evaluation can optionally be scoped to a single packageUID (where a corresponding tag value is expected). The destination tag cache can be optionally controlled via the serviceUID and profile parameters, otherwise the defaults are used.
| MT_CONNECTOR_EXPORT void MTConnectorSDK::ExcludeFromPackage | ( | PackageConfiguration & | instance, |
| const std::string & | localFilePath ) |
Modifies the Include and Exclude manifests of the package configuration so that the specified local file is excluded from the package. Note that this method does not implicitly evaluate the package against the local file system.
| MT_CONNECTOR_EXPORT std::vector< LocalFileRecord > MTConnectorSDK::FindFiles | ( | const std::string & | tagName, |
| const std::string & | tagValue, | ||
| const std::string & | fileNamePattern, | ||
| const std::string & | serviceUID = "", | ||
| bool | fuzzyMatch = false ) |
Finds all LocalFileRecord instances corresponding to the specified tag criteria, filtered to files matching the specified fileNamePattern. Fuzzy matching of the tagValue is supported via the fuzzyMatch switch (with the fileNamePattern always supporting fuzzy matching regardless of the switch, since it would be less intuitive otherwise). Passing an empty string to tagName will look for files matching top-level tags.
| MT_CONNECTOR_EXPORT std::vector< LocalFileRecord > MTConnectorSDK::FindFiles | ( | const std::string & | tagName, |
| const std::string & | tagValue, | ||
| const std::string & | serviceUID = "", | ||
| bool | fuzzyMatch = false ) |
Finds all LocalFileRecord instances corresponding to the specified tag criteria. Fuzzy matching of the tagValue is supported via the fuzzyMatch switch. Passing an empty string to tagName will look for files matching top-level tags.
| MT_CONNECTOR_EXPORT std::vector< LocalFileRecord > MTConnectorSDK::FindFiles | ( | const std::unordered_map< std::string, std::string > & | tagCriteria, |
| const std::string & | fileNamePattern, | ||
| const std::string & | serviceUID = "", | ||
| bool | fuzzyMatch = false ) |
Finds all LocalFileRecord instances corresponding to the specified tag criteria, filtered to files matching the specified fileNamePattern. Fuzzy matching of values in the tagCriteria is supported via the fuzzyMatch switch (with the fileNamePattern always supporting fuzzy matching regardless of the switch, since it would be less intuitive otherwise). Passing an empty string as a key in the tagCriteria will look for files matching top-level tags.
| MT_CONNECTOR_EXPORT std::vector< LocalFileRecord > MTConnectorSDK::FindFiles | ( | const std::unordered_map< std::string, std::string > & | tagCriteria, |
| const std::string & | serviceUID = "", | ||
| bool | fuzzyMatch = false ) |
Finds all LocalFileRecord instances corresponding to the specified tag criteria. Fuzzy matching of values in the tagCriteria is supported via the fuzzyMatch switch. Passing an empty string as a key in the tagCriteria will look for files matching top-level tags.
| MT_CONNECTOR_EXPORT std::vector< PackageConfiguration > MTConnectorSDK::FindPackageConfigurations | ( | const std::string & | jsonPath, |
| const std::string & | testValue, | ||
| bool | negate = false ) |
Finds all package configurations for which the specified jsonPath evaluates to the test value provided, returning their respective UIDs. Json paths are evaluated according to the popular specification laid out in https://goessner.net/articles/JsonPath/ Optionally invert the truth result for each package configuration by specifying the negate switch.
| MT_CONNECTOR_EXPORT std::vector< LocalTagRecord > MTConnectorSDK::FindTags | ( | const std::string & | tagNameFilter = "", |
| const std::string & | tagValueFilter = "", | ||
| const std::string & | serviceUID = "", | ||
| bool | fuzzyMatch = false ) |
Finds all LocalTagRecord instances in the local cache which optionally match the specified filter.
The tagNameFilter and tagValueFilter parameters supports the following syntaxes:
The default value for tagNameFilter - an empty string - will return all tag records, including top-level tags.
| MT_CONNECTOR_EXPORT std::vector< std::string > MTConnectorSDK::GetAccessiblePackages | ( | const std::string & | serviceUID = "" | ) |
Gets the packages which are known to be accessible to the current user in MineTrust. Caller can optionally specify the destination MineTrust endpoint.
| MT_CONNECTOR_EXPORT std::vector< std::string > MTConnectorSDK::GetArchivedPackages | ( | const std::string & | serviceUID = "" | ) |
Returns an enumeration of all the package UIDs which have previously been marked as archived within MineTrust. Caller can optionally specify the destination MineTrust endpoint.
| MT_CONNECTOR_EXPORT std::vector< PackageSummary > MTConnectorSDK::GetAvailablePackages | ( | const ServerRegistration & | registration | ) |
Gets the packages available on the MineTrust server corresponding to the specified registration, populated entirely from the local SQLite tag cache without a network round-trip.
| MT_CONNECTOR_EXPORT std::vector< std::string > MTConnectorSDK::GetDeletedPackages | ( | const std::string & | serviceUID = "" | ) |
Returns an enumeration of all the package UIDs which have previously been marked as deleted within MineTrust. Caller can optionally specify the destination MineTrust endpoint.
| MT_CONNECTOR_EXPORT std::vector< std::string > MTConnectorSDK::GetInaccessiblePackages | ( | const std::string & | serviceUID = "" | ) |
Gets the packages which are known to be inaccessible to the current user in MineTrust. Caller can optionally specify the destination MineTrust endpoint.
| MT_CONNECTOR_EXPORT std::unique_ptr< std::vector< PackageFileChange > > MTConnectorSDK::GetPackageChanges | ( | const std::string & | packageUID | ) |
Compares the current local package contents with the snapshot created when the package was locked. Returns nullptr while the local lock snapshot is unavailable or the package configuration is missing. A non-null empty vector means no files have changed.
| MT_CONNECTOR_EXPORT std::vector< std::string > MTConnectorSDK::GetPermittedValues | ( | const std::string & | configPath | ) |
Gets all permitted config values at the specified path, as defined by the local config schema.
| MT_CONNECTOR_EXPORT bool MTConnectorSDK::GetServerRegistrationForServerURL | ( | const std::string & | serverUrl, |
| ServerRegistration & | instance ) |
Gets the server registration for the specified server URL. Returns a value indicating whether a matching registration was found.
| MT_CONNECTOR_EXPORT bool MTConnectorSDK::GetServerRegistrationForServiceUID | ( | const std::string & | serviceUID, |
| ServerRegistration & | instance ) |
Gets the server registration for the specified service UID. Returns a value indicating whether a matching registration was found.
| MT_CONNECTOR_EXPORT void MTConnectorSDK::IncludeInPackage | ( | PackageConfiguration & | instance, |
| const std::string & | localFilePath, | ||
| std::function< void(IncludeConfiguration &)> | configureInclusion ) |
Modifies the Include and Exclude manifests of the package configuration so that the specified local file is included in the package. Optionally supplies a parameter to configure the IncludeConfiguration of the corresponding manifest entry. Note that this method does not implicitly evaluate the package against the local file system.
| MT_CONNECTOR_EXPORT bool MTConnectorSDK::IsInScope | ( | const std::string & | packageUID, |
| const std::string & | localFilePath ) |
Determines whether or not the specified local file is in the scope of the package configuration.
| MT_CONNECTOR_EXPORT bool MTConnectorSDK::IsMineTrustConnectorInstalled | ( | ) |
Determines whether MineTrust Connector is installed on the system. Only available on Windows platforms.
| MT_CONNECTOR_EXPORT bool MTConnectorSDK::IsMineTrustConnectorRunning | ( | ) |
Determines whether MineTrust Connector is running. Note that this mechanism will detect any running instance of MineTrust Connector (regardless of whether it is controlled by SCM)
| MT_CONNECTOR_EXPORT std::vector< PackageConfiguration > MTConnectorSDK::ListPackageConfigurations | ( | ) |
Lists the package UIDs of all available package configurations on the local machine.
| MT_CONNECTOR_EXPORT std::vector< PackageConfiguration > MTConnectorSDK::ListServerConfigurations | ( | ) |
Lists all available server configurations on the local machine.
| MT_CONNECTOR_EXPORT std::vector< ServerRegistration > MTConnectorSDK::ListServerRegistrations | ( | ) |
Lists all server registrations on the local machine.
| MT_CONNECTOR_EXPORT std::vector< std::string > MTConnectorSDK::ListServerURLs | ( | ) |
Lists the server URLs from all available server configurations on the local machine.
| MT_CONNECTOR_EXPORT ConfigSchema MTConnectorSDK::LoadConfigSchema | ( | const std::string & | root | ) |
Gets the configuration schema defined at the specified config root. If no config root is specified then the entire local config schema is produced.
| MT_CONNECTOR_EXPORT bool MTConnectorSDK::LoadPackageConfiguration | ( | const std::string & | packageUID, |
| PackageConfiguration & | instance ) |
Loads the package configuration with the specified packageUID into the specified instance. Returns a value indicating whether the operation was successful or not.
| MT_CONNECTOR_EXPORT PackageMetrics MTConnectorSDK::LoadPackageMetrics | ( | const std::string & | packageUID, |
| const std::string & | serviceUID = "" ) |
Gets the metrics for the specified package. Package metrics are defined for packages which are enabled and have a valid LocalRoot property. For packages in which metrics are not defined, the default metrics instance is entirely populated by -1. Note that the resolution of the expected package contents is calculated with respect to the local tag cache, whose contents may differ from the actual file(s) present on MineTrust.
| MT_CONNECTOR_EXPORT LockPackageResultCodes MTConnectorSDK::LockPackage | ( | const std::string & | packageUID, |
| const int & | ownerProcess = 0, | ||
| bool | showUI = false ) |
Obtains an exclusive lock on the specified local package. Creates a version marker within MineTrust as a baseline, then performs an exclusive check out of all files within this version
| MT_CONNECTOR_EXPORT concurrency::task< LockPackageResultCodes > MTConnectorSDK::LockPackageTask | ( | const std::string & | packageUID, |
| const int & | ownerProcess = 0, | ||
| bool | showUI = false, | ||
| concurrency::cancellation_token | cancel = concurrency::cancellation_token::none() ) |
Asynchronous counterpart of LockPackage()
| MT_CONNECTOR_EXPORT PrintDiagnosticsResultCodes MTConnectorSDK::PrintDiagnostics | ( | bool | showUI = false | ) |
Instructs MineTrust Connector to print the MineTrust HTTP Client diagnostic info to its local log file
| MT_CONNECTOR_EXPORT concurrency::task< PrintDiagnosticsResultCodes > MTConnectorSDK::PrintDiagnosticsTask | ( | bool | showUI = false, |
| concurrency::cancellation_token | cancel = concurrency::cancellation_token::none() ) |
Asynchronous counterpart of PrintDiagnostics()
| MT_CONNECTOR_EXPORT concurrency::task< void > MTConnectorSDK::ReceiveFiles | ( | const std::vector< LocalFileRecord > & | selection, |
| std::function< void(const std::vector< LocalFileRecord > &)> | filesReceivedCallback, | ||
| concurrency::cancellation_token | cancel = concurrency::cancellation_token::none() ) |
Processes the incoming file records as a set of files to 'receive' from MineTrust. Received files are either located from their corresponding, locally synced package, or are otherwise temporarily synced from MineTrust and passed back as their temporary file locations. File records received in this manner are guaranteed to be populated by their LocalFilePath property, and temporary files may not persist after the callback has been invoked.
| MT_CONNECTOR_EXPORT RegistrationWrapper MTConnectorSDK::RegisterEvents | ( | std::function< void(const MTConnectorEvent &)> | callback, |
| const std::list< LogEvent > & | eventIDs = {} ) |
Registers the specified function as a callback for events which are received from the MineTrust Connector service. Optionally supply a list of log events to subscribe to particular events only.
| MT_CONNECTOR_EXPORT RegisterServerResultCodes MTConnectorSDK::RegisterServer | ( | const std::string & | serverURL, |
| bool | showUI = false ) |
Creates a local registration for the server with the specified ServerURL. Initialises the server configuration for this server, using the ServerUID obtained via the REST API
| MT_CONNECTOR_EXPORT concurrency::task< RegisterServerResultCodes > MTConnectorSDK::RegisterServerTask | ( | const std::string & | serverURL, |
| bool | showUI = false, | ||
| concurrency::cancellation_token | cancel = concurrency::cancellation_token::none() ) |
Asynchronous counterpart of RegisterServer()
| MT_CONNECTOR_EXPORT void MTConnectorSDK::RemoveTag | ( | PackageConfiguration & | instance, |
| const std::string & | localFilePath, | ||
| const std::string & | tagName ) |
Updates the manifest of the package configuration so that the if specified local file is adorned with the specified tagName the associated tag is removed from the file
| MT_CONNECTOR_EXPORT bool MTConnectorSDK::SavePackageConfiguration | ( | const PackageConfiguration & | instance | ) |
Saves the values within the specified instance to the corresponding JSON structure on disk. Returns a value indicating whether the operation was successful or not.
| MT_CONNECTOR_EXPORT concurrency::task< void > MTConnectorSDK::SendFiles | ( | const std::vector< LocalFileRecord > & | selection, |
| std::function< PackageConfiguration(const LocalFileRecord &)> | packageSelectionCallback, | ||
| concurrency::cancellation_token | cancel = concurrency::cancellation_token::none() ) |
Processes the incoming file records as a set of files to 'send' to MineTrust. Each file to be sent is passed through the packageSelectionCallback which should determine the destination package of that file (null to indicate that the file can be skipped). Sent files are either added to their corresponding, locally synced package, or are otherwise resolved per-destination package to a partial synchronisation filter based on the tag metadata in their original package. This filter is then used to perform a temporary, partial synchronisation of the destination package, to which the respective file(s) are then added. Temporary packages are cleaned up after the operation completes.
| MT_CONNECTOR_EXPORT SyncNowResultCodes MTConnectorSDK::SyncNow | ( | const std::string & | packageUID, |
| bool | showUI = false ) |
Synchronously invokes an execution cycle for the specified package, returning '0' when it has completed. If an execution cycle is already in flight then this method returns when it completes.
| MT_CONNECTOR_EXPORT concurrency::task< SyncNowResultCodes > MTConnectorSDK::SyncNowTask | ( | const std::string & | packageUID, |
| bool | showUI = false, | ||
| concurrency::cancellation_token | cancel = concurrency::cancellation_token::none() ) |
Asynchronous counterpart of SyncNow()
| MT_CONNECTOR_EXPORT void MTConnectorSDK::TagFile | ( | PackageConfiguration & | instance, |
| const std::string & | localFilePath, | ||
| const std::string & | tagName, | ||
| const std::string & | tagValue ) |
Updates the manifest of the package configuration so that the specified local file is adorned with the tagName and tagValue specified. A null tagValue removes that tag if present.
| MT_CONNECTOR_EXPORT UnlockPackageResultCodes MTConnectorSDK::UnlockPackage | ( | const std::string & | packageUID, |
| bool | discardChanges = false, | ||
| bool | showUI = false ) |
Removes the exclusive lock on the specified local package. All files which were checked out as a part of the package lock will be automatically checked in (unless the 'discardChanges' switch is specified)
| MT_CONNECTOR_EXPORT concurrency::task< UnlockPackageResultCodes > MTConnectorSDK::UnlockPackageTask | ( | const std::string & | packageUID, |
| bool | discardChanges = false, | ||
| bool | showUI = false, | ||
| concurrency::cancellation_token | cancel = concurrency::cancellation_token::none() ) |
Asynchronous counterpart of UnlockPackage()
| MT_CONNECTOR_EXPORT UpdateLocalResultCodes MTConnectorSDK::UpdateLocal | ( | const std::string & | packageUID, |
| const std::string & | filePath, | ||
| bool | showUI = false ) |
Instructs MineTrust Connector to force-overwrite the specified local file with the contents of the corresponding server file
| MT_CONNECTOR_EXPORT concurrency::task< UpdateLocalResultCodes > MTConnectorSDK::UpdateLocalTask | ( | const std::string & | packageUID, |
| const std::string & | filePath, | ||
| bool | showUI = false, | ||
| concurrency::cancellation_token | cancel = concurrency::cancellation_token::none() ) |
Asynchronous counterpart of UpdateLocal()
| MT_CONNECTOR_EXPORT UpdateServerResultCodes MTConnectorSDK::UpdateServer | ( | const std::string & | packageUID, |
| const std::string & | filePath, | ||
| bool | showUI = false ) |
Instructs MineTrust Connector to force-overwrite the specified server file with the contents of the corresponding local file
| MT_CONNECTOR_EXPORT concurrency::task< UpdateServerResultCodes > MTConnectorSDK::UpdateServerTask | ( | const std::string & | packageUID, |
| const std::string & | filePath, | ||
| bool | showUI = false, | ||
| concurrency::cancellation_token | cancel = concurrency::cancellation_token::none() ) |
Asynchronous counterpart of UpdateServer()