LdapGroupMembers.java :  » Workflow-Engines » bonita-v3.1 » hero » initiatorMapper » Java Open Source

Java Open Source » Workflow Engines » bonita v3.1 
bonita v3.1 » hero » initiatorMapper » LdapGroupMembers.java
/**
 *
 * Bonita
 * Copyright (C) 1999 Bull S.A.
 * Bull 68 route de versailles  78434 Louveciennes Cedex France
 * Further information: bonita@objectweb.org
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
 * USA
 *
 *
--------------------------------------------------------------------------
 * $Id: LdapGroupMembers.java,v 1.1 2005/08/29 13:50:28 mvaldes Exp $
 *
--------------------------------------------------------------------------
 */

package hero.initiatorMapper;

import hero.util.HeroException;

// Use of BnLdap session Bean
import hero.interfaces.BnLdap;
import hero.interfaces.BnLdapHome;
import hero.interfaces.BnLdapUtil;
import hero.interfaces.BnProjectLocal;

import java.util.*;


public class LdapGroupMembers implements hero.initiatorMapper.InitiatorMapperI {

    public Collection searchMembers(Object b,BnProjectLocal n, String userName) throws HeroException {
    
      String intiatorMapperName = n.getBnInitiatorMapper().getName();
      String projectName = n.getName();
//debug      
//System.out.println("[Search Group Members] IntiatorMapper Name:"+intiatorMapperName + " - Project name = " + projectName);
    ArrayList al =null;
    
    BnLdapHome home = null;
    try {
      home = BnLdapUtil.getHome();          
    } catch (Exception e) {
        System.err.println( "Cannot lookup BnLdapHome: " + e);
        System.exit(2);
    }
  
    BnLdap t1 = null;
    try {
// logs trace
//System.out.println("Create a bean bnLdap");
        t1 = home.create();
    } catch (Exception e) {
      throw new HeroException("Cannot create  BnLdapBean : " + e);
    }
    try {
    al = (ArrayList)t1.getGroupMembers(intiatorMapperName);
    } catch (Exception e){
      throw new HeroException("Error getting group members for group: " + intiatorMapperName + " " + e.getMessage());
    }
    return al;
        
    } 

}















java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.