2015-12-14 18:47:33 +03:00
/* -------------------------------------------------------------------------- */
2016-05-04 13:33:23 +03:00
/* Copyright 2002-2016, OpenNebula Project, OpenNebula Systems */
2015-12-14 18:47:33 +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 MARKETPLACE_MANAGER_DRIVER_H_
# define MARKETPLACE_MANAGER_DRIVER_H_
# include <map>
# include <string>
# include <sstream>
# include "Mad.h"
2015-12-15 14:18:43 +03:00
class MarketPlacePool ;
class MarketPlaceAppPool ;
2015-12-21 15:23:22 +03:00
class MarketPlaceManager ;
2015-12-15 14:18:43 +03:00
2015-12-14 18:47:33 +03:00
/**
* ImageManagerDriver represents the basic abstraction for Image Repository
* drivers . It implements the protocol and recover functions from the Mad
* interface .
*/
class MarketPlaceManagerDriver : public Mad
{
public :
2015-12-15 14:18:43 +03:00
MarketPlaceManagerDriver ( int userid ,
const std : : map < string , string > & attrs ,
bool sudo ,
MarketPlacePool * _marketpool ,
2015-12-21 15:23:22 +03:00
MarketPlaceAppPool * _apppool ,
MarketPlaceManager * _marketm
) : Mad ( userid , attrs , sudo ) , marketpool ( _marketpool ) , apppool ( _apppool ) ,
marketm ( _marketm ) { } ;
2015-12-14 18:47:33 +03:00
virtual ~ MarketPlaceManagerDriver ( ) { } ;
/**
* Implements the Image Manager driver protocol .
* @ param message the string read from the driver
*/
void protocol ( const std : : string & message ) const ;
/**
* TODO : What do we need here ? Check on - going xfr ?
*/
void recover ( ) ;
private :
friend class MarketPlaceManager ;
2015-12-15 14:18:43 +03:00
/**
* Reference to Marketplace related pools
*/
MarketPlacePool * marketpool ;
MarketPlaceAppPool * apppool ;
2015-12-21 15:23:22 +03:00
MarketPlaceManager * marketm ;
2015-12-14 18:47:33 +03:00
/**
2015-12-23 02:26:54 +03:00
* Imports a new object into the marketplace
* @ param oid of the app
2015-12-14 18:47:33 +03:00
* @ param drv_msg xml data for the mad operation .
*/
void importapp ( int oid , const std : : string & drv_msg ) const ;
/**
2015-12-23 02:26:54 +03:00
* Deletes an app from the marketplace
* @ param oid of the app
2015-12-14 18:47:33 +03:00
* @ param drv_msg xml data for the mad operation .
*/
void deleteapp ( int oid , const std : : string & drv_msg ) const ;
/**
2015-12-23 02:26:54 +03:00
* Monitors the marketplace
* @ param oid of the operation
2015-12-14 18:47:33 +03:00
* @ param drv_msg xml data for the mad operation .
*/
void monitor ( int oid , const std : : string & drv_msg ) const ;
} ;
/* -------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */
# endif /*MARKETPLACE_MANAGER_DRIVER_H_*/