コード例 #1
0
    def getNotificationFactoryNameForChannel(self,channel,domain=None):
        '''
        This method returns the name of the notification service for the channel
        or domain from the configuration information given in the CDB.

        Parameters:
        - channel is the channel name of the desired factory
        - domain is the domain of the desired factory

        Returns: string containing the factory name or None

        Raises: Nothing
        '''

        if channel is not None:
            crec = [ chan for chan in get_notification_service_mapping('Channel') if wildcharMatch(chan['Name'], channel)]
            if crec != []:
                return crec[0]['NotificationService']

        if domain is not None:
            crec = [ chan for chan in get_notification_service_mapping('Domain') if wildcharMatch(chan['Name'], domain)]
            if crec != []:
                return crec[0]['NotificationService']

        crec = get_notification_service_mapping('Default')
        if crec != []:
            return crec[0]['DefaultNotificationService']
        else:
            return None
コード例 #2
0
ファイル: CommonNC.py プロジェクト: franciscobeltran/ACS
    def getNotificationFactoryNameForChannel(self,channel,domain=None):
        '''
        This method returns the name of the notification service for the channel
        or domain from the configuration information given in the CDB.

        Parameters:
        - channel is the channel name of the desired factory
        - domain is the domain of the desired factory

        Returns: string containing the factory name or None

        Raises: Nothing
        '''
        temp=""
        if channel is not None:
            crec = [ chan for chan in get_notification_service_mapping('Channel') if wildcharMatch(chan['Name'], channel)]
            if crec != []:
                temp=crec[0]['NotificationService']

        if len(temp)==0 and (domain is not None):
            crec = [ chan for chan in get_notification_service_mapping('Domain') if wildcharMatch(chan['Name'], domain)]
            if crec != []:
                temp=crec[0]['NotificationService']

        if len(temp)==0:
            crec = get_notification_service_mapping('Default')
            if crec != []:
                temp=crec[0]['DefaultNotificationService']
            else:
                return None
            
        if not temp.endswith(acscommon.NOTIFICATION_FACTORY_NAME):
            return temp+acscommon.NOTIFICATION_FACTORY_NAME
        else:
            return temp
コード例 #3
0
    def getNotificationFactoryNameForChannel(self, channel, domain=None):
        '''
        This method returns the name of the notification service for the channel
        or domain from the configuration information given in the CDB.

        Parameters:
        - channel is the channel name of the desired factory
        - domain is the domain of the desired factory

        Returns: string containing the factory name or None

        Raises: Nothing
        '''
        temp = ""
        if channel is not None:
            crec = [
                chan for chan in get_notification_service_mapping('Channel')
                if wildcharMatch(chan['Name'], channel)
            ]
            if crec != []:
                temp = crec[0]['NotificationService']

        if len(temp) == 0 and (domain is not None):
            crec = [
                chan for chan in get_notification_service_mapping('Domain')
                if wildcharMatch(chan['Name'], domain)
            ]
            if crec != []:
                temp = crec[0]['NotificationService']

        if len(temp) == 0:
            crec = get_notification_service_mapping('Default')
            if crec != []:
                temp = crec[0]['DefaultNotificationService']
            else:
                return None

        if not temp.endswith(acscommon.NOTIFICATION_FACTORY_NAME):
            return temp + acscommon.NOTIFICATION_FACTORY_NAME
        else:
            return temp