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.config; 23 24 import java.util.Map; 25 26 import javax.security.auth.message.AuthException; 27 28 //$Id: ClientAuthConfig.java 45179 2006-05-23 20:18:57Z asaldhana $ 29 30 /** 31 * <p>This interface encapsulates the configuration of ClientAuthContext objects 32 * for a message layer and application context (e.g., the messaging context of a 33 * specific application, or set of applications).<p> 34 * <p>Implementations of this interface are returned by an AuthConfigProvider.</p> 35 * <p>Callers interact with a ClientAuthConfig to obtain ClientAuthContext objects 36 * suitable for processing a given message exchange at the layer and within the 37 * application context of the ClientAuthConfig. Each ClientAuthContext object is 38 * responsible for instantiating, initializing, and invoking the one or more 39 * ClientAuthModules encapsulated in the ClientAuthContext.</p> 40 * <p>After having acquired a ClientAuthContext, a caller operates on the context 41 * to cause it to invoke the encapsulated ClientAuthModules to secure client requests 42 * and to validate server responses.</p> 43 * 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 ClientAuthConfig extends AuthConfig 50 { 51 /** 52 * <p>Get a ClientAuthContext instance from this ClientAuthConfig.</p> 53 * <p>The implementation of this method returns a ClientAuthContext instance that 54 * encapsulates the ClientAuthModules used to secure and validate requests/responses 55 * associated with the given operation.</p> 56 * <p>Specifically, this method accesses this ClientAuthConfig object with the argument 57 * operation to determine the ClientAuthModules that are to be encapsulated in the 58 * returned ClientAuthContext instance.</p> 59 * <p>The ClientAuthConfig object establishes the request and response MessagePolicy 60 * objects that are passed to the encapsulated modules when they are initialized by the 61 * returned ClientAuthContext instance. It is the modules’ responsibility to enforce 62 * these policies when invoked.</p> 63 * 64 * @param operation an operation identifier used to index the provided config, or null. 65 * This value must be identical to the value returned by the getOperation 66 * method for all AuthParam objects passed to the secureRequest method 67 * of the returned ClientAuthContext. 68 * @param properties a Map object that may be used by the caller to augment the 69 * properties that will be passed to the encapsulated modules at module 70 * initialization. The null value may be passed for this parameter. 71 * @return a ClientAuthContext instance that encapsulates the ClientAuthModules used to 72 * secure and validate requests/responses associated with the given 73 * operation, or null (indicating that no modules are configured). 74 * @throws AuthException if this operation fails. 75 */ 76 public ClientAuthContext getAuthContext( String operation, Map properties) 77 throws AuthException; 78 } 79