/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package net.pascalalma.mybusinessservices;

import javax.ejb.EJB;
import javax.ejb.Stateless;
import net.pascalalma.model.Customer;
import net.pascalalma.myservices.CustomerServiceLocal;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 *
 * @author pascal
 */
@Stateless(name="CustomerBusinessService")
//@WebService( endpointInterface = "net.pascalalma.mybusinessservices.CustomerBusinessServiceRemote"
//           , serviceName = "CustomerBusinessService")
public class CustomerBusinessServiceBean implements CustomerBusinessServiceRemote
{

    private Logger log;

    @EJB 
    private CustomerServiceLocal cs;


    public CustomerBusinessServiceBean() {
        log = LoggerFactory.getLogger(getClass());
    }

    public void validateCustomer(String custId) {

        // Check if the customer is known and credible

        // Get customer by id
        Customer c = cs.findCustomer( 1);//cust.getId());

        log.info("customer found = " + c);

        if (c == null)
        {
           // throw exception
        }

        // Get credit limit for customer


    }

}

