beginning/proof-of-concept of a generic/ module together with SFA_GENERIC_FLAVOUR to
[sfa.git] / sfa / server / component.py
1 #
2 # Component is a SfaServer that implements the Component interface
3 #
4 import tempfile
5 import os
6 import time
7 import sys
8
9 from sfa.server.sfaserver import SfaServer
10  
11 # GeniLight client support is optional
12 try:
13     from egeni.geniLight_client import *
14 except ImportError:
15     GeniClientLight = None            
16
17 ##
18 # Component is a SfaServer that serves component operations.
19
20 # set SFA_GENERIC_FLAVOUR=plcm to get a PlcComponentApi instance in the request handler 
21 class Component(SfaServer):
22     ##
23     # Create a new registry object.
24     #
25     # @param ip the ip address to listen on
26     # @param port the port to listen on
27     # @param key_file private key filename of registry
28     # @param cert_file certificate filename containing public key (could be a GID file)
29
30     def __init__(self, ip, port, key_file, cert_file):
31         SfaServer.__init__(self, ip, port, key_file, cert_file)
32         self.server.interface = 'component'