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 <connectivity/sdbcx/VGroup.hxx>
22 #include <com/sun/star/lang/DisposedException.hpp>
23 #include <com/sun/star/sdbcx/Privilege.hpp>
24 #include <com/sun/star/sdbcx/PrivilegeObject.hpp>
25 #include <comphelper/sequence.hxx>
26 #include <connectivity/dbexception.hxx>
29 using namespace ::connectivity::sdbcx
;
30 using namespace ::connectivity
;
31 using namespace ::dbtools
;
32 using namespace ::com::sun::star::sdbc
;
33 using namespace ::com::sun::star::uno
;
34 using namespace ::com::sun::star::container
;
35 using namespace ::com::sun::star::lang
;
36 using namespace ::com::sun::star::beans
;
38 IMPLEMENT_SERVICE_INFO(OGroup
,"com.sun.star.sdbcx.VGroup","com.sun.star.sdbcx.Group");
40 OGroup::OGroup(bool _bCase
) : OGroup_BASE(m_aMutex
)
41 , ODescriptor(OGroup_BASE::rBHelper
,_bCase
)
45 OGroup::OGroup(const OUString
& Name
, bool _bCase
) : OGroup_BASE(m_aMutex
)
46 ,ODescriptor(OGroup_BASE::rBHelper
,_bCase
)
55 Any SAL_CALL
OGroup::queryInterface( const Type
& rType
)
57 Any aRet
= ODescriptor::queryInterface( rType
);
58 return aRet
.hasValue() ? aRet
: OGroup_BASE::queryInterface( rType
);
61 Sequence
< Type
> SAL_CALL
OGroup::getTypes( )
63 return ::comphelper::concatSequences(ODescriptor::getTypes(),OGroup_BASE::getTypes());
66 void OGroup::disposing()
68 OPropertySetHelper::disposing();
70 ::osl::MutexGuard
aGuard(m_aMutex
);
73 m_pUsers
->disposing();
76 ::cppu::IPropertyArrayHelper
* OGroup::createArrayHelper( ) const
78 Sequence
< Property
> aProps
;
79 describeProperties(aProps
);
80 return new ::cppu::OPropertyArrayHelper(aProps
);
83 ::cppu::IPropertyArrayHelper
& OGroup::getInfoHelper()
85 return *getArrayHelper();
88 Reference
< XNameAccess
> SAL_CALL
OGroup::getUsers( )
90 ::osl::MutexGuard
aGuard(m_aMutex
);
91 checkDisposed(OGroup_BASE::rBHelper
.bDisposed
);
98 catch( const RuntimeException
& )
100 // allowed to leave this method
103 catch( const Exception
& )
108 return m_pUsers
.get();
112 sal_Int32 SAL_CALL
OGroup::getPrivileges( const OUString
& /*objName*/, sal_Int32
/*objType*/ )
114 ::osl::MutexGuard
aGuard(m_aMutex
);
115 checkDisposed(OGroup_BASE::rBHelper
.bDisposed
);
120 sal_Int32 SAL_CALL
OGroup::getGrantablePrivileges( const OUString
& /*objName*/, sal_Int32
/*objType*/ )
122 ::osl::MutexGuard
aGuard(m_aMutex
);
123 checkDisposed(OGroup_BASE::rBHelper
.bDisposed
);
128 void SAL_CALL
OGroup::grantPrivileges( const OUString
& /*objName*/, sal_Int32
/*objType*/, sal_Int32
/*objPrivileges*/ )
130 ::osl::MutexGuard
aGuard(m_aMutex
);
131 checkDisposed(OGroup_BASE::rBHelper
.bDisposed
);
132 throwFeatureNotImplementedSQLException( "XAuthorizable::grantPrivileges", *this );
135 void SAL_CALL
OGroup::revokePrivileges( const OUString
& /*objName*/, sal_Int32
/*objType*/, sal_Int32
/*objPrivileges*/ )
137 ::osl::MutexGuard
aGuard(m_aMutex
);
138 checkDisposed(OGroup_BASE::rBHelper
.bDisposed
);
139 throwFeatureNotImplementedSQLException( "XAuthorizable::revokePrivileges", *this );
142 css::uno::Reference
< css::beans::XPropertySetInfo
> SAL_CALL
OGroup::getPropertySetInfo( )
144 return ::cppu::OPropertySetHelper::createPropertySetInfo(getInfoHelper());
147 OUString SAL_CALL
OGroup::getName( )
152 void SAL_CALL
OGroup::setName( const OUString
& /*aName*/ )
154 throwFeatureNotImplementedRuntimeException( "XNamed::setName", *this );
158 void SAL_CALL
OGroup::acquire() throw()
160 OGroup_BASE::acquire();
163 void SAL_CALL
OGroup::release() throw()
165 OGroup_BASE::release();
169 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */