From: Tony Mack Date: Wed, 25 Nov 2009 20:24:31 +0000 (+0000) Subject: moving component server here X-Git-Tag: sfa-0.9-7~289 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=5614016f9bbcf3bb597fcede399f3ad987c3bf18;p=sfa.git moving component server here --- diff --git a/sfa/server/component.py b/sfa/server/component.py new file mode 100644 index 00000000..ab76961d --- /dev/null +++ b/sfa/server/component.py @@ -0,0 +1,38 @@ +# +# Component is a GeniServer that implements the Component interface +# +### $Id: +### $URL: +# + +import tempfile +import os +import time +import sys + +from sfa.util.geniserver import GeniServer +from sfacomponent.plc.api import ComponentAPI + +# GeniLight client support is optional +try: + from egeni.geniLight_client import * +except ImportError: + GeniClientLight = None + +## +# Component is a GeniServer that serves component operations. + +class Component(GeniServer): + ## + # Create a new registry object. + # + # @param ip the ip address to listen on + # @param port the port to listen on + # @param key_file private key filename of registry + # @param cert_file certificate filename containing public key (could be a GID file) + + def __init__(self, ip, port, key_file, cert_file): + GeniServer.__init__(self, ip, port, key_file, cert_file) + # re-initialize the servers api as Component api + self.server.api = ComponentAPI(interface='component', key_file=key_file, cert_file=cert_file) + self.server.interface = 'component'