1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
21 #include <sdbcx/VGroup.hxx>
22 #include <comphelper/sequence.hxx>
23 #include <connectivity/dbexception.hxx>
26 using namespace ::connectivity::sdbcx
;
27 using namespace ::connectivity
;
28 using namespace ::dbtools
;
29 using namespace ::com::sun::star::uno
;
30 using namespace ::com::sun::star::container
;
31 using namespace ::com::sun::star::lang
;
32 using namespace ::com::sun::star::beans
;
34 IMPLEMENT_SERVICE_INFO(OGroup
,u
"com.sun.star.sdbcx.VGroup"_ustr
,u
"com.sun.star.sdbcx.Group"_ustr
);
36 OGroup::OGroup(bool _bCase
) : OGroup_BASE(m_aMutex
)
37 , ODescriptor(OGroup_BASE::rBHelper
,_bCase
)
41 OGroup::OGroup(const OUString
& Name
, bool _bCase
) : OGroup_BASE(m_aMutex
)
42 ,ODescriptor(OGroup_BASE::rBHelper
,_bCase
)
51 Any SAL_CALL
OGroup::queryInterface( const Type
& rType
)
53 Any aRet
= ODescriptor::queryInterface( rType
);
54 return aRet
.hasValue() ? aRet
: OGroup_BASE::queryInterface( rType
);
57 Sequence
< Type
> SAL_CALL
OGroup::getTypes( )
59 return ::comphelper::concatSequences(ODescriptor::getTypes(),OGroup_BASE::getTypes());
62 void OGroup::disposing()
64 OPropertySetHelper::disposing();
66 ::osl::MutexGuard
aGuard(m_aMutex
);
69 m_pUsers
->disposing();
72 ::cppu::IPropertyArrayHelper
* OGroup::createArrayHelper( ) const
74 Sequence
< Property
> aProps
;
75 describeProperties(aProps
);
76 return new ::cppu::OPropertyArrayHelper(aProps
);
79 ::cppu::IPropertyArrayHelper
& OGroup::getInfoHelper()
81 return *getArrayHelper();
84 Reference
< XNameAccess
> SAL_CALL
OGroup::getUsers( )
86 ::osl::MutexGuard
aGuard(m_aMutex
);
87 checkDisposed(OGroup_BASE::rBHelper
.bDisposed
);
94 catch( const RuntimeException
& )
96 // allowed to leave this method
99 catch( const Exception
& )
104 return m_pUsers
.get();
108 sal_Int32 SAL_CALL
OGroup::getPrivileges( const OUString
& /*objName*/, sal_Int32
/*objType*/ )
110 ::osl::MutexGuard
aGuard(m_aMutex
);
111 checkDisposed(OGroup_BASE::rBHelper
.bDisposed
);
116 sal_Int32 SAL_CALL
OGroup::getGrantablePrivileges( const OUString
& /*objName*/, sal_Int32
/*objType*/ )
118 ::osl::MutexGuard
aGuard(m_aMutex
);
119 checkDisposed(OGroup_BASE::rBHelper
.bDisposed
);
124 void SAL_CALL
OGroup::grantPrivileges( const OUString
& /*objName*/, sal_Int32
/*objType*/, sal_Int32
/*objPrivileges*/ )
126 ::osl::MutexGuard
aGuard(m_aMutex
);
127 checkDisposed(OGroup_BASE::rBHelper
.bDisposed
);
128 throwFeatureNotImplementedSQLException( u
"XAuthorizable::grantPrivileges"_ustr
, *this );
131 void SAL_CALL
OGroup::revokePrivileges( const OUString
& /*objName*/, sal_Int32
/*objType*/, sal_Int32
/*objPrivileges*/ )
133 ::osl::MutexGuard
aGuard(m_aMutex
);
134 checkDisposed(OGroup_BASE::rBHelper
.bDisposed
);
135 throwFeatureNotImplementedSQLException( u
"XAuthorizable::revokePrivileges"_ustr
, *this );
138 css::uno::Reference
< css::beans::XPropertySetInfo
> SAL_CALL
OGroup::getPropertySetInfo( )
140 return ::cppu::OPropertySetHelper::createPropertySetInfo(getInfoHelper());
143 OUString SAL_CALL
OGroup::getName( )
148 void SAL_CALL
OGroup::setName( const OUString
& /*aName*/ )
150 throwFeatureNotImplementedRuntimeException( u
"XNamed::setName"_ustr
, *this );
154 void SAL_CALL
OGroup::acquire() noexcept
156 OGroup_BASE::acquire();
159 void SAL_CALL
OGroup::release() noexcept
161 OGroup_BASE::release();
165 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */