3D Repo Bouncer  1.4
Classes | Public Member Functions | List of all members
repo::RepoController Class Reference

Classes

class  _RepoControllerImpl
 
class  RepoToken
 

Public Member Functions

 RepoController (std::vector< lib::RepoAbstractListener * > listeners=std::vector< lib::RepoAbstractListener * >(), const uint32_t &numConcurrentOps=1, const uint32_t &numDbConn=1)
 
 ~RepoController ()
 
RepoTokenauthenticateMongo (std::string &errMsg, const std::string &address, const uint32_t &port, const std::string &dbName, const std::string &username, const std::string &password, const bool &pwDigested=false)
 
bool authenticateMongo (std::string &errMsg, const RepoToken *token)
 
RepoTokenauthenticateToAdminDatabaseMongo (std::string &errMsg, const std::string &address, const int &port, const std::string &username, const std::string &password, const bool &pwDigested=false)
 
void disconnectFromDatabase (const RepoToken *token)
 
bool testConnection (const RepoToken *token)
 
void addAlias (RepoToken *token, const std::string &alias)
 
RepoTokencreateToken (const std::string &alias, const std::string &address, const int &port, const std::string &dbName, const std::string &username, const std::string &password)
 
RepoTokencreateToken (const std::string &alias, const std::string &address, const int &port, const std::string &dbName, const RepoController::RepoToken *token)
 
RepoTokencreateTokenFromSerialised (const std::string &data) const
 
void destroyToken (RepoToken *token)
 
void getInfoFromToken (const RepoToken *token, std::string &alias, std::string &host, uint32_t &port, std::string &username, std::string &authDB) const
 
std::string serialiseToken (const RepoToken *token) const
 
uint64_t countItemsInCollection (const RepoToken *token, const std::string &database, const std::string &collection)
 
std::vector< repo::core::model::RepoBSONgetAllFromCollectionContinuous (const RepoToken *token, const std::string &database, const std::string &collection, const uint64_t &skip=0, const uint32_t &limit=0)
 
std::vector< repo::core::model::RepoBSONgetAllFromCollectionContinuous (const RepoToken *token, const std::string &database, const std::string &collection, const std::list< std::string > &fields, const std::string &sortField, const int &sortOrder=-1, const uint64_t &skip=0, const uint32_t &limit=0)
 
std::vector< repo::core::model::RepoRolegetRolesFromDatabase (const RepoToken *token, const std::string &database, const uint64_t &skip=0, const uint32_t &limit=0)
 
std::vector< repo::core::model::RepoRoleSettingsgetRoleSettingsFromDatabase (const RepoToken *token, const std::string &database, const uint64_t &skip=0, const uint32_t &limit=0)
 
repo::core::model::RepoRoleSettings getRoleSettings (const RepoToken *token, const repo::core::model::RepoRole &role)
 
repo::core::model::RepoRoleSettings getRoleSettings (const RepoToken *token, const std::string &database, const std::string &uniqueRoleName)
 
std::list< std::string > getCollections (const RepoToken *token, const std::string &databaseName)
 
repo::core::model::CollectionStats getCollectionStats (const RepoToken *token, const std::string &database, const std::string &collection)
 
std::list< std::string > getDatabases (const RepoToken *token)
 
std::map< std::string, std::list< std::string > > getDatabasesWithProjects (const RepoToken *token, const std::list< std::string > &databases)
 
std::string getHostAndPort (const RepoToken *token)
 
std::list< std::string > getAdminDatabaseRoles (const RepoToken *token)
 
std::string getNameOfAdminDatabase (const RepoToken *token)
 
std::list< std::string > getStandardDatabaseRoles (const RepoToken *token)
 
void cleanUp (const RepoToken *token, const std::string &dbName, const std::string &projectName)
 
repo::core::model::RepoScenefetchScene (const RepoToken *token, const std::string &database, const std::string &project, const std::string &uuid=REPO_HISTORY_MASTER_BRANCH, const bool &headRevision=true, const bool &lightFetch=false)
 
void saveOriginalFiles (const RepoToken *token, const repo::core::model::RepoScene *scene, const std::string &directory)
 
void saveOriginalFiles (const RepoToken *token, const std::string &database, const std::string &project, const std::string &directory)
 
bool commitScene (const RepoToken *token, repo::core::model::RepoScene *scene, const std::string &owner="", const std::string &tag="", const std::string &desc="")
 
void insertBinaryFileToDatabase (const RepoToken *token, const std::string &database, const std::string &collection, const std::string &name, const std::vector< uint8_t > &rawData, const std::string &mimeType="")
 
void insertRole (const RepoToken *token, const repo::core::model::RepoRole &role)
 
void insertUser (const RepoToken *token, const repo::core::model::RepoUser &user)
 
bool removeCollection (const RepoToken *token, const std::string &databaseName, const std::string &collectionName, std::string &errMsg)
 
bool removeDatabase (const RepoToken *token, const std::string &databaseName, std::string &errMsg)
 
void removeDocument (const RepoToken *token, const std::string &databaseName, const std::string &collectionName, const repo::core::model::RepoBSON &bson)
 
bool removeProject (const RepoToken *token, const std::string &databaseName, const std::string &projectName, std::string &errMsg)
 
void removeProjectSettings (const RepoToken *token, const std::string &database, const repo::core::model::RepoProjectSettings &projectSettings)
 
void removeRoleSettings (const RepoToken *token, const std::string &database, const repo::core::model::RepoRoleSettings &roleSettings)
 
void removeRoleSettings (const RepoToken *token, const repo::core::model::RepoRole &role, const repo::core::model::RepoRoleSettings &settings)
 
void removeRole (const RepoToken *token, const repo::core::model::RepoRole &role)
 
void removeUser (const RepoToken *token, const repo::core::model::RepoUser &user)
 
void updateRole (const RepoToken *token, const repo::core::model::RepoRole &role)
 
void updateUser (const RepoToken *token, const repo::core::model::RepoUser &user)
 
void upsertDocument (const RepoToken *token, const std::string &databaseName, const std::string &collectionName, const repo::core::model::RepoBSON &bson)
 
void upsertRoleSettings (const RepoToken *token, const std::string &database, const repo::core::model::RepoRoleSettings &roleSettings)
 
void upsertRoleSettings (const RepoToken *token, const repo::core::model::RepoRole &role, const repo::core::model::RepoRoleSettings &settings)
 
void upsertProjectSettings (const RepoToken *token, const std::string &database, const repo::core::model::RepoProjectSettings &projectSettings)
 
void setLoggingLevel (const repo::lib::RepoLog::RepoLogLevel &level)
 
void logToFile (const std::string &filePath)
 
repo::core::model::RepoScenecreateFederatedScene (const std::map< repo::core::model::TransformationNode, repo::core::model::ReferenceNode > &fedMap)
 
repo::core::model::RepoScenecreateMapScene (const repo::core::model::MapNode &mapNode)
 
bool generateAndCommitGLTFBuffer (const RepoToken *token, repo::core::model::RepoScene *scene)
 
bool generateAndCommitSRCBuffer (const RepoToken *token, repo::core::model::RepoScene *scene)
 
repo_web_buffers_t generateGLTFBuffer (repo::core::model::RepoScene *scene)
 
bool generateAndCommitSelectionTree (const RepoToken *token, repo::core::model::RepoScene *scene)
 
repo_web_buffers_t generateSRCBuffer (repo::core::model::RepoScene *scene)
 
std::string getSupportedExportFormats ()
 
std::string getSupportedImportFormats ()
 
repo::core::model::RepoSceneloadSceneFromFile (const std::string &filePath, const bool &applyReduction=true, const bool &rotateModel=false, const repo::manipulator::modelconvertor::ModelImportConfig *config=nullptr)
 
repo::core::model::RepoNodeSet loadMetadataFromFile (const std::string &filePath, const char &delimiter= ',')
 
bool saveSceneToFile (const std::string &filePath, const repo::core::model::RepoScene *scene)
 
bool generateAndCommitStashGraph (const RepoToken *token, repo::core::model::RepoScene *scene)
 
std::shared_ptr< repo_partitioning_tree_tgetScenePartitioning (const repo::core::model::RepoScene *scene, const uint32_t &maxDepth=8)
 
void reduceTransformations (const RepoToken *token, repo::core::model::RepoScene *scene)
 
void compareScenes (const RepoToken *token, repo::core::model::RepoScene *base, repo::core::model::RepoScene *compare, repo_diff_result_t &baseResults, repo_diff_result_t &compResults, const repo::DiffMode &diffMode)
 
void compareScenesByIDs (const RepoToken *token, repo::core::model::RepoScene *base, repo::core::model::RepoScene *compare, repo_diff_result_t &baseResults, repo_diff_result_t &compResults)
 
void compareScenesByNames (const RepoToken *token, repo::core::model::RepoScene *base, repo::core::model::RepoScene *compare, repo_diff_result_t &baseResults, repo_diff_result_t &compResults)
 
std::string getVersion ()
 

Constructor & Destructor Documentation

RepoController::RepoController ( std::vector< lib::RepoAbstractListener * >  listeners = std::vector<lib::RepoAbstractListener *>(),
const uint32_t &  numConcurrentOps = 1,
const uint32_t &  numDbConn = 1 
)

Constructor

Parameters
listenersa list of listeners subscribing to the log
numConcurrentOpsmaximum number of requests it can handle concurrently
numDBConnnumber of concurrent connections to the database
RepoController::~RepoController ( )

Destructor

Member Function Documentation

void RepoController::addAlias ( RepoController::RepoToken token,
const std::string &  alias 
)

Add an alias to the repo token

Parameters
tokentokeng
aliasalias to add
RepoController::RepoToken * RepoController::authenticateMongo ( std::string &  errMsg,
const std::string &  address,
const uint32_t &  port,
const std::string &  dbName,
const std::string &  username,
const std::string &  password,
const bool &  pwDigested = false 
)

Connect to a mongo database, authenticate by the admin database

Parameters
errMsgerror message if failed
addressaddress of the database
portport number
dbNamename of the database within mongo to connect to
usernameuser login name
passworduser password
pwDigestedis given password digested (default: false)
Returns
returns a void pointer to a token
bool RepoController::authenticateMongo ( std::string &  errMsg,
const RepoToken token 
)

Connect to a mongo database, authenticate by the admin database

Parameters
errMsgerror message if failed
tokenauthentication token
RepoController::RepoToken * RepoController::authenticateToAdminDatabaseMongo ( std::string &  errMsg,
const std::string &  address,
const int &  port,
const std::string &  username,
const std::string &  password,
const bool &  pwDigested = false 
)

Connect to a mongo database, authenticate by the admin database

Parameters
errMsgerror message if failed
addressaddress of the database
portport number
usernameuser login name
passworduser password
pwDigestedis given password digested (default: false)
Returns
returns a void pointer to a token
void RepoController::cleanUp ( const RepoToken token,
const std::string &  dbName,
const std::string &  projectName 
)

Clean up any incomplete commits within the project

Parameters
tokenrepo token to the database
dbNamename of the database
projectNamename of the project
bool RepoController::commitScene ( const RepoToken token,
repo::core::model::RepoScene scene,
const std::string &  owner = "",
const std::string &  tag = "",
const std::string &  desc = "" 
)

Commit a scene graph

Parameters
tokenAuthentication token
sceneRepoScene to commit
ownerspecify the owner of the scene (by default it is the user authorised to commit)
void RepoController::compareScenes ( const RepoToken token,
repo::core::model::RepoScene base,
repo::core::model::RepoScene compare,
repo_diff_result_t baseResults,
repo_diff_result_t compResults,
const repo::DiffMode &  diffMode 
)

Compare 2 scenes via IDs.

Parameters
tokento load full scene from database if required (if not required, a nullptr can be passed in)
basebase scene to compare against
comparescene to compare base scene against
baseResultsDiff results in the perspective of base
compResultsDiff results in the perspective of compare
repo::DiffModemode to use on comparison
void repo::RepoController::compareScenesByIDs ( const RepoToken token,
repo::core::model::RepoScene base,
repo::core::model::RepoScene compare,
repo_diff_result_t baseResults,
repo_diff_result_t compResults 
)
inline

Compare 2 scenes via IDs.

Parameters
tokento load full scene from database if required (if not required, a nullptr can be passed in)
basebase scene to compare against
comparescene to compare base scene against
baseResultsDiff results in the perspective of base
compResultsDiff results in the perspective of compare
void repo::RepoController::compareScenesByNames ( const RepoToken token,
repo::core::model::RepoScene base,
repo::core::model::RepoScene compare,
repo_diff_result_t baseResults,
repo_diff_result_t compResults 
)
inline

Compare 2 scenes via Names.

Parameters
tokento load full scene from database if required (if not required, a nullptr can be passed in)
basebase scene to compare against
comparescene to compare base scene against
baseResultsDiff results in the perspective of base
compResultsDiff results in the perspective of compare
uint64_t RepoController::countItemsInCollection ( const RepoToken token,
const std::string &  database,
const std::string &  collection 
)

Count the number of documents within the collection

Parameters
tokenA RepoToken given at authentication
databasename of database
collectionname of collection
Returns
number of documents within the specified collection
repo::core::model::RepoScene * RepoController::createFederatedScene ( const std::map< repo::core::model::TransformationNode, repo::core::model::ReferenceNode > &  fedMap)

Create a federated scene with the given scene collections

Parameters
fedMapa map of reference scene and transformation from root where the scene should lie
Returns
returns a constructed scene graph with the reference.
repo::core::model::RepoScene * RepoController::createMapScene ( const repo::core::model::MapNode mapNode)

Create a create a map scene with the given map node This is essentially a scene creation with a trans node (identity matrix) and the map

Parameters
mapNodethe map node to create the scene with
Returns
returns a constructed scene graph with the reference.
RepoController::RepoToken * RepoController::createToken ( const std::string &  alias,
const std::string &  address,
const int &  port,
const std::string &  dbName,
const std::string &  username,
const std::string &  password 
)

create a token base on the information given

RepoController::RepoToken * RepoController::createTokenFromSerialised ( const std::string &  data) const

Re-create a repo token given the serialised data

Parameters
dataserialised data from serialiseToken()
Returns
returns RepoToken upon success
void RepoController::destroyToken ( RepoController::RepoToken token)

Destroy token from memory

Parameters
tokentoken to destroy
void RepoController::disconnectFromDatabase ( const RepoToken token)

Disconnect the controller from a database connection and destroys the token FIXME: CURRENTLY NOT THREAD SAFE! POTENTIALLY DANGEROUS

Parameters
tokentoken to the database
repo::core::model::RepoScene * RepoController::fetchScene ( const RepoToken token,
const std::string &  database,
const std::string &  project,
const std::string &  uuid = REPO_HISTORY_MASTER_BRANCH,
const bool &  headRevision = true,
const bool &  lightFetch = false 
)

Retrieve a RepoScene with a specific revision loaded.

Parameters
tokenAuthentication token
databasethe database the collection resides in
projectname of the project
uuidif headRevision, uuid represents the branch id, otherwise the unique id of the revision branch
headRevisiontrue if retrieving head revision
lightFetchfetches only the stash (or scene if stash failed), reduce computation and memory usage (ideal for visualisation)
Returns
returns a pointer to a repoScene.
bool RepoController::generateAndCommitGLTFBuffer ( const RepoToken token,
repo::core::model::RepoScene scene 
)

Generate and commit a GLTF encoding for the given scene This requires the stash to have been generated already

Parameters
tokentoken for authentication
scenethe scene to generate the gltf encoding from
Returns
returns true upon success
bool RepoController::generateAndCommitSelectionTree ( const RepoToken token,
repo::core::model::RepoScene scene 
)

Generate and commit a selection tree for the given scene

Parameters
tokentoken for authentication
scenethe scene to generate from
Returns
returns true upon success
bool RepoController::generateAndCommitSRCBuffer ( const RepoToken token,
repo::core::model::RepoScene scene 
)

Generate and commit a SRC encoding for the given scene This requires the stash to have been generated already

Parameters
tokentoken for authentication
scenethe scene to generate the src encoding from
Returns
returns true upon success
bool RepoController::generateAndCommitStashGraph ( const RepoToken token,
repo::core::model::RepoScene scene 
)

Generate and commit stash graph (multipart viewing graph) The generated graph will be added into the scene provided also commited to the database/project set within the scene

Parameters
tokendatabase token
scenescene to optimise
returntrue upon success
repo_web_buffers_t RepoController::generateGLTFBuffer ( repo::core::model::RepoScene scene)

Generate a GLTF encoding in the form of a buffer for the given scene This requires the stash to have been generated already

Parameters
scenethe scene to generate the gltf encoding from
Returns
returns a buffer in the form of a byte vector
repo_web_buffers_t RepoController::generateSRCBuffer ( repo::core::model::RepoScene scene)

Generate a SRC encoding in the form of a buffer for the given scene This requires the stash to have been generated already

Parameters
scenethe scene to generate the src encoding from
Returns
returns a buffer in the form of a byte vector
std::list< std::string > RepoController::getAdminDatabaseRoles ( const RepoToken token)

Get a list of Admin roles from the database

Parameters
tokenrepo token to the database
Returns
returns a vector of roles
std::vector< repo::core::model::RepoBSON > RepoController::getAllFromCollectionContinuous ( const RepoToken token,
const std::string &  database,
const std::string &  collection,
const uint64_t &  skip = 0,
const uint32_t &  limit = 0 
)

Retrieve documents from a specified collection due to limitations of the transfer protocol this might need to be called multiple times, utilising the skip index to skip the first n items.

Parameters
tokenA RepoToken given at authentication
databasename of database
collectionname of collection
skipspecify how many documents to skip
limitspecifiy max. number of documents to retrieve (0 = no limit)
Returns
list of RepoBSONs representing the documents
std::vector< repo::core::model::RepoBSON > RepoController::getAllFromCollectionContinuous ( const RepoToken token,
const std::string &  database,
const std::string &  collection,
const std::list< std::string > &  fields,
const std::string &  sortField,
const int &  sortOrder = -1,
const uint64_t &  skip = 0,
const uint32_t &  limit = 0 
)

Retrieve documents from a specified collection, returning only the specified fields due to limitations of the transfer protocol this might need to be called multiple times, utilising the skip index to skip the first n items.

Parameters
tokenA RepoToken given at authentication
databasename of database
collectionname of collection
fieldsfields to get back from the database
sortFieldfield to sort upon
sortOrder1 ascending, -1 descending
skipspecify how many documents to skip (see description above)
limitspecifiy max. number of documents to retrieve (0 = no limit)
Returns
list of RepoBSONs representing the documents
std::list< std::string > RepoController::getCollections ( const RepoToken token,
const std::string &  databaseName 
)

Return a list of collections within the database

Parameters
tokenA RepoToken given at authentication
databaseNamedatabase to get collections from
Returns
returns a list of collection names
repo::core::model::CollectionStats RepoController::getCollectionStats ( const RepoToken token,
const std::string &  database,
const std::string &  collection 
)

Return a CollectionStats BSON containing statistics about this collection

Parameters
tokenA RepoToken given at authentication
databasename of database
collectionname of collection
Returns
returns a BSON object containing this information
std::list< std::string > RepoController::getDatabases ( const RepoToken token)

Return a list of database available to the user

Parameters
tokenA RepoToken given at authentication
Returns
returns a list of database names
std::map< std::string, std::list< std::string > > RepoController::getDatabasesWithProjects ( const RepoToken token,
const std::list< std::string > &  databases 
)

Return a list of projects with the database available to the user

Parameters
tokenA RepoToken given at authentication
databaseslist of databases to look up
Returns
returns a list of database names
std::string RepoController::getHostAndPort ( const RepoToken token)

Return host:port of the database connection that is associated with the given token

Parameters
tokenrepo token
Returns
return a string with "databaseAddress:port"
std::string RepoController::getNameOfAdminDatabase ( const RepoToken token)

Get the name of the admin database

Parameters
tokenrepo token to the database
Returns
returns the name of the admin database
repo::core::model::RepoRoleSettings RepoController::getRoleSettings ( const RepoToken token,
const std::string &  database,
const std::string &  uniqueRoleName 
)

Get a role settings within a database

Parameters
tokenA RepoToken given at authentication
databasename of database
uniqueRoleNamename of the role to look for
std::vector< repo::core::model::RepoRoleSettings > RepoController::getRoleSettingsFromDatabase ( const RepoToken token,
const std::string &  database,
const uint64_t &  skip = 0,
const uint32_t &  limit = 0 
)

Get all role settings within a database

Parameters
tokenA RepoToken given at authentication
databasename of database
skipspecify how many documents to skip (see description above)
limitspecifiy max. number of documents to retrieve (0 = no limit)
std::vector< repo::core::model::RepoRole > RepoController::getRolesFromDatabase ( const RepoToken token,
const std::string &  database,
const uint64_t &  skip = 0,
const uint32_t &  limit = 0 
)

Retrieve roles from a specified database due to limitations of the transfer protocol this might need to be called multiple times, utilising the skip index to skip the first n items.

Parameters
tokenA RepoToken given at authentication
databasename of database
skipspecify how many documents to skip (see description above)
limitspecifiy max. number of documents to retrieve (0 = no limit)
Returns
list of RepoRole representing the roles
std::shared_ptr< repo_partitioning_tree_t > RepoController::getScenePartitioning ( const repo::core::model::RepoScene scene,
const uint32_t &  maxDepth = 8 
)

Get a hierachical spatial partitioning in form of a tree

Parameters
scenescene to partition
maxDepthmax partitioning depth
std::list< std::string > RepoController::getStandardDatabaseRoles ( const RepoToken token)

Get a list of standard roles from the database

Parameters
tokenrepo token to the database
Returns
returns a vector of roles
std::string RepoController::getSupportedExportFormats ( )

Get a string of supported file formats for file export

Returns
returns a string with list of supported file formats
std::string RepoController::getSupportedImportFormats ( )

Get a string of supported file formats for file import

Returns
returns a string with list of supported file formats
std::string RepoController::getVersion ( )

Get bouncer version in the form of a string

void RepoController::insertBinaryFileToDatabase ( const RepoToken token,
const std::string &  database,
const std::string &  collection,
const std::string &  name,
const std::vector< uint8_t > &  rawData,
const std::string &  mimeType = "" 
)

Insert a binary file into the database (GridFS)

Parameters
tokenAuthentication token
databasename of the database
collectionname of the collection (it'll be saved into *.files, *.chunks)
rawDatadata in the form of byte vector
mimeTypethe MIME type of the data (optional)
void RepoController::insertRole ( const RepoToken token,
const repo::core::model::RepoRole role 
)

Insert a new role into the database

Parameters
tokenAuthentication token
rolerole info to insert
void RepoController::insertUser ( const RepoToken token,
const repo::core::model::RepoUser user 
)

Insert a new user into the database

Parameters
tokenAuthentication token
useruser info to insert
repo::core::model::RepoNodeSet RepoController::loadMetadataFromFile ( const std::string &  filePath,
const char &  delimiter = ',' 
)

Load metadata from a file

Parameters
filePathpath to file
Returns
returns a set of metadata nodes read from the file
repo::core::model::RepoScene * RepoController::loadSceneFromFile ( const std::string &  filePath,
const bool &  applyReduction = true,
const bool &  rotateModel = false,
const repo::manipulator::modelconvertor::ModelImportConfig config = nullptr 
)

Load a Repo Scene from a file

Parameters
filePathpath to file
applytransformation reduction (default: true)
rotateModelrotate model by 270degrees on x (default: false)
configimport settings(optional)
Returns
returns a pointer to Repo Scene upon success
void RepoController::logToFile ( const std::string &  filePath)

Log to a specific file

Parameters
filePathpath to file
void RepoController::reduceTransformations ( const RepoToken token,
repo::core::model::RepoScene scene 
)

Reduce redundant transformations from the scene to optimise the graph

Parameters
tokento load full scene from database if required (if not required, a nullptr can be passed in)
sceneRepoScene to optimize
bool RepoController::removeCollection ( const RepoToken token,
const std::string &  databaseName,
const std::string &  collectionName,
std::string &  errMsg 
)

Remove a collection from the database

Parameters
tokenAuthentication token
databasethe database the collection resides in
collectionname of the collection to drop
errMsgerror message if failed
Returns
returns true upon success
bool RepoController::removeDatabase ( const RepoToken token,
const std::string &  databaseName,
std::string &  errMsg 
)

Remove a database

Parameters
tokenAuthentication token
databasethe database the collection resides in
errMsgerror message if failed
Returns
returns true upon success
void RepoController::removeDocument ( const RepoToken token,
const std::string &  databaseName,
const std::string &  collectionName,
const repo::core::model::RepoBSON bson 
)

remove a document from the database NOTE: this should never be called for a bson from RepoNode family as you should never remove a node from a scene graph like this.

Parameters
tokenAuthentication token
databasethe database the collection resides in
collectionname of the collection to drop
bsondocument to remove
bool RepoController::removeProject ( const RepoToken token,
const std::string &  databaseName,
const std::string &  projectName,
std::string &  errMsg 
)

Remove a project from the database This removes:

  1. all collections associated with the project,
  2. the project entry within project settings
  3. all privileges assigned to any roles, related to this project
    Parameters
    tokenAuthentication token
    databasename of the datbase
    nameof the project
    errMsgerror message if the operation fails
    Returns
    returns true upon success
void RepoController::removeRole ( const RepoToken token,
const repo::core::model::RepoRole role 
)

remove a user from the database

Parameters
tokenAuthentication token
rolerole to remove
void RepoController::removeUser ( const RepoToken token,
const repo::core::model::RepoUser user 
)

remove a user from the database

Parameters
tokenAuthentication token
useruser info to remove
void RepoController::saveOriginalFiles ( const RepoToken token,
const repo::core::model::RepoScene scene,
const std::string &  directory 
)

Save the files of the original model to a specified directory

Parameters
tokenAuthentication token
sceneRepo Scene to save
directorydirectory to save into
void RepoController::saveOriginalFiles ( const RepoToken token,
const std::string &  database,
const std::string &  project,
const std::string &  directory 
)

Save the original file of the head of the project into a specified directory

Parameters
tokenAuthentication token
databasename of database
projectname of project
directorydirectory to save into
bool RepoController::saveSceneToFile ( const std::string &  filePath,
const repo::core::model::RepoScene scene 
)

Save a Repo Scene to file

Parameters
filePathpath to file
scenescene to export
Returns
returns true upon success
std::string RepoController::serialiseToken ( const RepoToken token) const

Serialise the given token

Parameters
tokentoken
Returns
return the token in serialised form
void RepoController::setLoggingLevel ( const repo::lib::RepoLog::RepoLogLevel level)

Configure how verbose the log should be The levels of verbosity are: TRACE - log all messages DEBUG - log messages of level debug or above (use for debugging) INFO - log messages of level info or above (use to filter debugging messages but want informative logging) WARNING - log messages of level warning or above ERROR - log messages of level error or above FATAL - log messages of level fatal or above

Parameters
levelspecify logging level
bool RepoController::testConnection ( const RepoToken token)

Checks whether given credentials permit successful connection to a given database.

Parameters
tokentoken
Returns
returns true if successful, false otherwise
void RepoController::updateRole ( const RepoToken token,
const repo::core::model::RepoRole role 
)

Update a role on the database

Parameters
tokenAuthentication token
rolerole info to modify
void RepoController::updateUser ( const RepoToken token,
const repo::core::model::RepoUser user 
)

Update a user on the database

Parameters
tokenAuthentication token
useruser info to modify
void RepoController::upsertDocument ( const RepoToken token,
const std::string &  databaseName,
const std::string &  collectionName,
const repo::core::model::RepoBSON bson 
)

upsert a document in the database NOTE: this should never be called for a bson from RepoNode family as you should never update a node from a scene graph like this.

Parameters
tokenAuthentication token
databasethe database the collection resides in
collectionname of the collection
bsondocument to update/insert

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