summaryrefslogtreecommitdiff
path: root/extensions/source/config/ldap/ldapuserprofilebe.hxx
diff options
context:
space:
mode:
Diffstat (limited to 'extensions/source/config/ldap/ldapuserprofilebe.hxx')
-rw-r--r--extensions/source/config/ldap/ldapuserprofilebe.hxx117
1 files changed, 62 insertions, 55 deletions
diff --git a/extensions/source/config/ldap/ldapuserprofilebe.hxx b/extensions/source/config/ldap/ldapuserprofilebe.hxx
index 6b2f78389a8f..f19e9e275a55 100644
--- a/extensions/source/config/ldap/ldapuserprofilebe.hxx
+++ b/extensions/source/config/ldap/ldapuserprofilebe.hxx
@@ -2,13 +2,10 @@
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
- * Copyright 2008 by Sun Microsystems, Inc.
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: ldapuserprofilebe.hxx,v $
- * $Revision: 1.6 $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
@@ -31,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
@@ -73,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
@@ -89,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
@@ -115,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_;
} ;
//------------------------------------------------------------------------------
}}}