def __init__(self, pnode, event_callback):
        """
        Creates an RSNPlatformDriver instance.

        @param pnode           Root PlatformNode defining the platform network
                               rooted at this platform.
        @param event_callback  Listener of events generated by this driver
        """
        PlatformDriver.__init__(self, pnode, event_callback)

        # CIOMSClient instance created by connect() and destroyed by disconnect():
        self._rsn_oms = None

        # TODO(OOIION-1495) review the following. Commented out for the moment.
        # But yes, we would probably need some concept of currently "active
        # ports", probably defined as those where there are active instruments
        #  associated.
        """
        # Simple list of active ports in this deployment configuration:
        # (this should be all the ports that have devices attached. Used in go_active processing
        self._active_ports = []
        """

        # URL for the event listener registration/unregistration (based on
        # web server launched by ServiceGatewayService, since that's the
        # service in charge of receiving/relaying the OMS events).
        # NOTE: (as proposed long ago), this kind of functionality should
        # actually be provided by some component more in charge of the RSN
        # platform netwokr as a whole -- as opposed to platform-specific).
        self.listener_url = None
    def __init__(self, platform_id, driver_config, parent_platform_id=None):
        """
        Creates an OmsPlatformDriver instance.

        @param platform_id Corresponding platform ID
        @param driver_config with required 'oms_uri' entry.
        @param parent_platform_id Platform ID of my parent, if any.
                    This is mainly used for diagnostic purposes
        """
        PlatformDriver.__init__(self, platform_id, driver_config, parent_platform_id)

        if not 'oms_uri' in driver_config:
            raise PlatformDriverException(msg="driver_config does not indicate 'oms_uri'")

        oms_uri = driver_config['oms_uri']
        log.debug("%r: creating OmsClient instance with oms_uri=%r",
            self._platform_id, oms_uri)
        self._oms = OmsClientFactory.create_instance(oms_uri)
        log.debug("%r: OmsClient instance created: %s",
            self._platform_id, self._oms)

        # TODO set-up configuration for notification of events associated
        # with values retrieved during platform resource monitoring

        # _monitors: dict { attr_id: OmsResourceMonitor }
        self._monitors = {}

        # we can instantiate this here as the the actual http server is
        # started via corresponding method.
        self._event_listener = OmsEventListener(self._notify_driver_event)
Exemple #3
0
    def configure(self, driver_config):
        """
        Nothing special done here, only calls super.configure(driver_config)

        @param driver_config with required 'oms_uri' entry.
        """
        PlatformDriver.configure(self, driver_config)
    def configure(self, driver_config):
        """
        Nothing special done here, only calls super.configure(driver_config)

        @param driver_config with required 'oms_uri' entry.
        """
        PlatformDriver.configure(self, driver_config)
    def configure(self, driver_config):
        """
        Nothing special done here, only calls super.configure(driver_config)

        @param driver_config with required 'oms_uri' entry.
        """
        PlatformDriver.configure(self, driver_config)
        self.nodeCfgFile = NodeConfiguration()
        self.nodeCfgFile.Open(self._platform_id,self._driver_config['driver_cfg_file']['default_cfg_file'],self._driver_config['driver_cfg_file']['node_cfg_file'])

        self._construct_resource_schema()
Exemple #6
0
    def __init__(self, pnode, evt_recv):
        """
        Creates an RSNPlatformDriver instance.

        @param pnode     Root PlatformNode defining the platform network rooted at
                         this platform.
        @param evt_recv  Listener of events generated by this driver
        """
        PlatformDriver.__init__(self, pnode, evt_recv)

        # CIOMSClient instance created by connect()
        self._rsn_oms = None

        # external event listener: we can instantiate this here as the the
        # actual http server is started via corresponding method.
        self._event_listener = OmsEventListener(self._notify_driver_event)
    def __init__(self, pnode, event_callback):
        """
        Creates an RSNPlatformDriver instance.

        @param pnode           Root PlatformNode defining the platform network
                               rooted at this platform.
        @param event_callback  Listener of events generated by this driver
        """
        PlatformDriver.__init__(self, pnode, event_callback)

        # CIOMSClient instance created by connect() and destroyed by disconnect():
        self._rsn_oms = None

        # external event listener: we can instantiate this here as the
        # actual http server is started via corresponding method.
        self._event_listener = OmsEventListener(self._platform_id, self._notify_driver_event)
    def __init__(self, pnode, event_callback):
        """
        Creates an RSNPlatformDriver instance.

        @param pnode           Root PlatformNode defining the platform network
                               rooted at this platform.
        @param event_callback  Listener of events generated by this driver
        """
        PlatformDriver.__init__(self, pnode, event_callback)

        # CIOMSClient instance created by connect() and destroyed by disconnect():
        self._rsn_oms = None

        # URL for the event listener registration/unregistration (based on
        # web server launched by ServiceGatewayService, since that's the
        # service in charge of receiving/relaying the OMS events).
        # NOTE: (as proposed long ago), this kind of functionality should
        # actually be provided by some component more in charge of the RSN
        # platform netwokr as a whole -- as opposed to platform-specific).
        self.listener_url = None
    def __init__(self, pnode, event_callback):
        """
        Creates an RSNPlatformDriver instance.

        @param pnode           Root PlatformNode defining the platform network
                               rooted at this platform.
        @param event_callback  Listener of events generated by this driver
        """
        PlatformDriver.__init__(self, pnode, event_callback)

        # CIOMSClient instance created by connect() and destroyed by disconnect():
        self._rsn_oms = None

        # URL for the event listener registration/unregistration (based on
        # web server launched by ServiceGatewayService, since that's the
        # service in charge of receiving/relaying the OMS events).
        # NOTE: (as proposed long ago), this kind of functionality should
        # actually be provided by some component more in charge of the RSN
        # platform netwokr as a whole -- as opposed to platform-specific).
        self.listener_url = None
Exemple #10
0
    def __init__(self, pnode, event_callback, create_event_subscriber,
                 destroy_event_subscriber):
        """
        Creates an RSNPlatformDriver instance.

        @param pnode           Root PlatformNode defining the platform network
                               rooted at this platform.
        @param event_callback  Listener of events generated by this driver

        @param create_event_subscriber
        @param destroy_event_subscriber
        """
        PlatformDriver.__init__(self, pnode, event_callback,
                                create_event_subscriber,
                                destroy_event_subscriber)

        # CIOMSClient instance created by connect() and destroyed by disconnect():
        self._rsn_oms = None

        # TODO(OOIION-1495) review the following. Commented out for the moment.
        # What does "ports that have devices attached" mean?
        """
        # Simple list of active ports in this deployment configuration:
        # (this should be all the ports that have devices attached. Used in go_active processing
        self._active_ports = []
        """

        # captured in validate_driver_configuration
        self._attributes = {}
        self._instr_port_map = {}

        # URL for the event listener registration/unregistration (based on
        # web server launched by ServiceGatewayService, since that's the
        # service in charge of receiving/relaying the OMS events).
        # NOTE: (as proposed long ago), this kind of functionality should
        # actually be provided by some component more in charge of the RSN
        # platform netwokr as a whole -- as opposed to platform-specific).
        self.listener_url = None

        # external event listener: created in _start_event_dispatch
        self._event_listener = None
    def __init__(self, pnode, event_callback,
                 create_event_subscriber, destroy_event_subscriber):
        """
        Creates an RSNPlatformDriver instance.

        @param pnode           Root PlatformNode defining the platform network
                               rooted at this platform.
        @param event_callback  Listener of events generated by this driver

        @param create_event_subscriber
        @param destroy_event_subscriber
        """
        PlatformDriver.__init__(self, pnode, event_callback,
                                create_event_subscriber, destroy_event_subscriber)

        # CIOMSClient instance created by connect() and destroyed by disconnect():
        self._rsn_oms = None

        # TODO(OOIION-1495) review the following. Commented out for the moment.
        # What does "ports that have devices attached" mean?
        """
        # Simple list of active ports in this deployment configuration:
        # (this should be all the ports that have devices attached. Used in go_active processing
        self._active_ports = []
        """

        # captured in validate_driver_configuration
        self._attributes = {}
        self._instr_port_map = {}

        # URL for the event listener registration/unregistration (based on
        # web server launched by ServiceGatewayService, since that's the
        # service in charge of receiving/relaying the OMS events).
        # NOTE: (as proposed long ago), this kind of functionality should
        # actually be provided by some component more in charge of the RSN
        # platform netwokr as a whole -- as opposed to platform-specific).
        self.listener_url = None

        # external event listener: created in _start_event_dispatch
        self._event_listener = None