function mergeListenerToLB(lbs, listeners, callback) {
    // var lbs = dataObj.lbs;
    logutils.logger.debug('mergeListenerToLB');
    if (lbs['loadbalancers'].length > 0 && listeners != null
            && listeners.length > 0) {
        for (var lb = 0; lb < lbs['loadbalancers'].length; lb++) {
            var llistener_ref = lbs['loadbalancers'][lb]['loadbalancer']['loadbalancer-listener'];
            if (lbs['loadbalancers'][lb]['loadbalancer'] != null
                    && llistener_ref != null && llistener_ref.length > 0) {
                for (i = 0; i < llistener_ref.length; i++) {
                    for (var l = 0; l < listeners.length; l++) {
                        if (llistener_ref[i]['uuid'] == listeners[l]['loadbalancer-listener']['uuid']) {
                            llistener_ref[i] = listeners[l]['loadbalancer-listener'];
                        }
                    }
                }
            }
        }
    }
    var jsonstr = JSON.stringify(lbs);
    var new_jsonstr = jsonstr.replace(/loadbalancer_pool_back_refs/g,
            'loadbalancer-pool');
    lbs = JSON.parse(new_jsonstr);
    callback(lbs);
}
/**
 * @mergeListenerToLB
 * @private function Return call back it process listeners info and merge it to
 *          load-balancer.
 * @param lbs
 * @param listeners
 * @param callback
 * @returns
 */
@mergeListenerToLB
@private function Return call back it process listeners info and merge it to
load-balancer.
@mergeListenerToLB @private function Return call back it process listeners info and merge it to load - balancer .
function mergeListenerToLB(lbs, listeners, callback) {
    logutils.logger.debug('mergeListenerToLB');
    if (lbs['loadbalancers'].length > 0 && listeners != null
            && listeners.length > 0) {
        for (var lb = 0; lb < lbs['loadbalancers'].length; lb++) {
            var llistener_ref = lbs['loadbalancers'][lb]['loadbalancer']['loadbalancer-listener'];
            if (lbs['loadbalancers'][lb]['loadbalancer'] != null
                    && llistener_ref != null && llistener_ref.length > 0) {
                for (i = 0; i < llistener_ref.length; i++) {
                    for (var l = 0; l < listeners.length; l++) {
                        if (llistener_ref[i]['uuid'] == listeners[l]['loadbalancer-listener']['uuid']) {
                            llistener_ref[i] = listeners[l]['loadbalancer-listener'];
                        }
                    }
                }
            }
        }
    }
    var jsonstr = JSON.stringify(lbs);
    var new_jsonstr = jsonstr.replace(/loadbalancer_pool_back_refs/g,
            'loadbalancer-pool');
    lbs = JSON.parse(new_jsonstr);
    callback(lbs);
}
function mergeListenerToLB ( lbs , listeners , callback ) { logutils . logger . debug ( 'mergeListenerToLB' ) ; if ( lbs [ 'loadbalancers' ] . length > 0 && listeners != null && listeners . length > 0 ) { for ( var lb = 0 ; lb < lbs [ 'loadbalancers' ] . length ; lb ++ ) { var llistener_ref = lbs [ 'loadbalancers' ] [ lb ] [ 'loadbalancer' ] [ 'loadbalancer-listener' ] ; if ( lbs [ 'loadbalancers' ] [ lb ] [ 'loadbalancer' ] != null && llistener_ref != null && llistener_ref . length > 0 ) { for ( i = 0 ; i < llistener_ref . length ; i ++ ) { for ( var l = 0 ; l < listeners . length ; l ++ ) { if ( llistener_ref [ i ] [ 'uuid' ] == listeners [ l ] [ 'loadbalancer-listener' ] [ 'uuid' ] ) { llistener_ref [ i ] = listeners [ l ] [ 'loadbalancer-listener' ] ; } } } } } } var jsonstr = JSON . stringify ( lbs ) ; var new_jsonstr = jsonstr . replace ( / loadbalancer_pool_back_refs / g , 'loadbalancer-pool' ) ; lbs = JSON . parse ( new_jsonstr ) ; callback ( lbs ) ; }
@mergeListenerToLB
 @private function Return call back it process listeners info and merge it to
          load-balancer.
@mergeListenerToLB @private function Return call back it process listeners info and merge it to load - balancer .
// var lbs = dataObj.lbs;