LibreOffice Module dbaccess (master) 1
Classes | Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
dbaccess::ODatabaseSource Class Reference

#include <datasource.hxx>

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

Classes

struct  DBContextAccess
 

Public Member Functions

 ODatabaseSource (const ::rtl::Reference< ODatabaseModelImpl > &_pImpl)
 
virtual void SAL_CALL elementInserted (const css::container::ContainerEvent &Event) override
 
virtual void SAL_CALL elementRemoved (const css::container::ContainerEvent &Event) override
 
virtual void SAL_CALL elementReplaced (const css::container::ContainerEvent &Event) override
 
virtual css::uno::Reference< css::container::XNameAccess > SAL_CALL getTables () override
 
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes () override
 
virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId () override
 
virtual css::uno::Any SAL_CALL queryInterface (const css::uno::Type &rType) override
 
virtual void SAL_CALL acquire () noexcept override
 
virtual void SAL_CALL release () noexcept 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 void SAL_CALL disposing () override
 
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo () override
 
virtual void SAL_CALL disposing (const css::lang::EventObject &Source) override
 
virtual ::cppu::IPropertyArrayHelpercreateArrayHelper () const override
 
virtual ::cppu::IPropertyArrayHelper &SAL_CALL getInfoHelper () override
 
virtual sal_Bool SAL_CALL convertFastPropertyValue (css::uno::Any &rConvertedValue, css::uno::Any &rOldValue, sal_Int32 nHandle, const css::uno::Any &rValue) override
 
virtual void SAL_CALL setFastPropertyValue_NoBroadcast (sal_Int32 nHandle, const css::uno::Any &rValue) override
 
virtual void SAL_CALL getFastPropertyValue (css::uno::Any &rValue, sal_Int32 nHandle) const override
 
virtual css::uno::Reference< css::sdbc::XConnection > SAL_CALL connectWithCompletion (const css::uno::Reference< css::task::XInteractionHandler > &handler) override
 
virtual css::uno::Reference< css::sdbc::XConnection > SAL_CALL getConnection (const OUString &user, const OUString &password) override
 
virtual void SAL_CALL setLoginTimeout (sal_Int32 seconds) override
 
virtual sal_Int32 SAL_CALL getLoginTimeout () override
 
virtual css::uno::Reference< css::container::XNameAccess > SAL_CALL getBookmarks () override
 
virtual css::uno::Reference< css::container::XNameAccess > SAL_CALL getQueryDefinitions () override
 
virtual css::uno::Reference< css::sdbc::XConnection > SAL_CALL getIsolatedConnection (const OUString &user, const OUString &password) override
 
virtual css::uno::Reference< css::sdbc::XConnection > SAL_CALL getIsolatedConnectionWithCompletion (const css::uno::Reference< css::task::XInteractionHandler > &handler) override
 
virtual void SAL_CALL flush () override
 
virtual void SAL_CALL addFlushListener (const css::uno::Reference< css::util::XFlushListener > &l) override
 
virtual void SAL_CALL removeFlushListener (const css::uno::Reference< css::util::XFlushListener > &l) override
 
virtual void SAL_CALL flushed (const css::lang::EventObject &rEvent) override
 
virtual css::uno::Reference< css::sdb::XOfficeDatabaseDocument > SAL_CALL getDatabaseDocument () override
 
virtual void SAL_CALL initialize (const css::uno::Sequence< css::uno::Any > &aArguments) override
 
- Public Member Functions inherited from dbaccess::ModelDependentComponent
void checkDisposed () const
 checks whether the component is already disposed, throws a DisposedException if so More...
 
void lockModify ()
 
void unlockModify ()
 
- Public Member Functions inherited from cppu::OPropertySetHelper
 OPropertySetHelper (OBroadcastHelper &rBHelper)
 
 OPropertySetHelper (OBroadcastHelper &rBHelper, bool bIgnoreRuntimeExceptionsWhileFiring)
 
 OPropertySetHelper (OBroadcastHelper &rBHelper, IEventNotificationHook *i_pFireEvents, bool bIgnoreRuntimeExceptionsWhileFiring=false)
 
virtual css::uno::Any SAL_CALL queryInterface (const css::uno::Type &rType) SAL_OVERRIDE
 
css::uno::Sequence< css::uno::Type > getTypes ()
 
void SAL_CALL disposing ()
 
virtual void SAL_CALL setPropertyValue (const ::rtl::OUString &rPropertyName, const css::uno::Any &aValue) SAL_OVERRIDE
 
virtual css::uno::Any SAL_CALL getPropertyValue (const ::rtl::OUString &aPropertyName) SAL_OVERRIDE
 
virtual void SAL_CALL addPropertyChangeListener (const ::rtl::OUString &aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &aListener) SAL_OVERRIDE
 
virtual void SAL_CALL removePropertyChangeListener (const ::rtl::OUString &aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &aListener) SAL_OVERRIDE
 
virtual void SAL_CALL addVetoableChangeListener (const ::rtl::OUString &aPropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &aListener) SAL_OVERRIDE
 
virtual void SAL_CALL removeVetoableChangeListener (const ::rtl::OUString &aPropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &aListener) SAL_OVERRIDE
 
virtual void SAL_CALL setFastPropertyValue (sal_Int32 nHandle, const css::uno::Any &rValue) SAL_OVERRIDE
 
virtual css::uno::Any SAL_CALL getFastPropertyValue (sal_Int32 nHandle) SAL_OVERRIDE
 
virtual void SAL_CALL setPropertyValues (const css::uno::Sequence< ::rtl::OUString > &PropertyNames, const css::uno::Sequence< css::uno::Any > &Values) SAL_OVERRIDE
 
virtual css::uno::Sequence< css::uno::Any > SAL_CALL getPropertyValues (const css::uno::Sequence< ::rtl::OUString > &PropertyNames) SAL_OVERRIDE
 
virtual void SAL_CALL addPropertiesChangeListener (const css::uno::Sequence< ::rtl::OUString > &PropertyNames, const css::uno::Reference< css::beans::XPropertiesChangeListener > &Listener) SAL_OVERRIDE
 
virtual void SAL_CALL removePropertiesChangeListener (const css::uno::Reference< css::beans::XPropertiesChangeListener > &Listener) SAL_OVERRIDE
 
virtual void SAL_CALL firePropertiesChangeEvent (const css::uno::Sequence< ::rtl::OUString > &PropertyNames, const css::uno::Reference< css::beans::XPropertiesChangeListener > &Listener) SAL_OVERRIDE
 
- Public Member Functions inherited from comphelper::OPropertyArrayUsageHelper< ODatabaseSource >
 OPropertyArrayUsageHelper ()
 
virtual ~OPropertyArrayUsageHelper ()
 
::cppu::IPropertyArrayHelpergetArrayHelper ()
 

Static Public Member Functions

static void setName (const css::uno::Reference< css::sdb::XDocumentDataSource > &_rxDocument, const OUString &_rNewName, DBContextAccess)
 sets a new name for the data source More...
 
- Static Public Member Functions inherited from cppu::OPropertySetHelper
static css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL createPropertySetInfo (IPropertyArrayHelper &rProperties)
 

Protected Member Functions

virtual css::uno::Reference< css::uno::XInterface > getThis () const override
 returns the component itself More...
 
- Protected Member Functions inherited from dbaccess::ModelDependentComponent
 ModelDependentComponent (::rtl::Reference< ODatabaseModelImpl > _model)
 
virtual ~ModelDependentComponent ()
 
virtual css::uno::Reference< css::uno::XInterface > getThis () const =0
 returns the component itself More...
 
::osl::Mutex & getMutex ()
 
- Protected Member Functions inherited from cppu::OPropertySetHelper
void SAL_CALL fire (sal_Int32 *pnHandles, const css::uno::Any *pNewValues, const css::uno::Any *pOldValues, sal_Int32 nCount, sal_Bool bVetoable)
 
void SAL_CALL setFastPropertyValues (sal_Int32 nSeqLen, sal_Int32 *pHandles, const css::uno::Any *pValues, sal_Int32 nHitCount)
 
virtual IPropertyArrayHelper &SAL_CALL getInfoHelper ()=0
 
virtual sal_Bool SAL_CALL convertFastPropertyValue (css::uno::Any &rConvertedValue, css::uno::Any &rOldValue, sal_Int32 nHandle, const css::uno::Any &rValue)=0
 
virtual void SAL_CALL setFastPropertyValue_NoBroadcast (sal_Int32 nHandle, const css::uno::Any &rValue)=0
 
virtual void SAL_CALL getFastPropertyValue (css::uno::Any &rValue, sal_Int32 nHandle) const=0
 
void setDependentFastPropertyValue (sal_Int32 i_handle, const css::uno::Any &i_value)
 
 ~OPropertySetHelper ()
 
virtual ::cppu::IPropertyArrayHelpercreateArrayHelper () const =0
 

Private Member Functions

virtual ~ODatabaseSource () override
 
css::uno::Reference< css::sdbc::XConnection > buildLowLevelConnection (const OUString &_rUid, const OUString &_rPwd)
 open a connection for the current settings. More...
 
css::uno::Reference< css::sdbc::XConnection > buildIsolatedConnection (const OUString &user, const OUString &password)
 
css::uno::Reference< css::sdbc::XConnection > getConnection (const OUString &user, const OUString &password, bool _bIsolated)
 
css::uno::Reference< css::sdbc::XConnection > connectWithCompletion (const css::uno::Reference< css::task::XInteractionHandler > &handler, bool _bIsolated)
 

Private Attributes

OBookmarkContainer m_Bookmarks
 
::comphelper::OInterfaceContainerHelper3< css::util::XFlushListener > m_aFlushListeners
 

Friends

class ODatabaseContext
 
class OConnection
 
class OSharedConnectionManager
 

Additional Inherited Members

- Static Protected Member Functions inherited from comphelper::OPropertyArrayUsageHelper< ODatabaseSource >
static std::mutextheMutex ()
 
- Protected Attributes inherited from dbaccess::ModelDependentComponent
::rtl::Reference< ODatabaseModelImplm_pImpl
 
::osl::Mutex m_aMutex
 
- Protected Attributes inherited from cppu::OPropertySetHelper
OBroadcastHelperrBHelper
 
OMultiTypeInterfaceContainerHelperInt32 aBoundLC
 
OMultiTypeInterfaceContainerHelperInt32 aVetoableLC
 
Impl *const m_pReserved
 
- Static Protected Attributes inherited from comphelper::OPropertyArrayUsageHelper< ODatabaseSource >
static sal_Int32 s_nRefCount
 
::cppu::IPropertyArrayHelpers_pProps
 

Detailed Description

Definition at line 74 of file datasource.hxx.

Constructor & Destructor Documentation

◆ ~ODatabaseSource()

dbaccess::ODatabaseSource::~ODatabaseSource ( )
overrideprivatevirtual

◆ ODatabaseSource()

dbaccess::ODatabaseSource::ODatabaseSource ( const ::rtl::Reference< ODatabaseModelImpl > &  _pImpl)
explicit

Definition at line 476 of file datasource.cxx.

References getMutex(), dbaccess::ModelDependentComponent::m_pImpl, and SAL_INFO.

Member Function Documentation

◆ acquire()

void dbaccess::ODatabaseSource::acquire ( )
overridevirtualnoexcept

Definition at line 533 of file datasource.cxx.

Referenced by ~ODatabaseSource().

◆ addFlushListener()

void SAL_CALL dbaccess::ODatabaseSource::addFlushListener ( const css::uno::Reference< css::util::XFlushListener > &  l)
overridevirtual

◆ buildIsolatedConnection()

Reference< XConnection > dbaccess::ODatabaseSource::buildIsolatedConnection ( const OUString &  user,
const OUString &  password 
)
private

◆ buildLowLevelConnection()

Reference< XConnection > dbaccess::ODatabaseSource::buildLowLevelConnection ( const OUString &  _rUid,
const OUString &  _rPwd 
)
private

open a connection for the current settings.

this is the simple connection we get from the driver manager, so it can be used as a master for a "high level" sdb connection.

Definition at line 598 of file datasource.cxx.

References Any, DBA_RES, Exception, comphelper::NamedValueCollection::get(), getDatabaseDocument(), dbaccess::ODatabaseModelImpl::getDefaultDataSourceSettings(), Application::IsHeadlessModeEnabled(), dbaccess::ModelDependentComponent::m_pImpl, nCount, pData, RET_OK, weld::DialogController::run(), SAL_INFO, sMessage, throwGenericSQLException(), TOOLS_WARN_EXCEPTION, u, and xModel.

Referenced by buildIsolatedConnection().

◆ connectWithCompletion() [1/2]

virtual css::uno::Reference< css::sdbc::XConnection > SAL_CALL dbaccess::ODatabaseSource::connectWithCompletion ( const css::uno::Reference< css::task::XInteractionHandler > &  handler)
overridevirtual

◆ connectWithCompletion() [2/2]

css::uno::Reference< css::sdbc::XConnection > dbaccess::ODatabaseSource::connectWithCompletion ( const css::uno::Reference< css::task::XInteractionHandler > &  handler,
bool  _bIsolated 
)
private
Exceptions
css::sdbc::SQLException
css::uno::RuntimeException

◆ convertFastPropertyValue()

sal_Bool dbaccess::ODatabaseSource::convertFastPropertyValue ( css::uno::Any &  rConvertedValue,
css::uno::Any &  rOldValue,
sal_Int32  nHandle,
const css::uno::Any &  rValue 
)
overridevirtual

◆ createArrayHelper()

cppu::IPropertyArrayHelper * dbaccess::ODatabaseSource::createArrayHelper ( ) const
overridevirtual

◆ disposing() [1/2]

void dbaccess::ODatabaseSource::disposing ( )
overridevirtual

◆ disposing() [2/2]

void SAL_CALL dbaccess::ODatabaseSource::disposing ( const css::lang::EventObject &  Source)
overridevirtual

Definition at line 543 of file datasource.cxx.

References dbaccess::ModelDependentComponent::m_pImpl, and Source.

◆ elementInserted()

void SAL_CALL dbaccess::ODatabaseSource::elementInserted ( const css::container::ContainerEvent &  Event)
overridevirtual

Definition at line 1380 of file datasource.cxx.

References dbaccess::ModelDependentComponent::m_pImpl.

◆ elementRemoved()

void SAL_CALL dbaccess::ODatabaseSource::elementRemoved ( const css::container::ContainerEvent &  Event)
overridevirtual

Definition at line 1387 of file datasource.cxx.

References dbaccess::ModelDependentComponent::m_pImpl.

◆ elementReplaced()

void SAL_CALL dbaccess::ODatabaseSource::elementReplaced ( const css::container::ContainerEvent &  Event)
overridevirtual

Definition at line 1394 of file datasource.cxx.

References dbaccess::ModelDependentComponent::m_pImpl.

◆ flush()

void SAL_CALL dbaccess::ODatabaseSource::flush ( )
overridevirtual

◆ flushed()

void SAL_CALL dbaccess::ODatabaseSource::flushed ( const css::lang::EventObject &  rEvent)
overridevirtual

Definition at line 1338 of file datasource.cxx.

References dbaccess::ModelDependentComponent::m_pImpl.

◆ getBookmarks()

Reference< XNameAccess > SAL_CALL dbaccess::ODatabaseSource::getBookmarks ( )
overridevirtual

Definition at line 1259 of file datasource.cxx.

References m_Bookmarks.

◆ getConnection() [1/2]

Reference< XConnection > dbaccess::ODatabaseSource::getConnection ( const OUString &  user,
const OUString &  password 
)
overridevirtual

Definition at line 1112 of file datasource.cxx.

References getConnection().

Referenced by getConnection(), and getIsolatedConnection().

◆ getConnection() [2/2]

Reference< XConnection > dbaccess::ODatabaseSource::getConnection ( const OUString &  user,
const OUString &  password,
bool  _bIsolated 
)
private
Exceptions
css::sdbc::SQLException
css::uno::RuntimeException

Definition at line 1224 of file datasource.cxx.

References buildIsolatedConnection(), dbaccess::ModelDependentComponent::m_pImpl, manager, and OSharedConnectionManager.

◆ getDatabaseDocument()

Reference< XOfficeDatabaseDocument > SAL_CALL dbaccess::ODatabaseSource::getDatabaseDocument ( )
overridevirtual

Definition at line 1402 of file datasource.cxx.

References dbaccess::ModelDependentComponent::m_pImpl, and xModel.

Referenced by buildLowLevelConnection().

◆ getFastPropertyValue()

void dbaccess::ODatabaseSource::getFastPropertyValue ( css::uno::Any &  rValue,
sal_Int32  nHandle 
) const
overridevirtual

◆ getImplementationId()

Sequence< sal_Int8 > dbaccess::ODatabaseSource::getImplementationId ( )
overridevirtual

Definition at line 519 of file datasource.cxx.

◆ getImplementationName()

OUString dbaccess::ODatabaseSource::getImplementationName ( )
overridevirtual

Definition at line 550 of file datasource.cxx.

◆ getInfoHelper()

cppu::IPropertyArrayHelper & dbaccess::ODatabaseSource::getInfoHelper ( )
overridevirtual

◆ getIsolatedConnection()

Reference< XConnection > SAL_CALL dbaccess::ODatabaseSource::getIsolatedConnection ( const OUString &  user,
const OUString &  password 
)
overridevirtual

Definition at line 1117 of file datasource.cxx.

References getConnection().

◆ getIsolatedConnectionWithCompletion()

Reference< XConnection > SAL_CALL dbaccess::ODatabaseSource::getIsolatedConnectionWithCompletion ( const css::uno::Reference< css::task::XInteractionHandler > &  handler)
overridevirtual

Definition at line 1122 of file datasource.cxx.

References connectWithCompletion().

◆ getLoginTimeout()

sal_Int32 dbaccess::ODatabaseSource::getLoginTimeout ( )
overridevirtual

Definition at line 1100 of file datasource.cxx.

References dbaccess::ModelDependentComponent::m_pImpl.

◆ getPropertySetInfo()

Reference< XPropertySetInfo > dbaccess::ODatabaseSource::getPropertySetInfo ( )
overridevirtual

◆ getQueryDefinitions()

Reference< XNameAccess > SAL_CALL dbaccess::ODatabaseSource::getQueryDefinitions ( )
overridevirtual

◆ getSupportedServiceNames()

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

Definition at line 555 of file datasource.cxx.

References SERVICE_SDB_DATASOURCE.

◆ getTables()

Reference< XNameAccess > dbaccess::ODatabaseSource::getTables ( )
overridevirtual

◆ getThis()

Reference< XInterface > dbaccess::ODatabaseSource::getThis ( ) const
overrideprotectedvirtual

returns the component itself

Implements dbaccess::ModelDependentComponent.

Definition at line 1420 of file datasource.cxx.

◆ getTypes()

Sequence< Type > dbaccess::ODatabaseSource::getTypes ( )
overridevirtual

Definition at line 507 of file datasource.cxx.

◆ initialize()

void SAL_CALL dbaccess::ODatabaseSource::initialize ( const css::uno::Sequence< css::uno::Any > &  aArguments)
overridevirtual

Definition at line 1413 of file datasource.cxx.

References aProperties, and dbaccess::ModelDependentComponent::m_pImpl.

◆ queryInterface()

Any dbaccess::ODatabaseSource::queryInterface ( const css::uno::Type &  rType)
overridevirtual

Reimplemented from cppu::OPropertySetHelper.

Definition at line 525 of file datasource.cxx.

References Any, and cppu::OPropertySetHelper::queryInterface().

◆ release()

void dbaccess::ODatabaseSource::release ( )
overridevirtualnoexcept

Definition at line 538 of file datasource.cxx.

◆ removeFlushListener()

void SAL_CALL dbaccess::ODatabaseSource::removeFlushListener ( const css::uno::Reference< css::util::XFlushListener > &  l)
overridevirtual

◆ setFastPropertyValue_NoBroadcast()

void dbaccess::ODatabaseSource::setFastPropertyValue_NoBroadcast ( sal_Int32  nHandle,
const css::uno::Any &  rValue 
)
overridevirtual

◆ setLoginTimeout()

void dbaccess::ODatabaseSource::setLoginTimeout ( sal_Int32  seconds)
overridevirtual

Definition at line 1094 of file datasource.cxx.

References dbaccess::ModelDependentComponent::m_pImpl.

◆ setName()

void dbaccess::ODatabaseSource::setName ( const css::uno::Reference< css::sdb::XDocumentDataSource > &  _rxDocument,
const OUString &  _rNewName,
DBContextAccess   
)
static

sets a new name for the data source

The name of a data source (our m_sName member) is the registration name, if the data source actually is registered at the database context.

Normally, this name is passed at time of creation of the ODatabaseModelImpl instance, but if a newly created data source is registered, then it must be possible to propagate the new registration name.

Definition at line 497 of file datasource.cxx.

References dbaccess::ModelDependentComponent::m_pImpl.

Referenced by dbaccess::ODatabaseContext::registerObject().

◆ supportsService()

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

Definition at line 560 of file datasource.cxx.

References cppu::supportsService().

Friends And Related Function Documentation

◆ OConnection

friend class OConnection
friend

Definition at line 80 of file datasource.hxx.

Referenced by buildIsolatedConnection().

◆ ODatabaseContext

friend class ODatabaseContext
friend

Definition at line 79 of file datasource.hxx.

◆ OSharedConnectionManager

friend class OSharedConnectionManager
friend

Definition at line 81 of file datasource.hxx.

Referenced by getConnection().

Member Data Documentation

◆ m_aFlushListeners

::comphelper::OInterfaceContainerHelper3<css::util::XFlushListener> dbaccess::ODatabaseSource::m_aFlushListeners
private

Definition at line 87 of file datasource.hxx.

Referenced by addFlushListener(), disposing(), flush(), and removeFlushListener().

◆ m_Bookmarks

OBookmarkContainer dbaccess::ODatabaseSource::m_Bookmarks
private

Definition at line 86 of file datasource.hxx.

Referenced by getBookmarks().


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