def _get_netscaler_node_from_service_and_servicebinding(self, loadBalancerId, loadBalancer, service, servicebinding):

        node = LBNodeState(self.lbresource)

        service_name = service["name"] 

        node.id = NitroUtils.get_nodeid_from_servicename(loadBalancerId, service_name)

        if "ipaddress" in service and service["ipaddress"]:
            ipaddress = service["ipaddress"]
            ipaddress = ipaddress.encode('ascii', 'ignore')
            node.address = ipaddress


        if "port" in service and service["port"]:
            port = service["port"]
            port = str(port)
            node.port = port 

                     
        if "svrstate" in service and service["svrstate"]:
            svrstate =  service["svrstate"]
            
            node.condition = NitroUtils.get_condition_from_svrstate(svrstate)
            node.status = NitroUtils.get_nodestatus_from_svrstate(svrstate)


        if "weight" in servicebinding and servicebinding["weight"]:
            weight = servicebinding["weight"]
            node.weight = str(weight)


        self.logger.debug("returned node is: %s" % node)

        return node
    def _get_netscaler_node_currentcondition(self, loadBalancerId, loadBalancer, nodeId):

        service_name = NitroUtils.get_servicename_from_nodeid(loadBalancerId, nodeId)

        service = self.nitrowrapper.get_netscaler_entity("service", service_name)

        svrstate = service["svrstate"]

        current_condition = NitroUtils.get_condition_from_svrstate(svrstate)

        return current_condition