2 # NEPI, a framework to manage network experiments
3 # Copyright (C) 2013 INRIA
5 # This program is free software: you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation, either version 3 of the License, or
8 # (at your option) any later version.
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
15 # You should have received a copy of the GNU General Public License
16 # along with this program. If not, see <http://www.gnu.org/licenses/>.
18 # Author: Julien Tribino <julien.tribino@inria.fr>
19 # Lucia Guevgeozian <lucia.guevgeozian_odizzio@inria.fr>
21 from nepi.execution.attribute import Attribute, Flags, Types
22 from nepi.execution.resource import ResourceManager, clsinit_copy, \
23 ResourceState, reschedule_delay
26 class ResourceGateway:
28 Dictionary used to set OMF gateway depending on Testbed information.
30 #XXX: A.Q. COMMENT: This looks a bit hardcoded
31 # SHOULDN'T THIS BE IN A SEPARATED FILE RATHER THAN IN THE
32 # BASE CLASS FOR ALL OMF RESOURCES?
33 TestbedtoGateway = dict({
34 "wilabt" : "ops.wilab2.ilabt.iminds.be",
35 "nitos" : "nitlab.inf.uth.gr",
40 "am.wilab2.ilabt.iminds.be" : "ops.wilab2.ilabt.iminds.be",
41 "nitlab.inf.uth.gr" : "nitlab.inf.uth.gr",
46 class OMFResource(ResourceManager):
48 Generic resource gathering XMPP credential information and common methods
49 for OMF nodes, channels, applications, etc.
51 _rtype = "OMFResource"
54 def _register_attributes(cls):
56 xmppServer = Attribute("xmppServer", "Xmpp Server",
57 flags = Flags.Credential)
58 xmppUser = Attribute("xmppUser","Name of the Xmpp User/Slice",
59 flags = Flags.Credential)
60 xmppPort = Attribute("xmppPort", "Xmpp Port",
61 flags = Flags.Credential)
62 xmppPassword = Attribute("xmppPassword", "Xmpp Password",
63 flags = Flags.Credential)
64 version = Attribute("version", "Version of OMF : Either 5 or 6",
67 cls._register_attribute(xmppUser)
68 cls._register_attribute(xmppServer)
69 cls._register_attribute(xmppPort)
70 cls._register_attribute(xmppPassword)
71 cls._register_attribute(version)
73 def __init__(self, ec, guid):
74 super(OMFResource, self).__init__(ec, guid)