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.webservice.generator;
9   import it.imolinfo.jbi4corba.Logger;
10  import it.imolinfo.jbi4corba.LoggerFactory;
11  import it.imolinfo.jbi4corba.jbi.Messages;
12  
13  import java.util.Properties;
14  
15  /**
16   * Descriptor to incapsulate all fields required to generate a WSDL file
17   * starting from an IDL (CORBA) file.
18   *
19   * @author  <a href="mailto:mcimatti@imolinfo.it">Marco Cimatti</a>
20   */
21  public class WSDLDescriptor {
22  
23      private final String corbaServiceName;
24  
25      private final String localizationType;
26      
27      private final String namespace;
28  
29      private final String endpointName;
30  
31      private Properties orbProperties;
32      
33      private boolean persistentConsumer=false;
34  
35      /** The logger. */
36      private static final Logger LOG = 
37      	LoggerFactory.getLogger(WSDLDescriptor.class);
38      private static final Messages MESSAGES = 
39      	Messages.getMessages(WSDLDescriptor.class);
40  
41      /**
42       * 
43       * @param corbaServiceName  The corba service name
44       * @param localizationType  The Localization Type
45       * @param namespace         The name space
46       * @param endpointName      The endpoint name
47       */
48      public WSDLDescriptor(String corbaServiceName, String localizationType,
49                            String namespace, String endpointName) {
50          if (corbaServiceName == null) {
51          	String msg=MESSAGES.getString("CRB000567_Corba_Service_Name_null");
52              LOG.error(msg);
53              throw new NullPointerException(msg);
54          }
55          if (localizationType == null) {
56          	String msg=MESSAGES.getString("CRB000568_Localization_Type_null");
57              LOG.error(msg);
58              throw new NullPointerException(msg);
59          }
60          if (namespace == null) {
61          	String msg=MESSAGES.getString("CRB000569_Namespace_null");
62              LOG.error(msg);
63              throw new NullPointerException(msg);
64          }
65          if (endpointName == null) {
66          	String msg=MESSAGES.getString("CRB000570_Endpoint_name_null");
67              LOG.error(msg);
68              throw new NullPointerException(msg);
69          }
70          
71          this.corbaServiceName = corbaServiceName;
72          this.localizationType = localizationType;
73          this.namespace        = namespace;
74          this.endpointName     = endpointName;
75      }
76  
77      /**
78       * 
79       * @return  The return
80       */
81      public String getCorbaServiceName() {
82          return corbaServiceName;
83      }
84      
85          /**
86       * 
87       * @return  The return
88       */
89      public String getLocalizationType() {
90          return localizationType;
91      }
92  
93      /**
94       * 
95       * @return  The return
96       */
97      public String getEndpointName() {
98          return endpointName;
99      }
100 
101     /**
102      * 
103      * @return  The return
104      */
105     public String getNamespace() {
106         return namespace;
107     }
108 
109     /**
110      * 
111      * @return  The return
112      */
113     public Properties getOrbProperties() {
114         if (orbProperties == null) {
115             orbProperties = new Properties();
116         }
117         return orbProperties;
118     }
119 
120     /**
121      * 
122      * @param orbProperties  The orb properties
123      */
124     public void setOrbProperties(Properties orbProperties) {
125         this.orbProperties = orbProperties;
126     }
127 
128     /**
129      * @return the persistentConsumer
130      */
131     public boolean isPersistentConsumer() {
132         return persistentConsumer;
133     }
134 
135     /**
136      * @param persistentConsumer the persistentConsumer to set
137      */
138     public void setPersistentConsumer(boolean persistentConsumer) {
139         this.persistentConsumer = persistentConsumer;
140     }
141 }