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 .
22 #include "connectivity/sdbcx/VGroup.hxx"
23 #include <com/sun/star/lang/DisposedException.hpp>
24 #include <com/sun/star/sdbcx/Privilege.hpp>
25 #include <com/sun/star/sdbcx/PrivilegeObject.hpp>
26 #include <comphelper/sequence.hxx>
27 #include <connectivity/dbexception.hxx>
30 using namespace ::connectivity::sdbcx
;
31 using namespace ::connectivity
;
32 using namespace ::dbtools
;
33 using namespace ::com::sun::star::sdbc
;
34 using namespace ::com::sun::star::uno
;
35 using namespace ::com::sun::star::container
;
36 using namespace ::com::sun::star::lang
;
37 using namespace ::com::sun::star::beans
;
39 IMPLEMENT_SERVICE_INFO(OGroup
,"com.sun.star.sdbcx.VGroup","com.sun.star.sdbcx.Group");
41 OGroup::OGroup(bool _bCase
) : OGroup_BASE(m_aMutex
)
42 , ODescriptor(OGroup_BASE::rBHelper
,_bCase
)
47 OGroup::OGroup(const OUString
& _Name
, bool _bCase
) : OGroup_BASE(m_aMutex
)
48 ,ODescriptor(OGroup_BASE::rBHelper
,_bCase
)
59 Any SAL_CALL
OGroup::queryInterface( const Type
& rType
) throw(RuntimeException
, std::exception
)
61 Any aRet
= ODescriptor::queryInterface( rType
);
62 return aRet
.hasValue() ? aRet
: OGroup_BASE::queryInterface( rType
);
65 Sequence
< Type
> SAL_CALL
OGroup::getTypes( ) throw(RuntimeException
, std::exception
)
67 return ::comphelper::concatSequences(ODescriptor::getTypes(),OGroup_BASE::getTypes());
70 void OGroup::disposing(void)
72 OPropertySetHelper::disposing();
74 ::osl::MutexGuard
aGuard(m_aMutex
);
77 m_pUsers
->disposing();
80 ::cppu::IPropertyArrayHelper
* OGroup::createArrayHelper( ) const
82 Sequence
< Property
> aProps
;
83 describeProperties(aProps
);
84 return new ::cppu::OPropertyArrayHelper(aProps
);
87 ::cppu::IPropertyArrayHelper
& OGroup::getInfoHelper()
89 return *const_cast<OGroup
*>(this)->getArrayHelper();
92 Reference
< XNameAccess
> SAL_CALL
OGroup::getUsers( ) throw(RuntimeException
, std::exception
)
94 ::osl::MutexGuard
aGuard(m_aMutex
);
95 checkDisposed(OGroup_BASE::rBHelper
.bDisposed
);
102 catch( const RuntimeException
& )
104 // allowed to leave this method
107 catch( const Exception
& )
112 return const_cast<OGroup
*>(this)->m_pUsers
;
116 sal_Int32 SAL_CALL
OGroup::getPrivileges( const OUString
& /*objName*/, sal_Int32
/*objType*/ ) throw(::com::sun::star::sdbc::SQLException
, RuntimeException
, std::exception
)
118 ::osl::MutexGuard
aGuard(m_aMutex
);
119 checkDisposed(OGroup_BASE::rBHelper
.bDisposed
);
124 sal_Int32 SAL_CALL
OGroup::getGrantablePrivileges( const OUString
& /*objName*/, sal_Int32
/*objType*/ ) throw(::com::sun::star::sdbc::SQLException
, RuntimeException
, std::exception
)
126 ::osl::MutexGuard
aGuard(m_aMutex
);
127 checkDisposed(OGroup_BASE::rBHelper
.bDisposed
);
132 void SAL_CALL
OGroup::grantPrivileges( const OUString
& /*objName*/, sal_Int32
/*objType*/, sal_Int32
/*objPrivileges*/ ) throw(::com::sun::star::sdbc::SQLException
, RuntimeException
, std::exception
)
134 ::osl::MutexGuard
aGuard(m_aMutex
);
135 checkDisposed(OGroup_BASE::rBHelper
.bDisposed
);
136 throwFeatureNotImplementedException( "XAuthorizable::grantPrivileges", *this );
139 void SAL_CALL
OGroup::revokePrivileges( const OUString
& /*objName*/, sal_Int32
/*objType*/, sal_Int32
/*objPrivileges*/ ) throw(::com::sun::star::sdbc::SQLException
, RuntimeException
, std::exception
)
141 ::osl::MutexGuard
aGuard(m_aMutex
);
142 checkDisposed(OGroup_BASE::rBHelper
.bDisposed
);
143 throwFeatureNotImplementedException( "XAuthorizable::revokePrivileges", *this );
146 ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertySetInfo
> SAL_CALL
OGroup::getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException
, std::exception
)
148 return ::cppu::OPropertySetHelper::createPropertySetInfo(getInfoHelper());
151 OUString SAL_CALL
OGroup::getName( ) throw(::com::sun::star::uno::RuntimeException
, std::exception
)
156 void SAL_CALL
OGroup::setName( const OUString
& /*aName*/ ) throw(::com::sun::star::uno::RuntimeException
, std::exception
)
158 throwFeatureNotImplementedException( "XNamed::setName", *this );
162 void SAL_CALL
OGroup::acquire() throw()
164 OGroup_BASE::acquire();
167 void SAL_CALL
OGroup::release() throw()
169 OGroup_BASE::release();
174 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */