2015-05-12 13:48:59 +03:00
/* -------------------------------------------------------------------------- */
2022-04-07 20:49:58 +03:00
/* Copyright 2002-2022, OpenNebula Project, OpenNebula Systems */
2015-05-12 13:48:59 +03:00
/* */
/* Licensed under the Apache License, Version 2.0 (the "License"); you may */
/* not use this file except in compliance with the License. You may obtain */
/* a copy of the License at */
/* */
/* http://www.apache.org/licenses/LICENSE-2.0 */
/* */
/* Unless required by applicable law or agreed to in writing, software */
/* distributed under the License is distributed on an "AS IS" BASIS, */
/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. */
/* See the License for the specific language governing permissions and */
/* limitations under the License. */
/* -------------------------------------------------------------------------- */
# ifndef REQUEST_MANAGER_LOCK_H_
# define REQUEST_MANAGER_LOCK_H_
# include "Request.h"
/* ------------------------------------------------------------------------- */
/* ------------------------------------------------------------------------- */
/* ------------------------------------------------------------------------- */
class RequestManagerLock : public Request
{
protected :
2020-07-02 23:42:10 +03:00
RequestManagerLock ( const std : : string & method_name ,
const std : : string & help )
2015-05-12 13:48:59 +03:00
: Request ( method_name , " A:sis " , help )
{
2018-01-24 17:33:12 +03:00
auth_op = AuthRequest : : MANAGE_NO_LCK ;
2015-05-12 13:48:59 +03:00
} ;
2019-12-10 13:45:15 +03:00
~ RequestManagerLock ( ) = default ;
2015-05-12 13:48:59 +03:00
/* -------------------------------------------------------------------- */
void request_execute ( xmlrpc_c : : paramList const & _paramList ,
2019-07-05 18:23:21 +03:00
RequestAttributes & att ) override ;
2015-05-12 13:48:59 +03:00
2018-01-24 17:33:12 +03:00
int lock_db ( PoolObjectSQL * object , const int owner , const int req_id , const int level )
{
return object - > lock_db ( owner , req_id , level ) ;
} ;
2015-05-12 13:48:59 +03:00
} ;
/* ------------------------------------------------------------------------- */
/* ------------------------------------------------------------------------- */
class RequestManagerUnlock : public Request
{
protected :
2020-07-02 23:42:10 +03:00
RequestManagerUnlock ( const std : : string & method_name ,
const std : : string & help )
2018-01-24 17:33:12 +03:00
: Request ( method_name , " A:sii " , help )
2015-05-12 13:48:59 +03:00
{
2018-01-24 17:33:12 +03:00
auth_op = AuthRequest : : MANAGE_NO_LCK ;
2015-05-12 13:48:59 +03:00
} ;
2019-12-10 13:45:15 +03:00
~ RequestManagerUnlock ( ) = default ;
2015-05-12 13:48:59 +03:00
/* -------------------------------------------------------------------- */
void request_execute ( xmlrpc_c : : paramList const & _paramList ,
2019-07-05 18:23:21 +03:00
RequestAttributes & att ) override ;
2015-05-12 13:48:59 +03:00
2018-05-24 12:43:27 +03:00
int unlock_db ( PoolObjectSQL * object , const int owner , const int req_id )
2018-01-24 17:33:12 +03:00
{
2018-05-24 12:43:27 +03:00
return object - > unlock_db ( owner , req_id ) ;
2018-01-24 17:33:12 +03:00
} ;
2015-05-12 13:48:59 +03:00
} ;
/* ------------------------------------------------------------------------- */
/* ------------------------------------------------------------------------- */
class DocumentLock : public RequestManagerLock
{
public :
2019-12-10 13:45:15 +03:00
DocumentLock ( ) ;
2015-05-12 13:48:59 +03:00
2019-12-10 13:45:15 +03:00
~ DocumentLock ( ) = default ;
2015-05-12 13:48:59 +03:00
} ;
/* ------------------------------------------------------------------------- */
/* ------------------------------------------------------------------------- */
class DocumentUnlock : public RequestManagerUnlock
{
public :
2019-12-10 13:45:15 +03:00
DocumentUnlock ( ) ;
2015-05-12 13:48:59 +03:00
2019-12-10 13:45:15 +03:00
~ DocumentUnlock ( ) = default ;
2018-01-24 17:33:12 +03:00
} ;
2015-05-12 13:48:59 +03:00
2018-01-24 17:33:12 +03:00
/* -------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */
class VirtualMachineLock : public RequestManagerLock
{
public :
2019-12-10 13:45:15 +03:00
VirtualMachineLock ( ) ;
2018-01-24 17:33:12 +03:00
2019-12-10 13:45:15 +03:00
~ VirtualMachineLock ( ) = default ;
2018-01-24 17:33:12 +03:00
} ;
/* -------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */
class VirtualMachineUnlock : public RequestManagerUnlock
{
public :
2019-12-10 13:45:15 +03:00
VirtualMachineUnlock ( ) ;
2018-01-24 17:33:12 +03:00
2019-12-10 13:45:15 +03:00
~ VirtualMachineUnlock ( ) = default ;
2018-01-24 17:33:12 +03:00
} ;
/* -------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */
class VMTemplateLock : public RequestManagerLock
{
public :
2019-12-10 13:45:15 +03:00
VMTemplateLock ( ) ;
2018-01-24 17:33:12 +03:00
2019-12-10 13:45:15 +03:00
~ VMTemplateLock ( ) = default ;
2018-01-24 17:33:12 +03:00
} ;
2018-11-20 19:24:59 +03:00
2018-01-24 17:33:12 +03:00
/* -------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */
class VMTemplateUnlock : public RequestManagerUnlock
{
public :
2019-12-10 13:45:15 +03:00
VMTemplateUnlock ( ) ;
2018-01-24 17:33:12 +03:00
2019-12-10 13:45:15 +03:00
~ VMTemplateUnlock ( ) = default ;
2018-01-24 17:33:12 +03:00
} ;
/* -------------------------------------------------------------------------- */
2018-11-20 19:24:59 +03:00
/* -------------------------------------------------------------------------- */
class VNTemplateLock : public RequestManagerLock
{
public :
2019-12-10 13:45:15 +03:00
VNTemplateLock ( ) ;
2018-11-20 19:24:59 +03:00
2019-12-10 13:45:15 +03:00
~ VNTemplateLock ( ) = default ;
2018-11-20 19:24:59 +03:00
} ;
/* -------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */
class VNTemplateUnlock : public RequestManagerUnlock
{
public :
2019-12-10 13:45:15 +03:00
VNTemplateUnlock ( ) ;
2018-11-20 19:24:59 +03:00
2019-12-10 13:45:15 +03:00
~ VNTemplateUnlock ( ) = default ;
2018-11-20 19:24:59 +03:00
} ;
/* -------------------------------------------------------------------------- */
2018-01-24 17:33:12 +03:00
/* -------------------------------------------------------------------------- */
class VirtualNetworkLock : public RequestManagerLock
{
public :
2019-12-10 13:45:15 +03:00
VirtualNetworkLock ( ) ;
2018-01-24 17:33:12 +03:00
2019-12-10 13:45:15 +03:00
~ VirtualNetworkLock ( ) = default ;
2018-01-24 17:33:12 +03:00
} ;
/* -------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */
class VirtualNetworkUnlock : public RequestManagerUnlock
{
public :
2019-12-10 13:45:15 +03:00
VirtualNetworkUnlock ( ) ;
2018-01-24 17:33:12 +03:00
2019-12-10 13:45:15 +03:00
~ VirtualNetworkUnlock ( ) = default ;
2018-01-24 17:33:12 +03:00
} ;
/* -------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */
class ImageLock : public RequestManagerLock
{
public :
2019-12-10 13:45:15 +03:00
ImageLock ( ) ;
2018-01-24 17:33:12 +03:00
2019-12-10 13:45:15 +03:00
~ ImageLock ( ) = default ;
2018-01-24 17:33:12 +03:00
} ;
/* -------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */
class ImageUnlock : public RequestManagerUnlock
{
public :
2019-12-10 13:45:15 +03:00
ImageUnlock ( ) ;
2018-01-24 17:33:12 +03:00
2019-12-10 13:45:15 +03:00
~ ImageUnlock ( ) = default ;
2018-01-24 17:33:12 +03:00
} ;
/* -------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */
class MarketPlaceAppLock : public RequestManagerLock
{
public :
2019-12-10 13:45:15 +03:00
MarketPlaceAppLock ( ) ;
2018-01-24 17:33:12 +03:00
2019-12-10 13:45:15 +03:00
~ MarketPlaceAppLock ( ) = default ;
2018-01-24 17:33:12 +03:00
} ;
/* -------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */
class MarketPlaceAppUnlock : public RequestManagerUnlock
{
public :
2019-12-10 13:45:15 +03:00
MarketPlaceAppUnlock ( ) ;
2018-01-24 17:33:12 +03:00
2019-12-10 13:45:15 +03:00
~ MarketPlaceAppUnlock ( ) = default ;
2018-01-24 17:33:12 +03:00
} ;
/* -------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */
class VirtualRouterLock : public RequestManagerLock
{
public :
2019-12-10 13:45:15 +03:00
VirtualRouterLock ( ) ;
2018-01-24 17:33:12 +03:00
2019-12-10 13:45:15 +03:00
~ VirtualRouterLock ( ) = default ;
2015-05-12 13:48:59 +03:00
} ;
/* -------------------------------------------------------------------------- */
2018-01-24 17:33:12 +03:00
/* -------------------------------------------------------------------------- */
class VirtualRouterUnlock : public RequestManagerUnlock
{
public :
2019-12-10 13:45:15 +03:00
VirtualRouterUnlock ( ) ;
2018-01-24 17:33:12 +03:00
2019-12-10 13:45:15 +03:00
~ VirtualRouterUnlock ( ) = default ;
2018-01-24 17:33:12 +03:00
} ;
2015-05-12 13:48:59 +03:00
/* -------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */
2018-01-24 17:33:12 +03:00
class VMGroupLock : public RequestManagerLock
{
public :
2019-12-10 13:45:15 +03:00
VMGroupLock ( ) ;
2018-01-24 17:33:12 +03:00
2019-12-10 13:45:15 +03:00
~ VMGroupLock ( ) = default ;
2018-01-24 17:33:12 +03:00
} ;
/* -------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */
class VMGroupUnlock : public RequestManagerUnlock
{
public :
2019-12-10 13:45:15 +03:00
VMGroupUnlock ( ) ;
2018-01-24 17:33:12 +03:00
2019-12-10 13:45:15 +03:00
~ VMGroupUnlock ( ) = default ;
2018-01-24 17:33:12 +03:00
} ;
2019-09-09 15:43:51 +03:00
/* -------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */
class HookLock : public RequestManagerLock
{
public :
2019-12-10 13:45:15 +03:00
HookLock ( ) ;
2019-09-09 15:43:51 +03:00
2019-12-10 13:45:15 +03:00
~ HookLock ( ) = default ;
2019-09-09 15:43:51 +03:00
} ;
/* -------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */
class HookUnlock : public RequestManagerUnlock
{
public :
2019-12-10 13:45:15 +03:00
HookUnlock ( ) ;
2019-09-09 15:43:51 +03:00
2019-12-10 13:45:15 +03:00
~ HookUnlock ( ) = default ;
2019-09-09 15:43:51 +03:00
} ;
2015-05-12 13:48:59 +03:00
# endif