 /*
 * Generated by XDoclet - Do not edit!
 * this class must be processed by xdoclet in the second run!!!!
 */
package com.apoapsis.wanbus.ejb.cmp;

import java.util.*;

/**
 * Session facade for RuleDef.
 * @author $Author: james $
 * @version $Revision: 1.5 $

*  @ejb.bean name="RuleDefFacade"
*	type="Stateless"
*       view-type="remote"
* 	jndi-name="ejb/RuleDefFacade"
* 	local-jndi-name="RuleDefFacadeLocal"
*
* @ejb.ejb-ref ejb-name="RuleDef" view-type="local"
* @ejb.util generate="physical"
* @ejb.remote-facade
*/
public abstract class RuleDefFacadeEJB implements javax.ejb.SessionBean
{

   private javax.ejb.SessionContext _ctx;

   private com.apoapsis.wanbus.ejb.interfaces.RuleDefLocalHome getLocalHome() throws javax.naming.NamingException
   {
      return com.apoapsis.wanbus.ejb.interfaces.RuleDefUtil.getLocalHome();
   }

   // finder methods

/**
 * @ejb.interface-method
 * @ejb.facade-method
 * @ejb.permission role-name="rule-admin"
*/
	  public java.util.Collection findByParentId(java.lang.Integer parentId) throws javax.ejb.FinderException,  javax.naming.NamingException{
	  	 java.util.Collection selected = getLocalHome().findByParentId( parentId );

		 	ArrayList retval = new ArrayList(selected.size());
		 	for(Iterator i = selected.iterator(); i.hasNext();) {
			   retval.add(((com.apoapsis.wanbus.ejb.interfaces.RuleDefLocal)i.next()).getData());
			}

		 return retval;
	  }

/**
 * @ejb.interface-method
 * @ejb.facade-method
 * @ejb.permission role-name="rule-admin"
*/
	  public java.util.Collection findRootRules() throws javax.ejb.FinderException,  javax.naming.NamingException{
	  	 java.util.Collection selected = getLocalHome().findRootRules(  );

		 	ArrayList retval = new ArrayList(selected.size());
		 	for(Iterator i = selected.iterator(); i.hasNext();) {
			   retval.add(((com.apoapsis.wanbus.ejb.interfaces.RuleDefLocal)i.next()).getData());
			}

		 return retval;
	  }

/**
 * @ejb.interface-method
 * @ejb.facade-method
 * @ejb.permission role-name="rule-admin"
*/
	   public com.apoapsis.wanbus.ejb.interfaces.RuleDefData findByPrimaryKey(java.lang.Integer pk) throws javax.ejb.FinderException,  javax.naming.NamingException {
	  	 com.apoapsis.wanbus.ejb.interfaces.RuleDefLocal selected = getLocalHome().findByPrimaryKey( pk );

		        com.apoapsis.wanbus.ejb.interfaces.RuleDefData retval = selected.getData();

		 return retval;
	  }

// create methods

   /**
    * @ejb.interface-method
    * @ejb.facade-method invalidate="true"

    * @ejb.permission role-name="rule-admin"

    */

   public com.apoapsis.wanbus.ejb.interfaces.RuleDefData create()
   throws javax.ejb.CreateException , java.rmi.RemoteException ,  javax.naming.NamingException
   {
   	return getLocalHome().create().getData();
   }

// update method
   /**
    * @ejb.interface-method
    * @ejb.facade-method invalidate="true"

    * @ejb.permission role-name="rule-admin"

     */
   public com.apoapsis.wanbus.ejb.interfaces.RuleDefData update(com.apoapsis.wanbus.ejb.interfaces.RuleDefData data)
   	throws java.rmi.RemoteException, javax.ejb.FinderException ,  javax.naming.NamingException
   {
   com.apoapsis.wanbus.ejb.interfaces.RuleDefLocal obj = 	getLocalHome().findByPrimaryKey(data.getPrimaryKey());
      obj.setData(data);
      return obj.getData();
   }

//remove method

	/**
	* @ejb.create-method
	* @ejb.permission unchecked="true"
	*/
	public void ejbCreate() throws javax.ejb.CreateException {
	}

	public void setSessionContext(javax.ejb.SessionContext ctx) {
		_ctx = ctx;
	}

}
