KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > javax > security > auth > message > module > ServerAuthModule


1 /*
2   * JBoss, Home of Professional Open Source
3   * Copyright 2005, JBoss Inc., and individual contributors as indicated
4   * by the @authors tag. See the copyright.txt in the distribution for a
5   * full listing of individual contributors.
6   *
7   * This is free software; you can redistribute it and/or modify it
8   * under the terms of the GNU Lesser General Public License as
9   * published by the Free Software Foundation; either version 2.1 of
10   * the License, or (at your option) any later version.
11   *
12   * This software is distributed in the hope that it will be useful,
13   * but WITHOUT ANY WARRANTY; without even the implied warranty of
14   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15   * Lesser General Public License for more details.
16   *
17   * You should have received a copy of the GNU Lesser General Public
18   * License along with this software; if not, write to the Free
19   * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20   * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
21   */

22 package javax.security.auth.message.module;
23
24 import java.util.Map JavaDoc;
25
26 import javax.security.auth.callback.CallbackHandler JavaDoc;
27 import javax.security.auth.message.AuthException;
28 import javax.security.auth.message.MessagePolicy;
29 import javax.security.auth.message.ServerAuth;
30
31 //$Id: ServerAuthModule.java 45179 2006-05-23 20:18:57Z asaldhana $
32

33 /**
34  * <p>A ServerAuthModule validates client requests and secures responses
35  * back to the client.</p>
36  * <p>A module implementation should assume it may be used to secure different
37  * requests as different clients. A module should also assume it may be used
38  * concurrently by multiple callers. It is the module implementation’s responsibility
39  * to properly save and restore any state as necessary. A module that does not need
40  * to do so may remain completely stateless. Every implementation of the interface
41  * must provide a public zero argument contructor.</p>
42  *
43  * @author <a HREF="mailto:Anil.Saldhana@jboss.org">Anil Saldhana</a>
44  * @author Charlie Lai, Ron Monzillo (Javadoc for JSR-196)</a>
45  * @since May 12, 2006
46  * @version $Revision: 45179 $
47  */

48 public interface ServerAuthModule extends ServerAuth
49 {
50    /**
51     * Get the one or more Class objects representing the message
52     * types supported by the module.
53     * @return an array of Class objects where each element defines a message
54     * type supported by the module. A module should return an array
55     * containing at least one element. An empty array indicates that the
56     * module will attempt to support any message type. This method never
57     * returns null.
58     */

59    public java.lang.Class JavaDoc[] getSupportedMessageTypes();
60    
61    /**
62     * <p>Initialize this module with request and response message policies to
63     * enforce, a CallbackHandler, and any module-specific configuration
64     * properties.</p>
65     * <p>The request policy and the response policy must not both be null.</p>
66     *
67     * @param requestPolicy the request policy this module must enforce, or null.
68     * @param responsePolicy the response policy this module must enforce, or null.
69     * @param handler CallbackHandler used to request information.
70     * @param options a Map of module-specific configuration properties.
71     * @throws AuthException - if module initialization fails, including for the case
72     * where the options argument contains elements that are
73     * not supported by the module.
74     */

75    public void initialize(MessagePolicy requestPolicy, MessagePolicy responsePolicy,
76          CallbackHandler JavaDoc handler, Map JavaDoc options) throws AuthException;
77 }
78
Popular Tags