diff options
Diffstat (limited to 'extensions/source/config/ldap/ldapuserprofilebe.hxx')
-rw-r--r-- | extensions/source/config/ldap/ldapuserprofilebe.hxx | 112 |
1 files changed, 61 insertions, 51 deletions
diff --git a/extensions/source/config/ldap/ldapuserprofilebe.hxx b/extensions/source/config/ldap/ldapuserprofilebe.hxx index 240a7b364e24..f19e9e275a55 100644 --- a/extensions/source/config/ldap/ldapuserprofilebe.hxx +++ b/extensions/source/config/ldap/ldapuserprofilebe.hxx @@ -28,41 +28,33 @@ #ifndef EXTENSIONS_CONFIG_LDAP_LDAPUSERPROFILEBE_HXX_ #define EXTENSIONS_CONFIG_LDAP_LDAPUSERPROFILEBE_HXX_ -#include "ldapuserprof.hxx" -#include "ldapaccess.hxx" -#include "ldapuserprofilelayer.hxx" -#include <com/sun/star/configuration/backend/XSingleLayerStratum.hpp> +#include <com/sun/star/beans/XPropertySet.hpp> #include <com/sun/star/lang/XInitialization.hpp> #include <com/sun/star/uno/XComponentContext.hpp> #include <com/sun/star/lang/XServiceInfo.hpp> #include <com/sun/star/lang/XMultiServiceFactory.hpp> -#include <com/sun/star/configuration/backend/CannotConnectException.hpp> -#include <com/sun/star/configuration/backend/InsufficientAccessRightsException.hpp> -#include <com/sun/star/configuration/backend/ConnectionLostException.hpp> #include <com/sun/star/container/XNameAccess.hpp> #include <com/sun/star/lang/IllegalArgumentException.hpp> #include <cppuhelper/compbase2.hxx> +#include "ldapaccess.hxx" -#define CONTEXT_ITEM_PREFIX_ "/modules/com.sun.star.configuration/bootstrap/" namespace extensions { namespace config { namespace ldap { namespace css = com::sun::star ; namespace uno = css::uno ; namespace lang = css::lang ; -namespace ldap= css::ldap ; -namespace backend = css::configuration::backend ; namespace container = css::container; -//------------------------------------------------------------------------------ -//------------------------------------------------------------------------------ -typedef cppu::WeakComponentImplHelper2<backend::XSingleLayerStratum, +struct LdapDefinition; + +typedef cppu::WeakComponentImplHelper2<css::beans::XPropertySet, lang::XServiceInfo> BackendBase ; struct LdapProfileMutexHolder { osl::Mutex mMutex; }; /** Implements the PlatformBackend service, a specialization of the - SingleLayerStratum service for retreiving LDAP user profile + XPropertySet service for retreiving LDAP user profile configuration settings from a LDAP repsoitory. */ class LdapUserProfileBe : private LdapProfileMutexHolder, public BackendBase @@ -70,7 +62,6 @@ class LdapUserProfileBe : private LdapProfileMutexHolder, public BackendBase public : LdapUserProfileBe(const uno::Reference<uno::XComponentContext>& xContext); - // throw(backend::BackendAccessException, backend::BackendSetupException, RuntimeException); ~LdapUserProfileBe(void) ; // XServiceInfo @@ -86,19 +77,57 @@ class LdapUserProfileBe : private LdapProfileMutexHolder, public BackendBase getSupportedServiceNames( ) throw (uno::RuntimeException) ; - //XSingleLayerStratum - virtual uno::Reference<backend::XLayer> SAL_CALL - getLayer( const rtl::OUString& aLayerId, const rtl::OUString& aTimestamp ) - throw (backend::BackendAccessException, - lang::IllegalArgumentException, - uno::RuntimeException) ; - - virtual uno::Reference<backend::XUpdatableLayer> SAL_CALL - getUpdatableLayer( const rtl::OUString& aLayerId ) - throw (backend::BackendAccessException, - lang::NoSupportException, - lang::IllegalArgumentException, - uno::RuntimeException) ; + // XPropertySet + virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL + getPropertySetInfo() throw (css::uno::RuntimeException) + { return css::uno::Reference< css::beans::XPropertySetInfo >(); } + + virtual void SAL_CALL setPropertyValue( + rtl::OUString const &, css::uno::Any const &) + throw ( + css::beans::UnknownPropertyException, + css::beans::PropertyVetoException, + css::lang::IllegalArgumentException, + css::lang::WrappedTargetException, css::uno::RuntimeException); + + virtual css::uno::Any SAL_CALL getPropertyValue( + rtl::OUString const & PropertyName) + throw ( + css::beans::UnknownPropertyException, + css::lang::WrappedTargetException, css::uno::RuntimeException); + + virtual void SAL_CALL addPropertyChangeListener( + rtl::OUString const &, + css::uno::Reference< css::beans::XPropertyChangeListener > const &) + throw ( + css::beans::UnknownPropertyException, + css::lang::WrappedTargetException, css::uno::RuntimeException) + {} + + virtual void SAL_CALL removePropertyChangeListener( + rtl::OUString const &, + css::uno::Reference< css::beans::XPropertyChangeListener > const &) + throw ( + css::beans::UnknownPropertyException, + css::lang::WrappedTargetException, css::uno::RuntimeException) + {} + + virtual void SAL_CALL addVetoableChangeListener( + rtl::OUString const &, + css::uno::Reference< css::beans::XVetoableChangeListener > const &) + throw ( + css::beans::UnknownPropertyException, + css::lang::WrappedTargetException, css::uno::RuntimeException) + {} + + virtual void SAL_CALL removeVetoableChangeListener( + rtl::OUString const &, + css::uno::Reference< css::beans::XVetoableChangeListener > const &) + throw ( + css::beans::UnknownPropertyException, + css::lang::WrappedTargetException, css::uno::RuntimeException) + {} + /** Provides the implementation name. @return implementation name @@ -112,35 +141,16 @@ class LdapUserProfileBe : private LdapProfileMutexHolder, public BackendBase getLdapUserProfileBeServiceNames(void) ; private: - /** Build OO/LDAP attribute mapping table */ - void initializeMappingTable (const rtl::OUString& aFileMapName); /** Check if LDAP is configured */ - bool readLdapConfiguration(LdapDefinition& aDefinition); + bool readLdapConfiguration( + uno::Reference<lang::XMultiServiceFactory> const & factory, + LdapDefinition * definition, rtl::OUString * loggedOnUser); bool getLdapStringParam(uno::Reference<container::XNameAccess>& xAccess, const rtl::OUString& aLdapSetting, rtl::OString& aServerParameter); - void mapGenericException(ldap::LdapGenericException& aException) - throw (backend::InsufficientAccessRightsException, - backend::ConnectionLostException, - backend::BackendAccessException); - /** Connect to LDAP server */ - void connectToLdapServer(const LdapDefinition& aDefinition ); - /** Get URL of OO-to-LDAP Mapping File */ - rtl::OUString getMappingFileUrl(const rtl::OUString& aFileMapName) const; - - /** Service Factory object */ - uno::Reference<lang::XMultiServiceFactory> mFactory; - /** Component Context */ - uno::Reference<uno::XComponentContext> mContext ; - /** Object for LDAP functionality */ - LdapUserProfileSourceRef mLdapSource; - /**Currently logged in user */ - rtl::OUString mLoggedOnUser ; - /** DN of currently logged in user */ - rtl::OString mUserDN; - + LdapData data_; } ; //------------------------------------------------------------------------------ }}} |