KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > enterprise > security > jauth > SOAPAuthParam


1 /*
2  * The contents of this file are subject to the terms
3  * of the Common Development and Distribution License
4  * (the License). You may not use this file except in
5  * compliance with the License.
6  *
7  * You can obtain a copy of the license at
8  * https://glassfish.dev.java.net/public/CDDLv1.0.html or
9  * glassfish/bootstrap/legal/CDDLv1.0.txt.
10  * See the License for the specific language governing
11  * permissions and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL
14  * Header Notice in each file and include the License file
15  * at glassfish/bootstrap/legal/CDDLv1.0.txt.
16  * If applicable, add the following below the CDDL Header,
17  * with the fields enclosed by brackets [] replaced by
18  * you own identifying information:
19  * "Portions Copyrighted [year] [name of copyright owner]"
20  *
21  * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
22  */

23
24 package com.sun.enterprise.security.jauth;
25
26 import javax.xml.soap.*;
27
28 /**
29   * SOAP authentication parameter.
30   *
31   * <p> An instance of SOAPAuthParam may be created with a null response object
32   * (for example during a call to
33   * <code>ServerAuthContext.validateRequest</code>).
34   * If so, a response object may be created as necessary (by modules),
35   * and set into the SOAPAuthParam via the <code>setResponse</code> method.
36   *
37   * <p> An instance of SOAPAuthParam may also be created with a null
38   * request object (for example during a call to
39   * <code>ServerAuthContext.secureResponse</code>).
40   *
41   * @version 1.12, 06/08/04
42   */

43 public class SOAPAuthParam implements AuthParam {
44
45      private SOAPMessage request;
46      private SOAPMessage response;
47
48      /**
49       * Create a SOAPAuthParam.
50       *
51       * @param request the SOAP request object, which may be null.
52       * @param response the SOAP response object, which may be null.
53       */

54      public SOAPAuthParam(SOAPMessage request, SOAPMessage response) {
55          this.request = request;
56          this.response = response;
57      }
58
59      /**
60       * Return the SOAP request object.
61       *
62       * @return the SOAP request object, which may be null.
63       */

64      public SOAPMessage getRequest() {
65          return request;
66      }
67
68      /**
69       * Return the SOAP response object.
70       *
71       * @return the SOAP response object, which may be null.
72       */

73      public SOAPMessage getResponse() {
74          return response;
75      }
76
77      /**
78       * Set the SOAP response object.
79       *
80       * <p> If a response has already been set (it is non-null),
81       * this method does nothing. The original response is not overwritten.
82       *
83       * @param response the SOAP response object.
84       */

85      public void setResponse(SOAPMessage response) {
86          if (this.response == null) {
87              this.response = response;
88          }
89      }
90 }
91
Popular Tags