View Javadoc

1   /**********************************************************************
2    * EJOEAddress.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 de.netseeker.ejoe.ext.wsif.wsdl 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  
35  import javax.wsdl.extensions.ExtensibilityElement;
36  import javax.xml.namespace.QName;
37  
38  /***
39   * WSDL binding for the ejoe:address element. Example:
40   * 
41   * <pre>
42   *  &lt;ejoe:address
43   *  		adapterClass=&quot;de.netseeker.ejoe.adapter.XStreamAdapter&quot;
44   * 		ejoeServerURL=&quot;socket://localhost:12577&quot; useCompression=&quot;false&quot;
45   * 		usePersistentConnection=&quot;false&quot; timeout=&quot;500000&quot;/&gt;
46   *  &lt;pre&gt;
47   *  @author netseeker
48   *  @since 0.3.9.1
49   * 
50   */
51  public class EJOEAddress implements ExtensibilityElement, Serializable
52  {
53      private static final long serialVersionUID        = 1L;
54  
55      protected QName           fieldElementType        = EJOEBindingConstants.Q_ELEM_EJOE_ADDRESS;
56  
57      protected Boolean         fieldRequired;
58  
59      protected String          ejoeServerURL;
60  
61      protected String          adapterClass;
62  
63      protected boolean         usePersistentConnection = true;
64  
65      protected boolean         useCompression          = false;
66  
67      protected int             timeout;
68  
69      /*
70       * (non-Javadoc)
71       * 
72       * @see javax.wsdl.extensions.ExtensibilityElement#setElementType(javax.xml.namespace.QName)
73       */
74      public void setElementType( QName elementType )
75      {
76          fieldElementType = elementType;
77      }
78  
79      /*
80       * (non-Javadoc)
81       * 
82       * @see javax.wsdl.extensions.ExtensibilityElement#getElementType()
83       */
84      public QName getElementType()
85      {
86          return fieldElementType;
87      }
88  
89      /*
90       * (non-Javadoc)
91       * 
92       * @see javax.wsdl.extensions.ExtensibilityElement#setRequired(java.lang.Boolean)
93       */
94      public void setRequired( Boolean required )
95      {
96          fieldRequired = required;
97      }
98  
99      /*
100      * (non-Javadoc)
101      * 
102      * @see javax.wsdl.extensions.ExtensibilityElement#getRequired()
103      */
104     public Boolean getRequired()
105     {
106         return fieldRequired;
107     }
108 
109     /***
110      * @return Returns the ejoeServerURL.
111      */
112     public String getEjoeServerURL()
113     {
114         return ejoeServerURL;
115     }
116 
117     /***
118      * @param ejoeServerURL The ejoeServerURL to set.
119      */
120     public void setEjoeServerURL( String ejoeServerURL )
121     {
122         this.ejoeServerURL = ejoeServerURL;
123     }
124 
125     /***
126      * @return Returns the adapterClass.
127      */
128     public String getAdapterClass()
129     {
130         return adapterClass;
131     }
132 
133     /***
134      * @param adapterClass The adapterClass to set.
135      */
136     public void setAdapterClass( String adapterClass )
137     {
138         this.adapterClass = adapterClass;
139     }
140 
141     /***
142      * @return Returns the useCompression.
143      */
144     public boolean getUseCompression()
145     {
146         return useCompression;
147     }
148 
149     /***
150      * @param useCompression The useCompression to set.
151      */
152     public void setUseCompression( boolean useCompression )
153     {
154         this.useCompression = useCompression;
155     }
156 
157     /***
158      * @return Returns the usePersistentConnection.
159      */
160     public boolean getUsePersistentConnection()
161     {
162         return usePersistentConnection;
163     }
164 
165     /***
166      * @param usePersistentConnection The usePersistentConnection to set.
167      */
168     public void setUsePersistentConnection( boolean usePersistentConnection )
169     {
170         this.usePersistentConnection = usePersistentConnection;
171     }
172 
173     /***
174      * @return the timeout
175      */
176     public int getTimeout()
177     {
178         return timeout;
179     }
180 
181     /***
182      * @param timeout the timeout to set
183      */
184     public void setTimeout( int timeout )
185     {
186         this.timeout = timeout;
187     }
188 
189     public String toString()
190     {
191         StringBuffer strBuf = new StringBuffer( super.toString() );
192 
193         strBuf.append( "\nEJOEAddress (" + fieldElementType + "):" );
194         strBuf.append( "\nrequired=" + fieldRequired );
195         strBuf.append( "\nejoeServerURL=" + ejoeServerURL );
196         strBuf.append( "\nadapterClass=" + adapterClass );
197         strBuf.append( "\nusePersistentConnection=" + usePersistentConnection );
198         strBuf.append( "\nuseCompression=" + useCompression );
199         strBuf.append( "\ntimeout=" + (timeout > 0 ? String.valueOf( timeout ) : "using default timeout") );
200 
201         return strBuf.toString();
202     }
203 }