Mantid
|
This class is a singleton and is responsible for creating, destroying, and managing catalogs. More...
#include <CatalogManager.h>
Public Member Functions | |
CatalogManagerImpl (const CatalogManagerImpl &)=delete | |
void | destroyCatalog (const std::string &sessionID) |
Destroy a specific catalog (if session provided), otherwise destroys all active catalogs. More... | |
std::vector< CatalogSession_sptr > | getActiveSessions () |
Obtains a list of the current active catalog sessions. More... | |
ICatalog_sptr | getCatalog (const std::string &sessionID) |
Get a specific catalog using the sessionID. More... | |
CatalogSession_sptr | login (const std::string &username, const std::string &password, const std::string &endpoint, const std::string &facility) |
Creates a new catalog and session, and adds it to the activeCatalogs container. More... | |
size_t | numberActiveSessions () const |
Returns the number of active sessions. More... | |
CatalogManagerImpl & | operator= (const CatalogManagerImpl &)=delete |
Private Member Functions | |
CatalogManagerImpl ()=default | |
virtual | ~CatalogManagerImpl ()=default |
Private Attributes | |
std::map< CatalogSession_sptr, ICatalog_sptr > | m_activeCatalogs |
Friends | |
struct | Kernel::CreateUsingNew< CatalogManagerImpl > |
These methods are required to create a singleton. More... | |
This class is a singleton and is responsible for creating, destroying, and managing catalogs.
Definition at line 24 of file CatalogManager.h.
|
delete |
|
privatedefault |
|
privatevirtualdefault |
void Mantid::API::CatalogManagerImpl::destroyCatalog | ( | const std::string & | sessionID | ) |
Destroy a specific catalog (if session provided), otherwise destroys all active catalogs.
Destroy and remove a specific catalog from the active catalogs list and the composite catalog.
If sessionID is empty then all catalogs are removed from the active catalogs list.
sessionID | :: The session to search for in the active catalogs list. |
Definition at line 76 of file CatalogManager.cpp.
References m_activeCatalogs.
std::vector< CatalogSession_sptr > Mantid::API::CatalogManagerImpl::getActiveSessions | ( | ) |
Obtains a list of the current active catalog sessions.
Definition at line 97 of file CatalogManager.cpp.
References m_activeCatalogs.
ICatalog_sptr Mantid::API::CatalogManagerImpl::getCatalog | ( | const std::string & | sessionID | ) |
Get a specific catalog using the sessionID.
Obtain a specific catalog using the sessionID, otherwise return all active catalogs.
sessionID | :: The session to search for in the active catalogs list. |
Definition at line 46 of file CatalogManager.cpp.
References m_activeCatalogs.
CatalogSession_sptr Mantid::API::CatalogManagerImpl::login | ( | const std::string & | username, |
const std::string & | password, | ||
const std::string & | endpoint, | ||
const std::string & | facility | ||
) |
Creates a new catalog and session, and adds it to the activeCatalogs container.
Logs the user into the catalog if session details are valid.
This is used here as we need to obtain the session for a specific catalog (e.g. the one created on login).
username | :: The login name of the user. |
password | :: The password of the user. |
endpoint | :: The endpoint url of the catalog to log in to. |
facility | :: The facility of the catalog to log in to. |
Definition at line 28 of file CatalogManager.cpp.
References Mantid::Kernel::SingletonHolder< T >::Instance(), and m_activeCatalogs.
size_t Mantid::API::CatalogManagerImpl::numberActiveSessions | ( | ) | const |
Returns the number of active sessions.
Definition at line 107 of file CatalogManager.cpp.
References m_activeCatalogs.
Referenced by export_CatalogManager().
|
delete |
|
friend |
These methods are required to create a singleton.
Definition at line 40 of file CatalogManager.h.
|
private |
Definition at line 50 of file CatalogManager.h.
Referenced by destroyCatalog(), getActiveSessions(), getCatalog(), login(), and numberActiveSessions().