/*
 * JOnAS: Java(TM) Open Application Server
 * Copyright (C) 1999 Bull S.A.
 * Contact: jonas-team@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$
 * --------------------------------------------------------------------------
 */

// BaseS.java

package org.objectweb.jonas.jtests.beans.secured;

import java.util.Hashtable;
import java.rmi.RemoteException;
import javax.ejb.EJBObject;

/**
 * This is the base interface, implemented by all beans
 */
public interface BaseS extends EJBObject {
    public String getPrincipalName() throws RemoteException;
    public String getPrincipalNameOfAnotherBean() throws RemoteException;

    public boolean isCallerInRole(String role) throws RemoteException;
    public void simpleMethod() throws RemoteException;
    public void complexMethod(Hashtable h, Object[] o) throws RemoteException;
    public boolean callAnotherMethod() throws RemoteException; 

    public int getTimerCount() throws RemoteException;
    public int setTimer(int duration, int period, int action) throws RemoteException;

    // runAs methods

    // Execute a method without runAs on the derived bean
    public boolean callBeanNoRunAsWithRole1() throws RemoteException;

    // Execute a method with being executed in a runas mode on a no-runAs derived bean
    // It must fail as it will call a method with the bad role
    public boolean callBeanNoRunAsWithRole2() throws RemoteException;


    // Execute a method without being in runAs mode on a runAs derived bean
    public boolean callBeanRunAsWithRole1() throws RemoteException;

    // Execute a method without being in runAs mode on a runAs derived bean
    public boolean callBeanRunAsWithRole2() throws RemoteException;

    /**
     * This method is in excluded list in DD 
     * @throws RemoteException if access failed
     */
    public void excludedMethod() throws RemoteException;

}


