Home » openejb-3.1.2-src » org.apache » openejb » spi » [javadoc | source]

    1   /**
    2    * Licensed to the Apache Software Foundation (ASF) under one or more
    3    * contributor license agreements.  See the NOTICE file distributed with
    4    * this work for additional information regarding copyright ownership.
    5    * The ASF licenses this file to You under the Apache License, Version 2.0
    6    * (the "License"); you may not use this file except in compliance with
    7    * the License.  You may obtain a copy of the License at
    8    *
    9    *     http://www.apache.org/licenses/LICENSE-2.0
   10    *
   11    * Unless required by applicable law or agreed to in writing, software
   12    * distributed under the License is distributed on an "AS IS" BASIS,
   13    * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   14    * See the License for the specific language governing permissions and
   15    * limitations under the License.
   16    */
   17   package org.apache.openejb.spi;
   18   
   19   import org.apache.openejb.InterfaceType;
   20   
   21   import javax.security.auth.login.LoginException;
   22   import java.lang.reflect.Method;
   23   import java.security.Principal;
   24   
   25   /**
   26    * The generic value T is any serializable token of the SecurityService
   27    * implementations choosing.   This token only needs to be understandable
   28    * by the SecurityService internally and need not be a publicly usable class
   29    * type.  No part of the outlying system will make any assumptions as to the
   30    * type of the object.  The use of a java generic type is to express the
   31    * required symmetry in the interface.  
   32    *
   33    */
   34   public interface SecurityService<T> extends Service {
   35       /**
   36        *
   37        */
   38       public T login(String user, String pass) throws LoginException;
   39   
   40       public T login(String securityRealm, String user, String pass) throws LoginException;
   41   
   42       /**
   43        * Active
   44        */
   45       public void associate(T securityIdentity) throws LoginException;
   46   
   47       /**
   48        * Active
   49        */
   50       public T disassociate();
   51   
   52       /**
   53        * Active
   54        */
   55       public void logout(T securityIdentity) throws LoginException;
   56   
   57       /**
   58        * Active
   59        */
   60       public boolean isCallerInRole(String role);
   61   
   62       /**
   63        * Implementors are encouraged to return a java.security.Principal
   64        * object that implements org.apache.openejb.spi.CallerPrincipal
   65        *
   66        * JAAS LoginModule implementors are encouraged to use the CallerPrincipal
   67        * interface to denote the best fitting Principal for getCallerPrincipal.
   68        */
   69       public Principal getCallerPrincipal();
   70   
   71       /**
   72        * Active
   73        */
   74       public boolean isCallerAuthorized(Method method, InterfaceType type);
   75   
   76   }

Home » openejb-3.1.2-src » org.apache » openejb » spi » [javadoc | source]