MineTrust Connector CPP SDK

Classes | Public Types | Static Public Member Functions | List of all members
MineTrustConnector::CppCliInterop Class Reference

#include <CppCliInterop.h>

Classes

struct  ConfigSchema
 
struct  ConfigSchemaItem
 
struct  IncludeConfiguration
 
struct  LocalFileRecord
 
struct  LocalTagRecord
 
struct  MTConnectorEvent
 
struct  PackageConfiguration
 
struct  PackageMetrics
 
struct  RegistrationWrapperImpl
 

Public Types

enum class  LogEvent {
  AllFilesUpToDate = 1000 , SyncStarted = 1001 , SyncCompleted = 1002 , ReplicationStarted = 1003 ,
  ReplicationComplete = 1004 , VersionLocked = 1005 , PackageDisabled = 1006 , ProcessOwnedLockRemoved = 1007 ,
  PackageVersionCreated = 1008 , PackageDeleted = 1009 , PackageArchived = 1010 , PackageRestored = 1011 ,
  FileUploaded = 1100 , FileDownloaded = 1101 , FileUpdatedLocally = 1102 , FileUpdatedOnServer = 1103 ,
  FileRemovedOnServer = 1104 , FileReplicated = 1105 , FileDiscarded = 1106 , FileCheckedOut = 1107 ,
  FileCheckedIn = 1108 , FileUncheckedOut = 1109 , FileChangesDiscarded = 1110 , FileVersionsCleanedUp = 1111 ,
  FileUploadInProgress = 1112 , FileDownloadInProgress = 1113 , PreparingFileUpload = 1114 , Initialising = 2000 ,
  ConnectionEstablished = 2001 , ConnectionLost = 2002 , GracefulShutdown = 2003 , ServiceError = 2004 ,
  ServerRegistered = 2005 , AccessTokenSuccess = 2006 , PackageEnabled = 2007 , ServiceUIDMismatch = 2008 ,
  PackageAutoEnableUndetermined = 2009 , ClientCompatibilityError = 2010 , PackagePreviouslyDeleted = 2011 , SSLErrorDetected = 2012 ,
  GeneralSyncError = 4000 , GeneralReplicationError = 4001 , Unauthorized = 4002 , PackageConfigurationNotFound = 4003 ,
  AccessTokenRequired = 4004 , ServerRegistrationFailed = 4005 , LockPackageFailed = 4006 , UnlockPackageFailed = 4007 ,
  EnablePackageFailed = 4008 , UpdateLocalFailed = 4009 , UpdateServerFailed = 4010 , PackageValidationFailed = 4011 ,
  FileConflict = 4012 , CreateVersionFailed = 4013 , PackageDeletionFailed = 4014 , PrintDiagnosticsFailed = 4015 ,
  AccessForbidden = 4016
}
 
enum class  RegisterServerResultCodes { Success = 0 , ServerAlreadyRegistered = 1 , GeneralError = 2 , IncompatibleClient = 3 }
 
enum class  EnablePackageResultCodes {
  Success = 0 , PackageConfigurationNotFound = 1 , PackageAlreadyEnabled = 2 , PackagePreviouslyDeleted = 3 ,
  ServerURLNotValid = 4 , GeneralError = 5 , IncompatibleClient = 6
}
 
enum class  CreateVersionResultCodes { Success = 0 , PackageConfigurationNotFound = 1 , GeneralError = 2 , IncompatibleClient = 3 }
 
enum class  LockPackageResultCodes {
  Success = 0 , PackageConfigurationNotFound = 1 , PackageAlreadyLocked = 2 , FilesCheckedOutElsewhere = 3 ,
  ProcessNotFound = 4 , PackageNotEnabled = 5 , PackageProcessing = 6 , GeneralError = 7 ,
  IncompatibleClient = 8
}
 
enum class  UnlockPackageResultCodes {
  Success = 0 , PackageConfigurationNotFound = 1 , PackageNotLocked = 2 , GeneralError = 3 ,
  IncompatibleClient = 4
}
 
enum class  SyncNowResultCodes {
  Success = 0 , PackageConfigurationNotFound = 1 , PackageNotEnabled = 2 , PackageLocked = 3 ,
  GeneralError = 4 , IncompatibleClient = 5
}
 
enum class  UpdateServerResultCodes {
  Success = 0 , PackageConfigurationNotFound = 1 , LocalFileNotFound = 2 , ServerFileNotFound = 3 ,
  ServerFileCheckedOut = 4 , GeneralError = 5 , IncompatibleClient = 6
}
 
enum class  UpdateLocalResultCodes {
  Success = 0 , PackageConfigurationNotFound = 1 , LocalFileNotFound = 2 , ServerFileNotFound = 3 ,
  GeneralError = 4 , IncompatibleClient = 5
}
 
enum class  PrintDiagnosticsResultCodes { Success = 0 , GeneralError = 1 , IncompatibleClient = 2 }
 
using RegistrationWrapper = std::unique_ptr< RegistrationWrapperImpl, void(*)(RegistrationWrapperImpl *)>
 

Static Public Member Functions

static bool LoadPackageConfiguration (const std::string &packageUID, PackageConfiguration &instance)
 
static bool SavePackageConfiguration (const PackageConfiguration &instance)
 
static RegisterServerResultCodes RegisterServer (const std::string &serverURL, bool showUI=false)
 
static concurrency::task< RegisterServerResultCodesRegisterServerTask (const std::string &serverURL, bool showUI=false, concurrency::cancellation_token cancel=concurrency::cancellation_token::none())
 
static EnablePackageResultCodes EnablePackage (const std::string &packageUID, const std::string &localRoot="", const std::string &serverURL="", bool showUI=false)
 
static concurrency::task< EnablePackageResultCodesEnablePackageTask (const std::string &packageUID, const std::string &localRoot="", const std::string &serverURL="", bool showUI=false, concurrency::cancellation_token cancel=concurrency::cancellation_token::none())
 
static CreateVersionResultCodes CreateVersion (const std::string &packageUID, const std::string &comment="", bool showUI=false)
 
static concurrency::task< CreateVersionResultCodesCreateVersionTask (const std::string &packageUID, const std::string &comment="", bool showUI=false, concurrency::cancellation_token cancel=concurrency::cancellation_token::none())
 
static LockPackageResultCodes LockPackage (const std::string &packageUID, const int &ownerProcess=0, bool showUI=false)
 
static concurrency::task< LockPackageResultCodesLockPackageTask (const std::string &packageUID, const int &ownerProcess=0, bool showUI=false, concurrency::cancellation_token cancel=concurrency::cancellation_token::none())
 
static UnlockPackageResultCodes UnlockPackage (const std::string &packageUID, bool discardChanges=false, bool showUI=false)
 
static concurrency::task< UnlockPackageResultCodesUnlockPackageTask (const std::string &packageUID, bool discardChanges=false, bool showUI=false, concurrency::cancellation_token cancel=concurrency::cancellation_token::none())
 
static SyncNowResultCodes SyncNow (const std::string &packageUID, bool showUI=false)
 
static concurrency::task< SyncNowResultCodesSyncNowTask (const std::string &packageUID, bool showUI=false, concurrency::cancellation_token cancel=concurrency::cancellation_token::none())
 
static UpdateServerResultCodes UpdateServer (const std::string &packageUID, const std::string &filePath, bool showUI=false)
 
static concurrency::task< UpdateServerResultCodesUpdateServerTask (const std::string &packageUID, const std::string &filePath, bool showUI=false, concurrency::cancellation_token cancel=concurrency::cancellation_token::none())
 
static UpdateLocalResultCodes UpdateLocal (const std::string &packageUID, const std::string &filePath, bool showUI=false)
 
static concurrency::task< UpdateLocalResultCodesUpdateLocalTask (const std::string &packageUID, const std::string &filePath, bool showUI=false, concurrency::cancellation_token cancel=concurrency::cancellation_token::none())
 
static PrintDiagnosticsResultCodes PrintDiagnostics (bool showUI=false)
 
static concurrency::task< PrintDiagnosticsResultCodesPrintDiagnosticsTask (bool showUI=false, concurrency::cancellation_token cancel=concurrency::cancellation_token::none())
 
static std::vector< std::string > ListServerURLs ()
 
static std::vector< PackageConfigurationListServerConfigurations ()
 
static std::vector< PackageConfigurationListPackageConfigurations ()
 
static std::vector< PackageConfigurationFindPackageConfigurations (const std::string &jsonPath, const std::string &testValue, bool negate=false)
 
static std::unordered_map< std::string, std::vector< std::string > > FindPackageConfigurationItems (const std::string &tagName, const std::string &tagValue)
 
static std::unordered_map< std::string, std::vector< std::string > > FindPackageConfigurationItems (const std::unordered_map< std::string, std::string > &tagCriteria)
 
static std::vector< LocalTagRecordFindTags (const std::string &filter="", const std::string &serviceUID="", bool fuzzyMatch=false)
 
static std::vector< LocalFileRecordFindFiles (const std::string &tagName, const std::string &tagValue, const std::string &serviceUID="", bool fuzzyMatch=false)
 
static std::vector< LocalFileRecordFindFiles (const std::unordered_map< std::string, std::string > &tagCriteria, const std::string &serviceUID="", bool fuzzyMatch=false)
 
static std::vector< std::string > GetDeletedPackages (const std::string &serviceUID="")
 
static std::vector< std::string > GetArchivedPackages (const std::string &serviceUID="")
 
static std::string GetShellExtensionName ()
 
static PackageMetrics LoadPackageMetrics (const std::string &packageUID)
 
static ConfigSchema LoadConfigSchema (const std::string &root)
 
static std::vector< std::string > GetPermittedValues (const std::string &configPath)
 
static bool IsMineTrustConnectorInstalled ()
 
static bool IsMineTrustConnectorRunning ()
 
static RegistrationWrapper RegisterEvents (std::function< void(const MTConnectorEvent &)> callback, const std::list< LogEvent > &eventIDs={})
 
static std::vector< std::string > EnumerateLocalContents (const std::string &packageUID)
 
static std::vector< std::string > EnumerateLocalFilesByTag (const std::string &packageUID, const std::string &tagName, const std::string &tagValue)
 
static bool IsInScope (const std::string &packageUID, const std::string &localFilePath)
 
static void IncludeInPackage (PackageConfiguration &instance, const std::string &localFilePath, std::function< void(IncludeConfiguration &)> configureInclusion)
 
static void ExcludeFromPackage (PackageConfiguration &instance, const std::string &localFilePath)
 
static void TagFile (PackageConfiguration &instance, const std::string &localFilePath, const std::string &tagName, const std::string &tagValue)
 
static 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())
 
static concurrency::task< void > SendFiles (const std::vector< LocalFileRecord > &selection, std::function< PackageConfiguration(const LocalFileRecord &)> packageSelectionCallback, concurrency::cancellation_token cancel=concurrency::cancellation_token::none())
 

Detailed Description

Exposes the Interop layer to the managed MineTrustConnector Core library

Examples
NativeApp.cpp.

Member Enumeration Documentation

◆ CreateVersionResultCodes

Return codes for CreateVersion and their meaning

Enumerator
Success 

0 = Success

PackageConfigurationNotFound 

1 = Occurs when the requested package configuration was not found on the local server

GeneralError 

2 = A general error occurred

IncompatibleClient 

3 = The client does not meet the version requirements of the server

◆ EnablePackageResultCodes

Return codes for EnablePackage and their meaning

Enumerator
Success 

0 = Success

PackageConfigurationNotFound 

1 = Occurs when the requested package configuration was not found on the local server

PackageAlreadyEnabled 

2 = The package with the specified package UID is already enabled

PackagePreviouslyDeleted 

3 = A package with the specified package UID was previously deleted from the server

ServerURLNotValid 

4 = Occurs when the specified package UID is not present within the MineTrust endpoint, or if the corresponding package was previously enabled for a different MineTrust endpoint

GeneralError 

5 = A general error occurred

IncompatibleClient 

6 = The client does not meet the version requirements of the server

◆ LockPackageResultCodes

Return codes for LockPackage and their meaning

Enumerator
Success 

0 = Success

PackageConfigurationNotFound 

1 = Occurs when the requested package configuration was not found on the local server

PackageAlreadyLocked 

2 = Occurs when the specified package was already locked locally

FilesCheckedOutElsewhere 

3 = Occurs when the package cannot be locked because one or more files were checked out by another user

ProcessNotFound 

4 = Occurs when an OwnerProcess PID was specified, but no matching process was found

PackageNotEnabled 

5 = Occurs when a package cannot be locked because it is not currently enabled for sync

PackageProcessing 

6 = Occurs when a package cannot be locked because it is currently being processed by MT Connector

GeneralError 

7 = A general error occurred

IncompatibleClient 

8 = The client does not meet the version requirements of the server

◆ LogEvent

Enumeration of the log event IDs and formats that are shared by both the Dashboard and Service components

Enumerator
AllFilesUpToDate 

This event indicates that, on the last execution cycle for a particular package, all files were processed with no further changes required

SyncStarted 

Event raised whenever sync starts for a particular package

SyncCompleted 

Event raised whenever sync completes for a particular package

ReplicationStarted 

Event raised whenever replication starts for a particular package

ReplicationComplete 

Event raised whenever replication completes for a particular package

VersionLocked 

Event which indicates that the corresponding package has been successfully locked to the desired version

PackageDisabled 

Event which indicates that execution is currently paused for the corresponding package, due to its configuration being disabled

ProcessOwnedLockRemoved 

Event which indicates that a version lock owned by a particular process has been automatically removed

PackageVersionCreated 

Event which indicates that a package version has been created

PackageDeleted 

Event which indicates that a package configuration has been deleted

PackageArchived 

Event which indicates that a package configuration has been archived

PackageRestored 

Event which indicates that a package configuration has been restored

FileUploaded 

Event raised whenever a new file is uploaded to the MineTrust Server

FileDownloaded 

Event raised whenever a new file is downloaded from the MineTrust Server

FileUpdatedLocally 

Event raised whenever a file has been overwritten locally from the server copy

FileUpdatedOnServer 

Event raised whenever a file has been overwritten on the server from the local copy

FileRemovedOnServer 

Event raised whenever a file has been removed on the server

FileReplicated 

Event raised whenever a file has been replicated from the target package version

FileDiscarded 

Event raised whenever a local file is discarded as a result of checking out a version or reverting local changes

FileCheckedOut 

Event raised whenever a file is checked out from the server

FileCheckedIn 

Event raised whenever a file is checked in to the server

FileUncheckedOut 

Event raised whenever a file checkout is reverted

FileChangesDiscarded 

Event raised whenever changes to a local file are discarded as a result of checking out a version or reverting local changes

FileVersionsCleanedUp 

Event raised whenever old versions of a file are cleaned up following the evaluation of a RetentionPolicy.

FileUploadInProgress 

Event raised for a large file upload which is currently in progress

FileDownloadInProgress 

Event raised for a large file download which is currently in progress

PreparingFileUpload 

Event raised when a large file is being prepared for upload

Initialising 

Event indicates that the service is initialising

ConnectionEstablished 

Event indicates that a connection to MT Server has been successfully established

ConnectionLost 

Event indicates that a connection to MT Server has been lost

GracefulShutdown 

Event indicates that the service has exited gracefully

ServiceError 

Event indicates that the service has exited with an error

ServerRegistered 

Event indicates that a new server has been registered

AccessTokenSuccess 

Event indicates that an access token was successfully obtained

PackageEnabled 

Event indicates that a package has been enabled by the service

ServiceUIDMismatch 

Event indicating that the MineTrust ServiceUID for the corresponding endpoint did not match the value expected by the package configuration

PackageAutoEnableUndetermined 

Event indicating that the auto-enable property for the corresponding package could not be determined

ClientCompatibilityError 

Event indicating that the service encountered an error due to a client compatibility issue

PackagePreviouslyDeleted 

Event indicating that the service attempted to enable a package which was previously deleted on the server

SSLErrorDetected 

Event indicating that a client SSL error was detected. We only raise this event in development environments when client SSL validation is not already being suppressed

GeneralSyncError 

Event indicates that a general sync error has occurred (service will continue to execute)

GeneralReplicationError 

Event indicates that a general replication error has occurred (service will continue to execute)

Unauthorized 

Event indicates that an authentication error occurred as a result of authorization failure

PackageConfigurationNotFound 

Event indicates that a package configuration was missing

AccessTokenRequired 

Event indicates that the service requires interactive authentication in order to provide an access token (previously DeviceCodeRequired, but we are no longer using Device Code Flow due to limitations with MSAL and B2C. Instead we have implemented our own Authorization Code Flow)

ServerRegistrationFailed 

Event indicates that registration of a new MineTrust Server failed

LockPackageFailed 

Event indicates that locking of the specified package failed

UnlockPackageFailed 

Event indicates that unlocking of the specified package failed

EnablePackageFailed 

Event indicates that enabling of the specified package failed

UpdateLocalFailed 

Event indicates that the service failed to resolve a file conflict by updating the local file

UpdateServerFailed 

Event indicates that the service failed to resolve a file conflict by updating the server file

PackageValidationFailed 

Event indicates that validation has failed for a particular package

FileConflict 

Event indicating that attempting to synchronise a file resulted in a conflict

CreateVersionFailed 

Event indicates that creation of a package version failed

PackageDeletionFailed 

Event indicates that deletion of a package configuration failed

PrintDiagnosticsFailed 

Event indicates that service diagnostics could not be retrieved

AccessForbidden 

Event indicates that access to the requested MineTrust resource was forbidden

◆ PrintDiagnosticsResultCodes

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

◆ RegisterServerResultCodes

Return codes for RegisterServer and their meaning

Enumerator
Success 

0 = Success

ServerAlreadyRegistered 

1 = Server with this URL is already registered

GeneralError 

2 = A general error occurred

IncompatibleClient 

3 = The client does not meet the version requirements of the server

◆ SyncNowResultCodes

Return codes for SyncNow and their meaning

Enumerator
Success 

0 = Success

PackageConfigurationNotFound 

1 = Occurs when the requested package configuration was not found on the local server

PackageNotEnabled 

2 = Occurs when the specified package is not currently enabled for execution

PackageLocked 

3 = Occurs when the specified package cannot be synced because it is currently locked locally

GeneralError 

4 = A general error occurred

IncompatibleClient 

5 = The client does not meet the version requirements of the server

◆ UnlockPackageResultCodes

Return codes for UnlockPackage and their meaning

Enumerator
Success 

0 = Success

PackageConfigurationNotFound 

1 = Occurs when the requested package configuration was not found on the local server

PackageNotLocked 

2 = Occurs when no package lock was found for the specified package

GeneralError 

3 = A general error occurred

IncompatibleClient 

4 = The client does not meet the version requirements of the server

◆ UpdateLocalResultCodes

Return codes for UpdateLocal and their meaning

Enumerator
Success 

0 = Success

PackageConfigurationNotFound 

1 = Occurs when the requested package configuration was not found on the local server

LocalFileNotFound 

2 = Occurs when the specified file is not found locally

ServerFileNotFound 

3 = Occurs when the specified file is not found on the server

GeneralError 

4 = A general error occurred

IncompatibleClient 

5 = The client does not meet the version requirements of the server

◆ UpdateServerResultCodes

Return codes for UpdateServer and their meaning

Enumerator
Success 

0 = Success

PackageConfigurationNotFound 

1 = Occurs when the requested package configuration was not found on the local server

LocalFileNotFound 

2 = Occurs when the specified file is not found locally

ServerFileNotFound 

3 = Occurs when the specified file is not found on the server

ServerFileCheckedOut 

4 = Occurs when the server file cannot be updated because it has been checked out by another user

GeneralError 

5 = A general error occurred

IncompatibleClient 

6 = The client does not meet the version requirements of the server

Member Function Documentation

◆ CreateVersion()

auto MineTrustConnector::CppCliInterop::CreateVersion ( const std::string &  packageUID,
const std::string &  comment = "",
bool  showUI = false 
)
static

Creates a new version of the specified package, capturing all file versions as they currently exist for that package within MineTrust

◆ CreateVersionTask()

auto MineTrustConnector::CppCliInterop::CreateVersionTask ( const std::string &  packageUID,
const std::string &  comment = "",
bool  showUI = false,
concurrency::cancellation_token  cancel = concurrency::cancellation_token::none() 
)
static

Asynchronous counterpart of 'CreateVersion' WARNING: Care should be exercised when exercising cancellation if showUI is enabled - cancelling the invocation kills the underlying process, which may cause interactive windows to become unresponsive

◆ EnablePackage()

auto MineTrustConnector::CppCliInterop::EnablePackage ( const std::string &  packageUID,
const std::string &  localRoot = "",
const std::string &  serverURL = "",
bool  showUI = false 
)
static

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

◆ EnablePackageTask()

auto MineTrustConnector::CppCliInterop::EnablePackageTask ( const std::string &  packageUID,
const std::string &  localRoot = "",
const std::string &  serverURL = "",
bool  showUI = false,
concurrency::cancellation_token  cancel = concurrency::cancellation_token::none() 
)
static

Asynchronous counterpart of 'EnablePackage' WARNING: Care should be exercised when exercising cancellation if showUI is enabled - cancelling the invocation kills the underlying process, which may cause interactive windows to become unresponsive

◆ EnumerateLocalContents()

std::vector< std::string > MineTrustConnector::CppCliInterop::EnumerateLocalContents ( const std::string &  packageUID)
static

Enumerates the contents of this package with respect to the local machine.

◆ EnumerateLocalFilesByTag()

std::vector< std::string > MineTrustConnector::CppCliInterop::EnumerateLocalFilesByTag ( const std::string &  packageUID,
const std::string &  tagName,
const std::string &  tagValue 
)
static

Enumerates the contents of this package with respect to the local machine, filtering by those results which matched the specified tag criterion.

◆ ExcludeFromPackage()

void MineTrustConnector::CppCliInterop::ExcludeFromPackage ( PackageConfiguration instance,
const std::string &  localFilePath 
)
static

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.

◆ FindFiles() [1/2]

auto MineTrustConnector::CppCliInterop::FindFiles ( const std::string &  tagName,
const std::string &  tagValue,
const std::string &  serviceUID = "",
bool  fuzzyMatch = false 
)
static

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.

◆ FindFiles() [2/2]

auto MineTrustConnector::CppCliInterop::FindFiles ( const std::unordered_map< std::string, std::string > &  tagCriteria,
const std::string &  serviceUID = "",
bool  fuzzyMatch = false 
)
static

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.

◆ FindPackageConfigurationItems() [1/2]

std::unordered_map< std::string, std::vector< std::string > > MineTrustConnector::CppCliInterop::FindPackageConfigurationItems ( const std::string &  tagName,
const std::string &  tagValue 
)
static

Finds all include configurations for which the tag with the specified name has the corresponding tag value. Returns a map of vectors whose values are the file names associated with the include configuration, indexed in the containing map by their corresponding package UID.

◆ FindPackageConfigurationItems() [2/2]

std::unordered_map< std::string, std::vector< std::string > > MineTrustConnector::CppCliInterop::FindPackageConfigurationItems ( const std::unordered_map< std::string, std::string > &  tagCriteria)
static

Finds all include configurations for which the specified tag criteria are met. An include configuration fails to meet the tag criteria, either if it does not have any tags present, or if any of the tag names specified don't match the corresponding value, or are missing. Returns a map of vectors whose values are the file names associated with the include configuration, indexed in the containing map by their corresponding package UID.

◆ FindPackageConfigurations()

auto MineTrustConnector::CppCliInterop::FindPackageConfigurations ( const std::string &  jsonPath,
const std::string &  testValue,
bool  negate = false 
)
static

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.

◆ FindTags()

auto MineTrustConnector::CppCliInterop::FindTags ( const std::string &  filter = "",
const std::string &  serviceUID = "",
bool  fuzzyMatch = false 
)
static

Finds all LocalTagRecord instances in the local cache which optionally match the specified filter.

The filter parameter supports the following syntaxes:

'MapType': Return all tag records corresponding to the 'MapType' tag 'Map*' (with fuzzyMatch enabled): Return all tag records whose parent tag starts with 'Map' '*Type' (with fuzzyMatch enabled): Return all tag records whose parent tag ends with 'Type' 'PackageConfiguration\DisplayName': Enumerate all hierarchical tag values for 'PackageConfiguration' -> 'DisplayName' 'PackageConfiguration\*' (with fuzzyMatch enabled): Return all tag records whose parent tag is within the 'PackageConfiguration' hierarchy null%: Return only 'top-level' tags (i.e. tags with no parent tag folder)

The default value for filter - an empty string - will return all tag records, including top-level tags.

◆ GetArchivedPackages()

std::vector< std::string > MineTrustConnector::CppCliInterop::GetArchivedPackages ( const std::string &  serviceUID = "")
static

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.

◆ GetDeletedPackages()

std::vector< std::string > MineTrustConnector::CppCliInterop::GetDeletedPackages ( const std::string &  serviceUID = "")
static

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.

◆ GetPermittedValues()

std::vector< std::string > MineTrustConnector::CppCliInterop::GetPermittedValues ( const std::string &  configPath)
static

Gets all permitted config values at the specified path, as defined by the local config schema.

◆ GetShellExtensionName()

std::string MineTrustConnector::CppCliInterop::GetShellExtensionName ( )
static

Gets the name of the MineTrust Connector Shell extension, as it appears installed on the local machine. If the current environment is non-Windows then null is returned.

◆ IncludeInPackage()

void MineTrustConnector::CppCliInterop::IncludeInPackage ( PackageConfiguration instance,
const std::string &  localFilePath,
std::function< void(IncludeConfiguration &)>  configureInclusion 
)
static

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.

◆ IsInScope()

bool MineTrustConnector::CppCliInterop::IsInScope ( const std::string &  packageUID,
const std::string &  localFilePath 
)
static

Determines whether or not the specified local file is in the scope of the package configuration.

◆ IsMineTrustConnectorInstalled()

bool MineTrustConnector::CppCliInterop::IsMineTrustConnectorInstalled ( )
static

Determines whether MineTrust Connector is installed on the system. Only available on Windows platforms.

◆ IsMineTrustConnectorRunning()

bool MineTrustConnector::CppCliInterop::IsMineTrustConnectorRunning ( )
static

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)

◆ ListPackageConfigurations()

auto MineTrustConnector::CppCliInterop::ListPackageConfigurations ( )
static

Lists the package UIDs of all available package configurations on the local machine.

◆ ListServerConfigurations()

auto MineTrustConnector::CppCliInterop::ListServerConfigurations ( )
static

Lists all available server configurations on the local machine.

◆ ListServerURLs()

std::vector< std::string > MineTrustConnector::CppCliInterop::ListServerURLs ( )
static

Lists the server URLs from all available server configurations on the local machine.

◆ LoadConfigSchema()

auto MineTrustConnector::CppCliInterop::LoadConfigSchema ( const std::string &  root)
static

Gets the configuration schema defined at the specified config root. If no config root is specified then the entire local config schema is produced.

◆ LoadPackageConfiguration()

bool MineTrustConnector::CppCliInterop::LoadPackageConfiguration ( const std::string &  packageUID,
PackageConfiguration instance 
)
static

Loads the package configuration with the specified packageUID into the specified instance. Returns a value indicating whether the operation was successful or not.

◆ LoadPackageMetrics()

auto MineTrustConnector::CppCliInterop::LoadPackageMetrics ( const std::string &  packageUID)
static

Gets the metrics for the specified package. Package metrics are defined whenever a package's contents are deterministic (i.e. non-empty Include list and no wildcards). For packages in which metrics are not defined, the default metrics instance is entirely populated by -1.

◆ LockPackage()

auto MineTrustConnector::CppCliInterop::LockPackage ( const std::string &  packageUID,
const int &  ownerProcess = 0,
bool  showUI = false 
)
static

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

◆ LockPackageTask()

auto MineTrustConnector::CppCliInterop::LockPackageTask ( const std::string &  packageUID,
const int &  ownerProcess = 0,
bool  showUI = false,
concurrency::cancellation_token  cancel = concurrency::cancellation_token::none() 
)
static

Asynchronous counterpart of 'LockPackage' WARNING: Care should be exercised when exercising cancellation if showUI is enabled - cancelling the invocation kills the underlying process, which may cause interactive windows to become unresponsive

◆ PrintDiagnostics()

auto MineTrustConnector::CppCliInterop::PrintDiagnostics ( bool  showUI = false)
static

Instructs MineTrust Connector to print the MineTrust HTTP Client diagnostic info to its local log file

◆ PrintDiagnosticsTask()

auto MineTrustConnector::CppCliInterop::PrintDiagnosticsTask ( bool  showUI = false,
concurrency::cancellation_token  cancel = concurrency::cancellation_token::none() 
)
static

Asynchronous counterpart of 'PrintDiagnostics' WARNING: Care should be exercised when exercising cancellation if showUI is enabled - cancelling the invocation kills the underlying process, which may cause interactive windows to become unresponsive

◆ ReceiveFiles()

concurrency::task< void > MineTrustConnector::CppCliInterop::ReceiveFiles ( const std::vector< LocalFileRecord > &  selection,
std::function< void(const std::vector< LocalFileRecord > &)>  filesReceivedCallback,
concurrency::cancellation_token  cancel = concurrency::cancellation_token::none() 
)
static

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.

◆ RegisterEvents()

auto MineTrustConnector::CppCliInterop::RegisterEvents ( std::function< void(const MTConnectorEvent &)>  callback,
const std::list< LogEvent > &  eventIDs = {} 
)
static

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.

◆ RegisterServer()

auto MineTrustConnector::CppCliInterop::RegisterServer ( const std::string &  serverURL,
bool  showUI = false 
)
static

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

◆ RegisterServerTask()

auto MineTrustConnector::CppCliInterop::RegisterServerTask ( const std::string &  serverURL,
bool  showUI = false,
concurrency::cancellation_token  cancel = concurrency::cancellation_token::none() 
)
static

Asynchronous counterpart of 'RegisterServer' WARNING: Care should be exercised when exercising cancellation if showUI is enabled - cancelling the invocation kills the underlying process, which may cause interactive windows to become unresponsive

◆ SavePackageConfiguration()

bool MineTrustConnector::CppCliInterop::SavePackageConfiguration ( const PackageConfiguration instance)
static

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.

◆ SendFiles()

concurrency::task< void > MineTrustConnector::CppCliInterop::SendFiles ( const std::vector< LocalFileRecord > &  selection,
std::function< PackageConfiguration(const LocalFileRecord &)>  packageSelectionCallback,
concurrency::cancellation_token  cancel = concurrency::cancellation_token::none() 
)
static

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.

◆ SyncNow()

auto MineTrustConnector::CppCliInterop::SyncNow ( const std::string &  packageUID,
bool  showUI = false 
)
static

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.

◆ SyncNowTask()

auto MineTrustConnector::CppCliInterop::SyncNowTask ( const std::string &  packageUID,
bool  showUI = false,
concurrency::cancellation_token  cancel = concurrency::cancellation_token::none() 
)
static

Asynchronous counterpart of 'SyncNow' WARNING: Care should be exercised when exercising cancellation if showUI is enabled - cancelling the invocation kills the underlying process, which may cause interactive windows to become unresponsive

◆ TagFile()

void MineTrustConnector::CppCliInterop::TagFile ( PackageConfiguration instance,
const std::string &  localFilePath,
const std::string &  tagName,
const std::string &  tagValue 
)
static

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.

◆ UnlockPackage()

auto MineTrustConnector::CppCliInterop::UnlockPackage ( const std::string &  packageUID,
bool  discardChanges = false,
bool  showUI = false 
)
static

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)

◆ UnlockPackageTask()

auto MineTrustConnector::CppCliInterop::UnlockPackageTask ( const std::string &  packageUID,
bool  discardChanges = false,
bool  showUI = false,
concurrency::cancellation_token  cancel = concurrency::cancellation_token::none() 
)
static

Asynchronous counterpart of 'UnlockPackage' WARNING: Care should be exercised when exercising cancellation if showUI is enabled - cancelling the invocation kills the underlying process, which may cause interactive windows to become unresponsive

◆ UpdateLocal()

auto MineTrustConnector::CppCliInterop::UpdateLocal ( const std::string &  packageUID,
const std::string &  filePath,
bool  showUI = false 
)
static

Instructs MineTrust Connector to force-overwrite the specified local file with the contents of the corresponding server file

◆ UpdateLocalTask()

auto MineTrustConnector::CppCliInterop::UpdateLocalTask ( const std::string &  packageUID,
const std::string &  filePath,
bool  showUI = false,
concurrency::cancellation_token  cancel = concurrency::cancellation_token::none() 
)
static

Asynchronous counterpart of 'UpdateLocal' WARNING: Care should be exercised when exercising cancellation if showUI is enabled - cancelling the invocation kills the underlying process, which may cause interactive windows to become unresponsive

◆ UpdateServer()

auto MineTrustConnector::CppCliInterop::UpdateServer ( const std::string &  packageUID,
const std::string &  filePath,
bool  showUI = false 
)
static

Instructs MineTrust Connector to force-overwrite the specified server file with the contents of the corresponding local file

◆ UpdateServerTask()

auto MineTrustConnector::CppCliInterop::UpdateServerTask ( const std::string &  packageUID,
const std::string &  filePath,
bool  showUI = false,
concurrency::cancellation_token  cancel = concurrency::cancellation_token::none() 
)
static

Asynchronous counterpart of 'UpdateServer' WARNING: Care should be exercised when exercising cancellation if showUI is enabled - cancelling the invocation kills the underlying process, which may cause interactive windows to become unresponsive


The documentation for this class was generated from the following files: