Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*************************************************************************
3 : : *
4 : : * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 : : *
6 : : * Copyright 2000, 2010 Oracle and/or its affiliates.
7 : : *
8 : : * OpenOffice.org - a multi-platform office productivity suite
9 : : *
10 : : * This file is part of OpenOffice.org.
11 : : *
12 : : * OpenOffice.org is free software: you can redistribute it and/or modify
13 : : * it under the terms of the GNU Lesser General Public License version 3
14 : : * only, as published by the Free Software Foundation.
15 : : *
16 : : * OpenOffice.org is distributed in the hope that it will be useful,
17 : : * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 : : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 : : * GNU Lesser General Public License version 3 for more details
20 : : * (a copy is included in the LICENSE file that accompanied this code).
21 : : *
22 : : * You should have received a copy of the GNU Lesser General Public License
23 : : * version 3 along with OpenOffice.org. If not, see
24 : : * <http://www.openoffice.org/license.html>
25 : : * for a copy of the LGPLv3 License.
26 : : *
27 : : ************************************************************************/
28 : :
29 : : #ifndef EXTENSIONS_CONFIG_LDAP_LDAPUSERPROFILEBE_HXX_
30 : : #define EXTENSIONS_CONFIG_LDAP_LDAPUSERPROFILEBE_HXX_
31 : :
32 : : #include <com/sun/star/beans/XPropertySet.hpp>
33 : : #include <com/sun/star/lang/XInitialization.hpp>
34 : : #include <com/sun/star/lang/XServiceInfo.hpp>
35 : : #include <com/sun/star/container/XNameAccess.hpp>
36 : : #include <com/sun/star/lang/IllegalArgumentException.hpp>
37 : : #include <cppuhelper/compbase2.hxx>
38 : :
39 : : #include "ldapaccess.hxx"
40 : :
41 : : namespace com { namespace sun { namespace star { namespace uno {
42 : : class XComponentContext;
43 : : } } } }
44 : :
45 : : namespace extensions { namespace config { namespace ldap {
46 : :
47 : : namespace css = com::sun::star ;
48 : : namespace uno = css::uno ;
49 : : namespace lang = css::lang ;
50 : : namespace container = css::container;
51 : :
52 : : struct LdapDefinition;
53 : :
54 : : typedef cppu::WeakComponentImplHelper2<css::beans::XPropertySet,
55 : : lang::XServiceInfo> BackendBase ;
56 : :
57 : 0 : struct LdapProfileMutexHolder { osl::Mutex mMutex; };
58 : : /**
59 : : Implements the PlatformBackend service, a specialization of the
60 : : XPropertySet service for retreiving LDAP user profile
61 : : configuration settings from a LDAP repsoitory.
62 : : */
63 : : class LdapUserProfileBe : private LdapProfileMutexHolder, public BackendBase
64 : : {
65 : : public :
66 : :
67 : : LdapUserProfileBe(const uno::Reference<uno::XComponentContext>& xContext);
68 : : ~LdapUserProfileBe(void) ;
69 : :
70 : : // XServiceInfo
71 : : virtual rtl::OUString SAL_CALL
72 : : getImplementationName( )
73 : : throw (uno::RuntimeException) ;
74 : :
75 : : virtual sal_Bool SAL_CALL
76 : : supportsService( const rtl::OUString& aServiceName )
77 : : throw (uno::RuntimeException) ;
78 : :
79 : : virtual uno::Sequence<rtl::OUString> SAL_CALL
80 : : getSupportedServiceNames( )
81 : : throw (uno::RuntimeException) ;
82 : :
83 : : // XPropertySet
84 : : virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL
85 : 0 : getPropertySetInfo() throw (css::uno::RuntimeException)
86 : 0 : { return css::uno::Reference< css::beans::XPropertySetInfo >(); }
87 : :
88 : : virtual void SAL_CALL setPropertyValue(
89 : : rtl::OUString const &, css::uno::Any const &)
90 : : throw (
91 : : css::beans::UnknownPropertyException,
92 : : css::beans::PropertyVetoException,
93 : : css::lang::IllegalArgumentException,
94 : : css::lang::WrappedTargetException, css::uno::RuntimeException);
95 : :
96 : : virtual css::uno::Any SAL_CALL getPropertyValue(
97 : : rtl::OUString const & PropertyName)
98 : : throw (
99 : : css::beans::UnknownPropertyException,
100 : : css::lang::WrappedTargetException, css::uno::RuntimeException);
101 : :
102 : 0 : virtual void SAL_CALL addPropertyChangeListener(
103 : : rtl::OUString const &,
104 : : css::uno::Reference< css::beans::XPropertyChangeListener > const &)
105 : : throw (
106 : : css::beans::UnknownPropertyException,
107 : : css::lang::WrappedTargetException, css::uno::RuntimeException)
108 : 0 : {}
109 : :
110 : 0 : virtual void SAL_CALL removePropertyChangeListener(
111 : : rtl::OUString const &,
112 : : css::uno::Reference< css::beans::XPropertyChangeListener > const &)
113 : : throw (
114 : : css::beans::UnknownPropertyException,
115 : : css::lang::WrappedTargetException, css::uno::RuntimeException)
116 : 0 : {}
117 : :
118 : 0 : virtual void SAL_CALL addVetoableChangeListener(
119 : : rtl::OUString const &,
120 : : css::uno::Reference< css::beans::XVetoableChangeListener > const &)
121 : : throw (
122 : : css::beans::UnknownPropertyException,
123 : : css::lang::WrappedTargetException, css::uno::RuntimeException)
124 : 0 : {}
125 : :
126 : 0 : virtual void SAL_CALL removeVetoableChangeListener(
127 : : rtl::OUString const &,
128 : : css::uno::Reference< css::beans::XVetoableChangeListener > const &)
129 : : throw (
130 : : css::beans::UnknownPropertyException,
131 : : css::lang::WrappedTargetException, css::uno::RuntimeException)
132 : 0 : {}
133 : :
134 : : /**
135 : : Provides the implementation name.
136 : : @return implementation name
137 : : */
138 : : static rtl::OUString SAL_CALL getLdapUserProfileBeName(void) ;
139 : : /**
140 : : Provides the supported services names
141 : : @return service names
142 : : */
143 : : static uno::Sequence<rtl::OUString> SAL_CALL
144 : : getLdapUserProfileBeServiceNames(void) ;
145 : :
146 : : private:
147 : : /** Check if LDAP is configured */
148 : : bool readLdapConfiguration(
149 : : uno::Reference<uno::XComponentContext> const & context,
150 : : LdapDefinition * definition, rtl::OUString * loggedOnUser);
151 : :
152 : : bool getLdapStringParam(uno::Reference<container::XNameAccess>& xAccess,
153 : : const rtl::OUString& aLdapSetting,
154 : : rtl::OUString& aServerParameter);
155 : :
156 : : LdapData data_;
157 : : } ;
158 : : //------------------------------------------------------------------------------
159 : : }}}
160 : :
161 : : #endif // EXTENSIONS_CONFIG_LDAP_LDAPUSERPROFILE_HXX_
162 : :
163 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|