KickJava   Java API By Example, From Geeks To Geeks.

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


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.ClientAuth;
29 import javax.security.auth.message.MessagePolicy;
30
31 /**
32  * <p>A ClientAuthModule secures request messages, and validates received
33  * response messages.</p>
34  * <p>A module implementation should assume it may be used to secure different
35  * requests as different clients. A module should also assume it may be used
36  * concurrently by multiple callers. It is the module implementation’s responsibility
37  * to properly save and restore any state as necessary. A module that does not need
38  * to do so may remain completely stateless. </p>
39  *
40  * <p>Every implementation of the interface must provide a public zero argument
41  * contructor.</p>
42  *
43  * @see ClientAuthContext
44  * @author <a HREF="mailto:Anil.Saldhana@jboss.org">Anil Saldhana</a>
45  * @author Charlie Lai, Ron Monzillo (Javadoc for JSR-196)</a>
46  * @since May 12, 2006
47  * @version $Revision: 45179 $
48  */

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

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

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