View Javadoc

1   /****************************************************************************
2    * Copyright (c) 2005, 2006, 2007, 2008, 2009 Imola Informatica.
3    * All rights reserved. This program and the accompanying materials
4    * are made available under the terms of the LGPL License v2.1
5    * which accompanies this distribution, and is available at
6    * http://www.gnu.org/licenses/lgpl.html
7    ****************************************************************************/
8   package it.imolinfo.jbi4corba.jbi;
9   
10  import java.util.Properties;
11  
12  import javax.xml.namespace.QName;
13  
14  import org.apache.commons.lang.builder.EqualsBuilder;
15  import org.apache.commons.lang.builder.HashCodeBuilder;
16  import org.apache.commons.lang.builder.ReflectionToStringBuilder;
17  
18  /**
19   * JBIService Descriptor. Maps the configuratios that cen be read from the configuration WSDLs.
20   *
21   */
22  public class JbiServiceDescriptor {
23  
24      public static final String CONSUMER = "consumer";
25      public static final String PROVIDER = "provider";
26      /**
27       * This properties is a map from qualified service interface name to the
28       * service name. The service name is used for the corba servant localizatione
29       * and for the webservice creation.
30       */
31      private Properties serviceNames;
32      //common
33      private Properties orbProperties;
34      private String localizationType;
35      private Boolean persistent;
36      private String role;
37      private String idlFileNameDirectory;
38      private String idlFileName;
39      private String serviceNameSpace;
40      private String serviceName;
41      private String corbaServiceName;
42      // The portType Name
43      private QName portTypeName;
44      private String wsdlURL;
45  
46      /**
47       * Default constructor.
48       */
49      public JbiServiceDescriptor() {
50      }
51  
52      /**
53       * @return  The return
54       */
55      public String getIdlFileName() {
56          return idlFileName;
57      }
58  
59      /**
60       *@param idlFileName  The idl file name
61       */
62      public void setIdlFileName(String idlFileName) {
63          this.idlFileName = idlFileName;
64      }
65  
66      /**
67       * @return  The return
68       */
69      public String getIdlFileNameDirectory() {
70          return idlFileNameDirectory;
71      }
72  
73      /**
74       *@param idlFileNameDirectory  The idl file name directory
75       */
76      public void setIdlFileNameDirectory(String idlFileNameDirectory) {
77          this.idlFileNameDirectory = idlFileNameDirectory;
78      }
79  
80      /**
81       * @return  The return
82       */
83      public String getLocalizationType() {
84          return localizationType;
85      }
86  
87      /**
88       *@param localizationType  The localization type
89       */
90      public void setLocalizationType(String localizationType) {
91          this.localizationType = localizationType;
92      }
93  
94      /**
95       * @return  The return
96       */
97      public Properties getOrbProperties() {
98          return orbProperties;
99      }
100 
101     /**
102      *@param orbProperties  The orb properties
103      */
104     public void setOrbProperties(Properties orbProperties) {
105         this.orbProperties = orbProperties;
106     }
107 
108     /**
109      * @return  The return
110      */
111     public Properties getServiceNames() {
112         return serviceNames;
113     }
114 
115     /**
116      *@param serviceNames  The service names
117      */
118     public void setServiceNames(Properties serviceNames) {
119         this.serviceNames = serviceNames;
120     }
121 
122     /**
123      * @param name  The name
124      * @return      The return
125      */
126     public String getServiceName(String name) {
127         String serviceName = serviceNames.getProperty(name);
128         return serviceName;
129     }
130 
131     /**
132      * @return  The return
133      */
134     public String getServiceNameSpace() {
135         return serviceNameSpace;
136     }
137 
138     /**
139      *@param serviceNameSpace  The service names space
140      */
141     public void setServiceNameSpace(String serviceNameSpace) {
142         this.serviceNameSpace = serviceNameSpace;
143     }
144 
145     /**
146      * @return  The return
147      */
148     public String getRole() {
149         return role;
150     }
151 
152     /**
153      *@param role  The role
154      */
155     public void setRole(String role) {
156         this.role = role;
157     }
158 
159     /**
160      * @return  The return
161      */
162     public String getServiceName() {
163         return serviceName;
164     }
165 
166     /**
167      *@param serviceName  The service names
168      */
169     public void setServiceName(String serviceName) {
170         this.serviceName = serviceName;
171     }
172 
173     /**
174      * @return  The return
175      */
176     public String toString() {
177         return ReflectionToStringBuilder.toString(this);
178     }
179 
180     /**
181      * @param obj  The object
182      * @return     The return
183      */
184     public boolean equals(Object obj) {
185         return EqualsBuilder.reflectionEquals(this, obj);
186     }
187 
188     /**
189      * @return     The return
190      */
191     /* DO NOT IMPLEMENT THIS METHOD
192      * THE IMPLEMENTATION  DO NOT PERMIT THE CORRECT DEPLOY OF CONSUMER
193      */
194     /****************************************************
195 
196     public int hashCode() {
197     return HashCodeBuilder.reflectionHashCode(this);
198 
199     }
200      ******************************************************/
201     /**
202      * @return  The return
203      */
204     public String getCorbaServiceName() {
205         return corbaServiceName;
206     }
207 
208     /**
209      *@param corbaServiceName  The corba service name
210      */
211     public void setCorbaServiceName(String corbaServiceName) {
212         this.corbaServiceName = corbaServiceName;
213     }
214 
215     public QName getPortTypeName() {
216         return portTypeName;
217     }
218 
219     public void setPortTypeName(QName portTypeName) {
220         this.portTypeName = portTypeName;
221     }
222 
223     public String getWsdlURL() {
224         return wsdlURL;
225     }
226 
227     public void setWsdlURL(String wsdlURL) {
228         this.wsdlURL = wsdlURL;
229     }
230 
231     public Boolean isPersistent() {
232         return persistent;
233     }
234 
235     public void setPersistent(Boolean persistent) {
236         this.persistent = persistent;
237     }
238 }