]> rtime.felk.cvut.cz Git - frescor/frsh.git/blob - fres/resmng/frm.idl
Implemented support for contract renegotiation
[frescor/frsh.git] / fres / resmng / frm.idl
1 ////////////////////////////////////////////////////////////////////////////
2 // ---------------------------------------------------------------------- //
3 // Copyright (C) 2006 - 2008 FRESCOR consortium partners:                 //
4 //                                                                        //
5 //   Universidad de Cantabria,              SPAIN                         //
6 //   University of York,                    UK                            //
7 //   Scuola Superiore Sant'Anna,            ITALY                         //
8 //   Kaiserslautern University,             GERMANY                       //
9 //   Univ. Politécnica  Valencia,           SPAIN                        //
10 //   Czech Technical University in Prague,  CZECH REPUBLIC                //
11 //   ENEA                                   SWEDEN                        //
12 //   Thales Communication S.A.              FRANCE                        //
13 //   Visual Tools S.A.                      SPAIN                         //
14 //   Rapita Systems Ltd                     UK                            //
15 //   Evidence                               ITALY                         //
16 //                                                                        //
17 //   See http://www.frescor.org for a link to partners' websites          //
18 //                                                                        //
19 //          FRESCOR project (FP6/2005/IST/5-034026) is funded             //
20 //       in part by the European Union Sixth Framework Programme          //
21 //       The European Union is not liable of any use that may be          //
22 //       made of this code.                                               //
23 //                                                                        //
24 //                                                                        //
25 // based on previous work (FSF) done in the FIRST project                 //
26 //                                                                        //
27 //  Copyright (C) 2005  Mälardalen University, SWEDEN                    //
28 //                      Scuola Superiore S.Anna, ITALY                    //
29 //                      Universidad de Cantabria, SPAIN                   //
30 //                      University of York, UK                            //
31 //                                                                        //
32 //  FSF API web pages: http:marte.unican.es/fsf/docs                      //
33 //                     http:shark.sssup.it/contrib/first/docs/            //
34 //                                                                        //
35 //  This file is part of FORB (Frescor Object Request Broker)             //
36 //                                                                        //
37 // FORB is free software; you can redistribute it and/or modify it        //
38 // under terms of the GNU General Public License as published by the      //
39 // Free Software Foundation; either version 2, or (at your option) any    //
40 // later version.  FORB is distributed in the hope that it will be        //
41 // useful, but WITHOUT ANY WARRANTY; without even the implied warranty    //
42 // of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU    //
43 // General Public License for more details. You should have received a    //
44 // copy of the GNU General Public License along with FORB; see file       //
45 // COPYING. If not, write to the Free Software Foundation, 675 Mass Ave,  //
46 // Cambridge, MA 02139, USA.                                              //
47 //                                                                        //
48 // As a special exception, including FORB header files in a file,         //
49 // instantiating FORB generics or templates, or linking other files       //
50 // with FORB objects to produce an executable application, does not       //
51 // by itself cause the resulting executable application to be covered     //
52 // by the GNU General Public License. This exception does not             //
53 // however invalidate any other reasons why the executable file might be  //
54 // covered by the GNU Public License.                                     //
55 ////////////////////////////////////////////////////////////////////////////
56
57 /**
58  * @file   frm.idl
59  * @author Michal Sojka <sojkam1@fel.cvut.cz>
60  * @date   Sat Oct 25 21:57:56 2008
61  * 
62  * @brief  FORB interface of resource manager
63  * 
64  * 
65  */
66 #ifndef _FRM_IDL
67 #define _FRM_IDL
68
69 #include "../contract/fres_contract_idl.idl"
70
71 /// FRES framework
72 module fres {
73         /** Resource manager */
74         interface resource_manager {
75                 /** 
76                  * Executes admission test and if the contracts are
77                  * accepted, they are put to "reserved" state.
78                  *
79                  * @todo If a contract is in the "reserved" state, and
80                  * reserve_contracts() is called again with the same
81                  * contract, the previously reserved contract should
82                  * be replaced with the new one.
83                  * 
84                  * @param[in] contracts Contract(s) to negotiate,
85                  * renegotiate or cancel. The operation on the
86                  * contract is determined as follows:
87                  * - cancel: contracts with an ID and without any block
88                  * 
89                  * - neg: contracts with ID not present in current
90                  *   schedulability scenario.
91                  * 
92                  * - reneg: contracts with ID present in current
93                  *   schedulability scenario.
94                  * 
95                  * @return
96                  * - Zero if reservation (admisson test) was successfull,
97                  * - one if admission test was not successfull and
98                  * - negative error code if an error occured.
99                  */
100                 long reserve_contracts(in contract::ptr_seq contracts);
101
102                 /** 
103                  * Puts contracts with given IDs to the "commited"
104                  * state and sends back the changes to VRESes to reach
105                  * the new state.
106                  *
107                  * @param[in] ids IDs of contracts to be commited.
108                  * 
109                  * @param[out] schedulable_contracts Schedulable
110                  * contracts, for new or changed VRESes. These
111                  * contract may be extened by one or more data blocks
112                  * for use by the allocator. The allocator receives
113                  * the contracts in the same order as they are
114                  * returned.
115                  */
116                 void commit_contracts(in contract::id_seq ids,
117                                       out contract::ptr_seq schedulable_contracts);
118
119                 /** 
120                  * Cancels not-commited reservations.
121                  * 
122                  * @param ids ID's of reserved contracts to be rolled-back
123                  * to the state before reservation.
124                  */
125                 void cancel_reservations(in contract::id_seq ids);
126                 /** 
127                  * Returns the list of commited contracts
128                  * 
129                  * @param contracts Commited contracts
130                  * 
131                  * @param utilization Utilization in the range 0-100
132                  * (for visualization) or -1 if utilization cannot be
133                  * calculated.
134                  */
135                 void get_contracts(out contract::ptr_seq contracts, out long utilization);
136         };
137 };
138
139 #endif