View Javadoc

1   /**********************************************************************
2    * EJOEOperation.java
3    * created on 12.07.2006 by netseeker
4    * $Source$
5    * $Date$
6    * $Revision$
7    *
8    * ====================================================================
9    *
10   *  Copyright 2006 netseeker aka Michael Manske
11   *
12   *  Licensed under the Apache License, Version 2.0 (the "License");
13   *  you may not use this file except in compliance with the License.
14   *  You may obtain a copy of the License at
15   *
16   *      http://www.apache.org/licenses/LICENSE-2.0
17   *
18   *  Unless required by applicable law or agreed to in writing, software
19   *  distributed under the License is distributed on an "AS IS" BASIS,
20   *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
21   *  See the License for the specific language governing permissions and
22   *  limitations under the License.
23   * ====================================================================
24   *
25   * This file is part of the EJOE framework.
26   * For more information on the author, please see
27   * <http://www.manskes.de/>.
28   *
29   *********************************************************************/
30  
31  package de.netseeker.ejoe.ext.wsif.wsdl;
32  
33  import java.io.Serializable;
34  import java.util.List;
35  
36  import javax.wsdl.extensions.ExtensibilityElement;
37  import javax.xml.namespace.QName;
38  
39  import com.ibm.wsdl.util.StringUtils;
40  
41  /***
42   * WSDL extension for the ejoe:operation element. Example:
43   * 
44   * <pre>
45   *        &lt;operation name=&quot;getAddressFromName&quot;&gt;
46   *        	&lt;ejoe:operation
47   *        		className=&quot;de.netseeker.ejoe.test.service.AddressBookImpl&quot;
48   *        		methodName=&quot;getAddressFromName&quot; parameterOrder=&quot;name&quot;
49   *        		invocationType=&quot;reflection&quot; returnPart=&quot;address&quot; /&gt;
50   *        	&lt;input name=&quot;GetAddressFromNameRequest&quot; /&gt;
51   *        	&lt;output name=&quot;GetAddressFromNameResponse&quot; /&gt;
52   *        &lt;/operation&gt;
53   * </pre>
54   * 
55   * @author netseeker
56   * @since 0.3.9.1
57   */
58  public class EJOEOperation implements ExtensibilityElement, Serializable
59  {
60      private static final long serialVersionUID = 1L;
61  
62      protected QName           fieldElementType = EJOEBindingConstants.Q_ELEM_EJOE_OPERATION;
63  
64      protected Boolean         fieldRequired;
65  
66      protected String          fieldClassName;
67  
68      protected String          fieldMethodName;
69  
70      protected String          invocationType;
71  
72      protected List            fieldParameterOrder;
73  
74      protected String          fieldReturnPart;
75  
76      /***
77       * Get the type of this extensibility element.
78       * 
79       * @return the extensibility element's type
80       */
81      public QName getElementType()
82      {
83          return fieldElementType;
84      }
85  
86      /***
87       * @return Returns the invocationType.
88       */
89      public String getInvocationType()
90      {
91          return invocationType;
92      }
93  
94      /***
95       * @param invocationType The invocationType to set.
96       */
97      public void setInvocationType( String invocationType )
98      {
99          this.invocationType = invocationType;
100     }
101 
102     public String getMethodName()
103     {
104         return fieldMethodName;
105     }
106 
107     public List getParameterOrder()
108     {
109         return fieldParameterOrder;
110     }
111 
112     public String getReturnPart()
113     {
114         return fieldReturnPart;
115     }
116 
117     /***
118      * Get whether or not the semantics of this extension are required. Relates to the wsdl:required attribute.
119      */
120     public Boolean getRequired()
121     {
122         return fieldRequired;
123     }
124 
125     /***
126      * Set the type of this extensibility element.
127      * 
128      * @param elementType the type
129      */
130     public void setElementType( QName elementType )
131     {
132         fieldElementType = elementType;
133     }
134 
135     public void setMethodName( String newMethodName )
136     {
137         fieldMethodName = newMethodName;
138     }
139 
140     public void setParameterOrder( String newParameterOrderStr )
141     {
142         if ( newParameterOrderStr != null )
143         {
144             fieldParameterOrder = StringUtils.parseNMTokens( newParameterOrderStr );
145         }
146     }
147 
148     public void setReturnPart( String newReturnPart )
149     {
150         fieldReturnPart = newReturnPart;
151     }
152 
153     /***
154      * @return the className
155      */
156     public String getClassName()
157     {
158         return fieldClassName;
159     }
160 
161     /***
162      * @param className the className to set
163      */
164     public void setClassName( String className )
165     {
166         this.fieldClassName = className;
167     }
168 
169     /***
170      * Set whether or not the semantics of this extension are required. Relates to the wsdl:required attribute.
171      */
172     public void setRequired( Boolean required )
173     {
174         fieldRequired = required;
175     }
176 
177     public String toString()
178     {
179         StringBuffer strBuf = new StringBuffer( super.toString() );
180 
181         strBuf.append( "\nEJOEOperation (" + fieldElementType + "):" );
182         strBuf.append( "\nrequired=" + fieldRequired );
183         strBuf.append( "\nclassName=" + fieldClassName );
184         strBuf.append( "\nmethodName=" + fieldMethodName );
185         strBuf.append( "\ninvocationType=" + invocationType );
186         strBuf.append( "\nparameterOrder=" + fieldParameterOrder );
187         strBuf.append( "\nreturnPart=" + fieldReturnPart );
188 
189         return strBuf.toString();
190     }
191 }