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::sdbc
;
30 using namespace ::com::sun::star::uno
;
31 using namespace ::com::sun::star::container
;
32 using namespace ::com::sun::star::lang
;
33 using namespace ::com::sun::star::beans
;
35 IMPLEMENT_SERVICE_INFO(OGroup
,"com.sun.star.sdbcx.VGroup","com.sun.star.sdbcx.Group");
37 OGroup::OGroup(bool _bCase
) : OGroup_BASE(m_aMutex
)
38 , ODescriptor(OGroup_BASE::rBHelper
,_bCase
)
42 OGroup::OGroup(const OUString
& Name
, bool _bCase
) : OGroup_BASE(m_aMutex
)
43 ,ODescriptor(OGroup_BASE::rBHelper
,_bCase
)
52 Any SAL_CALL
OGroup::queryInterface( const Type
& rType
)
54 Any aRet
= ODescriptor::queryInterface( rType
);
55 return aRet
.hasValue() ? aRet
: OGroup_BASE::queryInterface( rType
);
58 Sequence
< Type
> SAL_CALL
OGroup::getTypes( )
60 return ::comphelper::concatSequences(ODescriptor::getTypes(),OGroup_BASE::getTypes());
63 void OGroup::disposing()
65 OPropertySetHelper::disposing();
67 ::osl::MutexGuard
aGuard(m_aMutex
);
70 m_pUsers
->disposing();
73 ::cppu::IPropertyArrayHelper
* OGroup::createArrayHelper( ) const
75 Sequence
< Property
> aProps
;
76 describeProperties(aProps
);
77 return new ::cppu::OPropertyArrayHelper(aProps
);
80 ::cppu::IPropertyArrayHelper
& OGroup::getInfoHelper()
82 return *getArrayHelper();
85 Reference
< XNameAccess
> SAL_CALL
OGroup::getUsers( )
87 ::osl::MutexGuard
aGuard(m_aMutex
);
88 checkDisposed(OGroup_BASE::rBHelper
.bDisposed
);
95 catch( const RuntimeException
& )
97 // allowed to leave this method
100 catch( const Exception
& )
105 return m_pUsers
.get();
109 sal_Int32 SAL_CALL
OGroup::getPrivileges( const OUString
& /*objName*/, sal_Int32
/*objType*/ )
111 ::osl::MutexGuard
aGuard(m_aMutex
);
112 checkDisposed(OGroup_BASE::rBHelper
.bDisposed
);
117 sal_Int32 SAL_CALL
OGroup::getGrantablePrivileges( const OUString
& /*objName*/, sal_Int32
/*objType*/ )
119 ::osl::MutexGuard
aGuard(m_aMutex
);
120 checkDisposed(OGroup_BASE::rBHelper
.bDisposed
);
125 void SAL_CALL
OGroup::grantPrivileges( const OUString
& /*objName*/, sal_Int32
/*objType*/, sal_Int32
/*objPrivileges*/ )
127 ::osl::MutexGuard
aGuard(m_aMutex
);
128 checkDisposed(OGroup_BASE::rBHelper
.bDisposed
);
129 throwFeatureNotImplementedSQLException( "XAuthorizable::grantPrivileges", *this );
132 void SAL_CALL
OGroup::revokePrivileges( const OUString
& /*objName*/, sal_Int32
/*objType*/, sal_Int32
/*objPrivileges*/ )
134 ::osl::MutexGuard
aGuard(m_aMutex
);
135 checkDisposed(OGroup_BASE::rBHelper
.bDisposed
);
136 throwFeatureNotImplementedSQLException( "XAuthorizable::revokePrivileges", *this );
139 css::uno::Reference
< css::beans::XPropertySetInfo
> SAL_CALL
OGroup::getPropertySetInfo( )
141 return ::cppu::OPropertySetHelper::createPropertySetInfo(getInfoHelper());
144 OUString SAL_CALL
OGroup::getName( )
149 void SAL_CALL
OGroup::setName( const OUString
& /*aName*/ )
151 throwFeatureNotImplementedRuntimeException( "XNamed::setName", *this );
155 void SAL_CALL
OGroup::acquire() noexcept
157 OGroup_BASE::acquire();
160 void SAL_CALL
OGroup::release() noexcept
162 OGroup_BASE::release();
166 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */