LibreOffice Module dbaccess (master) 1
Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
dbaccess::ODatabaseContext Class Reference

#include <databasecontext.hxx>

Inheritance diagram for dbaccess::ODatabaseContext:
[legend]
Collaboration diagram for dbaccess::ODatabaseContext:
[legend]

Public Member Functions

 ODatabaseContext (const css::uno::Reference< css::uno::XComponentContext > &)
 
virtual ~ODatabaseContext () override
 
virtual void SAL_CALL disposing () override
 
virtual css::uno::Reference< css::uno::XInterface > SAL_CALL createInstance () override
 
virtual css::uno::Reference< css::uno::XInterface > SAL_CALL createInstanceWithArguments (const css::uno::Sequence< css::uno::Any > &_rArguments) override
 
virtual OUString SAL_CALL getImplementationName () override
 
virtual sal_Bool SAL_CALL supportsService (const OUString &ServiceName) override
 
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames () override
 
virtual css::uno::Type SAL_CALL getElementType () override
 
virtual sal_Bool SAL_CALL hasElements () override
 
virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration () override
 
virtual css::uno::Any SAL_CALL getByName (const OUString &aName) override
 
virtual css::uno::Sequence< OUString > SAL_CALL getElementNames () override
 
virtual sal_Bool SAL_CALL hasByName (const OUString &aName) override
 
virtual css::uno::Reference< css::uno::XInterface > SAL_CALL getRegisteredObject (const OUString &Name) override
 
virtual void SAL_CALL registerObject (const OUString &Name, const css::uno::Reference< css::uno::XInterface > &Object) override
 
virtual void SAL_CALL revokeObject (const OUString &Name) override
 
virtual sal_Bool SAL_CALL hasRegisteredDatabase (const OUString &Name) override
 
virtual css::uno::Sequence< OUString > SAL_CALL getRegistrationNames () override
 
virtual OUString SAL_CALL getDatabaseLocation (const OUString &Name) override
 
virtual void SAL_CALL registerDatabaseLocation (const OUString &Name, const OUString &Location) override
 
virtual void SAL_CALL revokeDatabaseLocation (const OUString &Name) override
 
virtual void SAL_CALL changeDatabaseLocation (const OUString &Name, const OUString &NewLocation) override
 
virtual sal_Bool SAL_CALL isDatabaseRegistrationReadOnly (const OUString &Name) override
 
virtual void SAL_CALL addDatabaseRegistrationsListener (const css::uno::Reference< css::sdb::XDatabaseRegistrationsListener > &Listener) override
 
virtual void SAL_CALL removeDatabaseRegistrationsListener (const css::uno::Reference< css::sdb::XDatabaseRegistrationsListener > &Listener) override
 
virtual void SAL_CALL addContainerListener (const css::uno::Reference< css::container::XContainerListener > &xListener) override
 
virtual void SAL_CALL removeContainerListener (const css::uno::Reference< css::container::XContainerListener > &xListener) override
 
void registerDatabaseDocument (ODatabaseModelImpl &_rModelImpl)
 
void revokeDatabaseDocument (const ODatabaseModelImpl &_rModelImpl)
 
void databaseDocumentURLChange (const OUString &_sOldName, const OUString &_sNewName)
 
void storeTransientProperties (ODatabaseModelImpl &_rModelImpl)
 
void appendAtTerminateListener (const ODatabaseModelImpl &_rDataSourceModel)
 
void removeFromTerminateListener (const ODatabaseModelImpl &_rDataSourceModel)
 
virtual void onBasicManagerCreated (const css::uno::Reference< css::frame::XModel > &_rxForDocument, BasicManager &_rBasicManager)=0
 

Private Types

typedef std::map< OUString, ODatabaseModelImpl * > ObjectCache
 
typedef std::map< OUString, css::uno::Sequence< css::beans::PropertyValue > > PropertyCache
 

Private Member Functions

css::uno::Reference< css::uno::XInterface > loadObjectFromURL (const OUString &_rName, const OUString &_sURL)
 loads the given object from the given URL More...
 
css::uno::Reference< css::uno::XInterface > getObject (const OUString &_rURL)
 
void setTransientProperties (const OUString &_sURL, ODatabaseModelImpl &_rDataSourceModel)
 sets all properties which were transient at the data source. More...
 
css::uno::Reference< css::uno::XInterface > impl_createNewDataSource ()
 creates a new data source More...
 
virtual void onBasicManagerCreated (const css::uno::Reference< css::frame::XModel > &_rxForDocument, BasicManager &_rBasicManager) override
 

Private Attributes

::osl::Mutex m_aMutex
 
css::uno::Reference< css::uno::XComponentContext > m_aContext
 
css::uno::Reference< css::uno::XAggregation > m_xDBRegistrationAggregate
 
css::uno::Reference< css::sdb::XDatabaseRegistrations > m_xDatabaseRegistrations
 
ObjectCache m_aDatabaseObjects
 
PropertyCache m_aDatasourceProperties
 
::comphelper::OInterfaceContainerHelper3< css::container::XContainerListener > m_aContainerListeners
 
rtl::Reference< DatabaseDocumentLoaderm_xDatabaseDocumentLoader
 

Additional Inherited Members

- Protected Member Functions inherited from basic::BasicManagerCreationListener
 ~BasicManagerCreationListener ()
 

Detailed Description

Definition at line 59 of file databasecontext.hxx.

Member Typedef Documentation

◆ ObjectCache

Definition at line 94 of file databasecontext.hxx.

◆ PropertyCache

typedef std::map< OUString, css::uno::Sequence< css::beans::PropertyValue > > dbaccess::ODatabaseContext::PropertyCache
private

Definition at line 97 of file databasecontext.hxx.

Constructor & Destructor Documentation

◆ ODatabaseContext()

dbaccess::ODatabaseContext::ODatabaseContext ( const css::uno::Reference< css::uno::XComponentContext > &  )
explicit

◆ ~ODatabaseContext()

dbaccess::ODatabaseContext::~ODatabaseContext ( )
overridevirtual

Member Function Documentation

◆ addContainerListener()

void SAL_CALL dbaccess::ODatabaseContext::addContainerListener ( const css::uno::Reference< css::container::XContainerListener > &  xListener)
overridevirtual

◆ addDatabaseRegistrationsListener()

void SAL_CALL dbaccess::ODatabaseContext::addDatabaseRegistrationsListener ( const css::uno::Reference< css::sdb::XDatabaseRegistrationsListener > &  Listener)
overridevirtual

Definition at line 571 of file databasecontext.cxx.

References m_xDatabaseRegistrations.

◆ appendAtTerminateListener()

void dbaccess::ODatabaseContext::appendAtTerminateListener ( const ODatabaseModelImpl _rDataSourceModel)

◆ changeDatabaseLocation()

void SAL_CALL dbaccess::ODatabaseContext::changeDatabaseLocation ( const OUString &  Name,
const OUString &  NewLocation 
)
overridevirtual

Definition at line 561 of file databasecontext.cxx.

References m_xDatabaseRegistrations, and Name.

◆ createEnumeration()

Reference< css::container::XEnumeration > dbaccess::ODatabaseContext::createEnumeration ( )
overridevirtual

Definition at line 596 of file databasecontext.cxx.

References m_aMutex.

◆ createInstance()

Reference< XInterface > SAL_CALL dbaccess::ODatabaseContext::createInstance ( )
overridevirtual

Definition at line 225 of file databasecontext.cxx.

References impl_createNewDataSource().

◆ createInstanceWithArguments()

Reference< XInterface > SAL_CALL dbaccess::ODatabaseContext::createInstanceWithArguments ( const css::uno::Sequence< css::uno::Any > &  _rArguments)
overridevirtual

◆ databaseDocumentURLChange()

void dbaccess::ODatabaseContext::databaseDocumentURLChange ( const OUString &  _sOldName,
const OUString &  _sNewName 
)

◆ disposing()

void dbaccess::ODatabaseContext::disposing ( )
overridevirtual

◆ getByName()

Any dbaccess::ODatabaseContext::getByName ( const OUString &  aName)
overridevirtual

◆ getDatabaseLocation()

OUString SAL_CALL dbaccess::ODatabaseContext::getDatabaseLocation ( const OUString &  Name)
overridevirtual

Definition at line 546 of file databasecontext.cxx.

References m_xDatabaseRegistrations, and Name.

Referenced by getByName(), getRegisteredObject(), and revokeObject().

◆ getElementNames()

Sequence< OUString > dbaccess::ODatabaseContext::getElementNames ( )
overridevirtual

Definition at line 652 of file databasecontext.cxx.

References getRegistrationNames(), and m_aMutex.

Referenced by hasElements().

◆ getElementType()

Type dbaccess::ODatabaseContext::getElementType ( )
overridevirtual

Definition at line 582 of file databasecontext.cxx.

References cppu::UnoType< typename T >::get().

◆ getImplementationName()

OUString dbaccess::ODatabaseContext::getImplementationName ( )
overridevirtual

Definition at line 202 of file databasecontext.cxx.

◆ getObject()

Reference< XInterface > dbaccess::ODatabaseContext::getObject ( const OUString &  _rURL)
private

Definition at line 668 of file databasecontext.cxx.

References m_aDatabaseObjects.

Referenced by createInstanceWithArguments(), getByName(), and getRegisteredObject().

◆ getRegisteredObject()

Reference< XInterface > dbaccess::ODatabaseContext::getRegisteredObject ( const OUString &  Name)
overridevirtual

Definition at line 268 of file databasecontext.cxx.

References getDatabaseLocation(), getObject(), loadObjectFromURL(), and m_aMutex.

◆ getRegistrationNames()

Sequence< OUString > SAL_CALL dbaccess::ODatabaseContext::getRegistrationNames ( )
overridevirtual

Definition at line 541 of file databasecontext.cxx.

References m_xDatabaseRegistrations.

Referenced by getElementNames().

◆ getSupportedServiceNames()

Sequence< OUString > dbaccess::ODatabaseContext::getSupportedServiceNames ( )
overridevirtual

Definition at line 212 of file databasecontext.cxx.

◆ hasByName()

sal_Bool dbaccess::ODatabaseContext::hasByName ( const OUString &  aName)
overridevirtual

Definition at line 660 of file databasecontext.cxx.

References hasRegisteredDatabase(), and m_aMutex.

◆ hasElements()

sal_Bool dbaccess::ODatabaseContext::hasElements ( )
overridevirtual

Definition at line 587 of file databasecontext.cxx.

References getElementNames(), and m_aMutex.

◆ hasRegisteredDatabase()

sal_Bool SAL_CALL dbaccess::ODatabaseContext::hasRegisteredDatabase ( const OUString &  Name)
overridevirtual

Definition at line 536 of file databasecontext.cxx.

References m_xDatabaseRegistrations, and Name.

Referenced by getByName(), and hasByName().

◆ impl_createNewDataSource()

Reference< XInterface > dbaccess::ODatabaseContext::impl_createNewDataSource ( )
private

creates a new data source

Definition at line 217 of file databasecontext.cxx.

References m_aContext.

Referenced by createInstance(), and createInstanceWithArguments().

◆ isDatabaseRegistrationReadOnly()

sal_Bool SAL_CALL dbaccess::ODatabaseContext::isDatabaseRegistrationReadOnly ( const OUString &  Name)
overridevirtual

Definition at line 566 of file databasecontext.cxx.

References m_xDatabaseRegistrations, and Name.

◆ loadObjectFromURL()

Reference< XInterface > dbaccess::ODatabaseContext::loadObjectFromURL ( const OUString &  _rName,
const OUString &  _sURL 
)
private

◆ onBasicManagerCreated()

void dbaccess::ODatabaseContext::onBasicManagerCreated ( const css::uno::Reference< css::frame::XModel > &  _rxForDocument,
BasicManager _rBasicManager 
)
overrideprivatevirtual

◆ registerDatabaseDocument()

void dbaccess::ODatabaseContext::registerDatabaseDocument ( ODatabaseModelImpl _rModelImpl)

◆ registerDatabaseLocation()

void SAL_CALL dbaccess::ODatabaseContext::registerDatabaseLocation ( const OUString &  Name,
const OUString &  Location 
)
overridevirtual

Definition at line 551 of file databasecontext.cxx.

References m_xDatabaseRegistrations, and Name.

Referenced by registerObject().

◆ registerObject()

void dbaccess::ODatabaseContext::registerObject ( const OUString &  Name,
const css::uno::Reference< css::uno::XInterface > &  Object 
)
overridevirtual

◆ removeContainerListener()

void SAL_CALL dbaccess::ODatabaseContext::removeContainerListener ( const css::uno::Reference< css::container::XContainerListener > &  xListener)
overridevirtual

◆ removeDatabaseRegistrationsListener()

void SAL_CALL dbaccess::ODatabaseContext::removeDatabaseRegistrationsListener ( const css::uno::Reference< css::sdb::XDatabaseRegistrationsListener > &  Listener)
overridevirtual

Definition at line 576 of file databasecontext.cxx.

References m_xDatabaseRegistrations.

◆ removeFromTerminateListener()

void dbaccess::ODatabaseContext::removeFromTerminateListener ( const ODatabaseModelImpl _rDataSourceModel)

Definition at line 385 of file databasecontext.cxx.

References m_xDatabaseDocumentLoader.

Referenced by dbaccess::ODatabaseModelImpl::release().

◆ revokeDatabaseDocument()

void dbaccess::ODatabaseContext::revokeDatabaseDocument ( const ODatabaseModelImpl _rModelImpl)

◆ revokeDatabaseLocation()

void SAL_CALL dbaccess::ODatabaseContext::revokeDatabaseLocation ( const OUString &  Name)
overridevirtual

Definition at line 556 of file databasecontext.cxx.

References m_xDatabaseRegistrations, and Name.

Referenced by revokeObject().

◆ revokeObject()

void dbaccess::ODatabaseContext::revokeObject ( const OUString &  Name)
overridevirtual

◆ setTransientProperties()

void dbaccess::ODatabaseContext::setTransientProperties ( const OUString &  _sURL,
ODatabaseModelImpl _rDataSourceModel 
)
private

sets all properties which were transient at the data source.

e.g. password

Parameters
_sURLThe file URL of the data source
_xObjectThe data source itself.

Definition at line 390 of file databasecontext.cxx.

References DBG_UNHANDLED_EXCEPTION, Exception, dbaccess::ODatabaseModelImpl::getOrCreateDataSource(), m_aDatasourceProperties, and dbaccess::ODatabaseModelImpl::m_sFailedPassword.

Referenced by loadObjectFromURL(), and registerDatabaseDocument().

◆ storeTransientProperties()

void dbaccess::ODatabaseContext::storeTransientProperties ( ODatabaseModelImpl _rModelImpl)

◆ supportsService()

sal_Bool dbaccess::ODatabaseContext::supportsService ( const OUString &  ServiceName)
overridevirtual

Definition at line 207 of file databasecontext.cxx.

References cppu::supportsService().

Member Data Documentation

◆ m_aContainerListeners

::comphelper::OInterfaceContainerHelper3<css::container::XContainerListener> dbaccess::ODatabaseContext::m_aContainerListeners
private

◆ m_aContext

css::uno::Reference< css::uno::XComponentContext > dbaccess::ODatabaseContext::m_aContext
private

◆ m_aDatabaseObjects

ObjectCache dbaccess::ODatabaseContext::m_aDatabaseObjects
private

◆ m_aDatasourceProperties

PropertyCache dbaccess::ODatabaseContext::m_aDatasourceProperties
private

◆ m_aMutex

::osl::Mutex dbaccess::ODatabaseContext::m_aMutex
private

◆ m_xDatabaseDocumentLoader

rtl::Reference<DatabaseDocumentLoader> dbaccess::ODatabaseContext::m_xDatabaseDocumentLoader
private

◆ m_xDatabaseRegistrations

css::uno::Reference< css::sdb::XDatabaseRegistrations > dbaccess::ODatabaseContext::m_xDatabaseRegistrations
private

◆ m_xDBRegistrationAggregate

css::uno::Reference< css::uno::XAggregation > dbaccess::ODatabaseContext::m_xDBRegistrationAggregate
private

Definition at line 90 of file databasecontext.hxx.

Referenced by ODatabaseContext(), and ~ODatabaseContext().


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