001/*
002// This java file was automatically generated
003// from XOM model 'datasourcesconfig'
004// on Thu Jul 25 21:17:39 PDT 2013
005// Do not edit this file by hand.
006*/
007
008package mondrian.xmla;
009/**
010 * This is the XML model for XMLA DataSources Configuration.
011 * <p>This class was generated from XOM model 'datasourcesconfig' on Thu Jul 25 21:17:39 PDT 2013
012 */
013public class DataSourcesConfig {
014
015        public static java.lang.Class getXMLDefClass()
016        {
017                return DataSourcesConfig.class;
018        }
019
020        public static String[] _elements = {
021                "DataSources",
022                "DataSource",
023                "DataSourceName",
024                "DataSourceDescription",
025                "URL",
026                "DataSourceInfo",
027                "ProviderName",
028                "ProviderType",
029                "AuthenticationMode",
030                "Definition",
031                "Catalogs",
032                "Catalog"
033        };
034
035        /**
036         * The list of data sources supported by XMLA service.
037         */
038        public static class DataSources extends org.eigenbase.xom.ElementDef
039        {
040                public DataSources()
041                {
042                }
043
044                public DataSources(org.eigenbase.xom.DOMWrapper _def)
045                        throws org.eigenbase.xom.XOMException
046                {
047                        try {
048                                org.eigenbase.xom.DOMElementParser _parser = new org.eigenbase.xom.DOMElementParser(_def, "", DataSourcesConfig.class);
049                                org.eigenbase.xom.NodeDef[] _tempArray;
050                                _tempArray = _parser.getArray(DataSource.class, 0, 0);
051                                dataSources = new DataSource[_tempArray.length];
052                                for (int _i = 0; _i < dataSources.length; _i++)
053                                        dataSources[_i] = (DataSource)_tempArray[_i];
054                        } catch(org.eigenbase.xom.XOMException _ex) {
055                                throw new org.eigenbase.xom.XOMException("In " + getName() + ": " + _ex.getMessage());
056                        }
057                }
058
059
060                /**
061                 * The list of data sources supported by XMLA service.
062                 */
063                public DataSource[] dataSources;  //optional array
064
065                public String getName()
066                {
067                        return "DataSources";
068                }
069
070                public void display(java.io.PrintWriter _out, int _indent)
071                {
072                        _out.println(getName());
073                        displayElementArray(_out, "dataSources", dataSources, _indent+1);
074                }
075                public void displayXML(org.eigenbase.xom.XMLOutput _out, int _indent)
076                {
077                        _out.beginTag("DataSources", new org.eigenbase.xom.XMLAttrVector()
078                                );
079                        displayXMLElementArray(_out, dataSources);
080                        _out.endTag("DataSources");
081                }
082                public boolean displayDiff(org.eigenbase.xom.ElementDef _other, java.io.PrintWriter _out, int _indent)
083                {
084                        DataSources _cother = (DataSources)_other;
085                        boolean _diff = displayElementArrayDiff("dataSources", dataSources, _cother.dataSources, _out, _indent+1);
086                        return _diff;
087                }
088        }
089
090        /**
091         * Definition of a data source.
092         */
093        public static class DataSource extends org.eigenbase.xom.ElementDef
094        {
095                public DataSource()
096                {
097                }
098
099                public DataSource(org.eigenbase.xom.DOMWrapper _def)
100                        throws org.eigenbase.xom.XOMException
101                {
102                        try {
103                                org.eigenbase.xom.DOMElementParser _parser = new org.eigenbase.xom.DOMElementParser(_def, "", DataSourcesConfig.class);
104                                name = _parser.getString(DataSourceName, true);
105                                description = _parser.getString(DataSourceDescription, true);
106                                url = _parser.getString(URL, true);
107                                dataSourceInfo = _parser.getString(DataSourceInfo, true);
108                                providerName = _parser.getString(ProviderName, true);
109                                providerType = _parser.getString(ProviderType, true);
110                                authenticationMode = _parser.getString(AuthenticationMode, true);
111                                catalogs = (Catalogs)_parser.getElement(Catalogs.class, true);
112                        } catch(org.eigenbase.xom.XOMException _ex) {
113                                throw new org.eigenbase.xom.XOMException("In " + getName() + ": " + _ex.getMessage());
114                        }
115                }
116
117
118                /**
119                 * Name.
120                 */
121                public String name;  //required element
122                /**
123                 * Description.
124                 */
125                public String description;  //required element
126                /**
127                 * URL of Web Services invocation.
128                 */
129                public String url;  //required element
130                /**
131                 * ConnectString of Mondrian (minus the catalog entry).
132                 * Required, but catalog may override.
133                 */
134                public String dataSourceInfo;  //required element
135                /**
136                 * Customized Service Provider Name.
137                 */
138                public String providerName;  //required element
139                /**
140                 * Ignored. Only return "MDP" for DISCOVER_DATASOURCES.
141                 */
142                public String providerType;  //required element
143                /**
144                 * Ignored. Only return "Unauthenticated" for DISCOVER_DATASOURCES.
145                 */
146                public String authenticationMode;  //required element
147                /**
148                 * One or more Catalogs.
149                 */
150                public Catalogs catalogs;  //required element
151
152                public String getName()
153                {
154                        return "DataSource";
155                }
156
157                public void display(java.io.PrintWriter _out, int _indent)
158                {
159                        _out.println(getName());
160                        displayString(_out, "name", name, _indent+1);
161                        displayString(_out, "description", description, _indent+1);
162                        displayString(_out, "url", url, _indent+1);
163                        displayString(_out, "dataSourceInfo", dataSourceInfo, _indent+1);
164                        displayString(_out, "providerName", providerName, _indent+1);
165                        displayString(_out, "providerType", providerType, _indent+1);
166                        displayString(_out, "authenticationMode", authenticationMode, _indent+1);
167                        displayElement(_out, "catalogs", (org.eigenbase.xom.ElementDef) catalogs, _indent+1);
168                }
169                public void displayXML(org.eigenbase.xom.XMLOutput _out, int _indent)
170                {
171                        _out.beginTag("DataSource", new org.eigenbase.xom.XMLAttrVector()
172                                );
173                        displayXMLString(_out, "DataSourceName", name);
174                        displayXMLString(_out, "DataSourceDescription", description);
175                        displayXMLString(_out, "URL", url);
176                        displayXMLString(_out, "DataSourceInfo", dataSourceInfo);
177                        displayXMLString(_out, "ProviderName", providerName);
178                        displayXMLString(_out, "ProviderType", providerType);
179                        displayXMLString(_out, "AuthenticationMode", authenticationMode);
180                        displayXMLElement(_out, (org.eigenbase.xom.ElementDef) catalogs);
181                        _out.endTag("DataSource");
182                }
183                public boolean displayDiff(org.eigenbase.xom.ElementDef _other, java.io.PrintWriter _out, int _indent)
184                {
185                        DataSource _cother = (DataSource)_other;
186                        boolean _diff = displayStringDiff("name", name, _cother.name, _out, _indent+1);
187                        _diff = _diff && displayStringDiff("description", description, _cother.description, _out, _indent+1);
188                        _diff = _diff && displayStringDiff("url", url, _cother.url, _out, _indent+1);
189                        _diff = _diff && displayStringDiff("dataSourceInfo", dataSourceInfo, _cother.dataSourceInfo, _out, _indent+1);
190                        _diff = _diff && displayStringDiff("providerName", providerName, _cother.providerName, _out, _indent+1);
191                        _diff = _diff && displayStringDiff("providerType", providerType, _cother.providerType, _out, _indent+1);
192                        _diff = _diff && displayStringDiff("authenticationMode", authenticationMode, _cother.authenticationMode, _out, _indent+1);
193                        _diff = _diff && displayElementDiff("catalogs", catalogs, _cother.catalogs, _out, _indent+1);
194                        return _diff;
195                }
196                // BEGIN pass-through code block ---
197public static final String PROVIDER_TYPE_TDP = "TDP";
198            public static final String PROVIDER_TYPE_MDP = "MDP";
199            public static final String PROVIDER_TYPE_DMP = "DMP";
200            public static final String AUTH_MODE_UNAUTHENTICATED = "Unauthenticated";
201            public static final String AUTH_MODE_AUTHENTICATED = "Authenticated";
202            public static final String AUTH_MODE_INTEGRATED = "Integrated";
203
204            public String getDataSourceName() {
205                return name;
206            }
207
208            public String getDataSourceDescription() {
209                return description;
210            }
211
212            public String getURL() {
213                return url;
214            }
215
216            public String getDataSourceInfo() {
217                return dataSourceInfo;
218            }
219
220            public String getProviderName() {
221                return providerName;
222            }
223
224            public String[] getProviderType() {
225                return new String[] {PROVIDER_TYPE_MDP};
226            }
227
228            public String getAuthenticationMode() {
229                return authenticationMode;
230            }
231                // END pass-through code block ---
232        }
233
234        public static final String DataSourceName = "DataSourceName";
235
236        public static final String DataSourceDescription = "DataSourceDescription";
237
238        public static final String URL = "URL";
239
240        public static final String DataSourceInfo = "DataSourceInfo";
241
242        public static final String ProviderName = "ProviderName";
243
244        public static final String ProviderType = "ProviderType";
245
246        public static final String AuthenticationMode = "AuthenticationMode";
247
248        public static final String Definition = "Definition";
249
250        /**
251         * The list of catalogs associated with a data source.
252         */
253        public static class Catalogs extends org.eigenbase.xom.ElementDef
254        {
255                public Catalogs()
256                {
257                }
258
259                public Catalogs(org.eigenbase.xom.DOMWrapper _def)
260                        throws org.eigenbase.xom.XOMException
261                {
262                        try {
263                                org.eigenbase.xom.DOMElementParser _parser = new org.eigenbase.xom.DOMElementParser(_def, "", DataSourcesConfig.class);
264                                org.eigenbase.xom.NodeDef[] _tempArray;
265                                _tempArray = _parser.getArray(Catalog.class, 0, 0);
266                                catalogs = new Catalog[_tempArray.length];
267                                for (int _i = 0; _i < catalogs.length; _i++)
268                                        catalogs[_i] = (Catalog)_tempArray[_i];
269                        } catch(org.eigenbase.xom.XOMException _ex) {
270                                throw new org.eigenbase.xom.XOMException("In " + getName() + ": " + _ex.getMessage());
271                        }
272                }
273
274
275                /**
276                 * The list of catalogs.
277                 */
278                public Catalog[] catalogs;  //optional array
279
280                public String getName()
281                {
282                        return "Catalogs";
283                }
284
285                public void display(java.io.PrintWriter _out, int _indent)
286                {
287                        _out.println(getName());
288                        displayElementArray(_out, "catalogs", catalogs, _indent+1);
289                }
290                public void displayXML(org.eigenbase.xom.XMLOutput _out, int _indent)
291                {
292                        _out.beginTag("Catalogs", new org.eigenbase.xom.XMLAttrVector()
293                                );
294                        displayXMLElementArray(_out, catalogs);
295                        _out.endTag("Catalogs");
296                }
297                public boolean displayDiff(org.eigenbase.xom.ElementDef _other, java.io.PrintWriter _out, int _indent)
298                {
299                        Catalogs _cother = (Catalogs)_other;
300                        boolean _diff = displayElementArrayDiff("catalogs", catalogs, _cother.catalogs, _out, _indent+1);
301                        return _diff;
302                }
303        }
304
305        public static class Catalog extends org.eigenbase.xom.ElementDef
306        {
307                public Catalog()
308                {
309                }
310
311                public Catalog(org.eigenbase.xom.DOMWrapper _def)
312                        throws org.eigenbase.xom.XOMException
313                {
314                        try {
315                                org.eigenbase.xom.DOMElementParser _parser = new org.eigenbase.xom.DOMElementParser(_def, "", DataSourcesConfig.class);
316                                name = (String)_parser.getAttribute("name", "String", null, null, true);
317                                dataSourceInfo = _parser.getString(DataSourceInfo, false);
318                                definition = _parser.getString(Definition, true);
319                        } catch(org.eigenbase.xom.XOMException _ex) {
320                                throw new org.eigenbase.xom.XOMException("In " + getName() + ": " + _ex.getMessage());
321                        }
322                }
323
324                public String name;  // required attribute
325
326                /**
327                 * ConnectString of Mondrian (minus the catalog entry).
328                 * This entry is optional; if present, it overrides the
329                 * DataSourceInfo within the DataSource.
330                 */
331                public String dataSourceInfo;  //optional element
332                /**
333                 * URI of the schema definition file, for example
334                 * "/WEB-INF/schema/Marketing.xml".
335                 */
336                public String definition;  //required element
337
338                public String getName()
339                {
340                        return "Catalog";
341                }
342
343                public void display(java.io.PrintWriter _out, int _indent)
344                {
345                        _out.println(getName());
346                        displayAttribute(_out, "name", name, _indent+1);
347                        displayString(_out, "dataSourceInfo", dataSourceInfo, _indent+1);
348                        displayString(_out, "definition", definition, _indent+1);
349                }
350                public void displayXML(org.eigenbase.xom.XMLOutput _out, int _indent)
351                {
352                        _out.beginTag("Catalog", new org.eigenbase.xom.XMLAttrVector()
353                                .add("name", name)
354                                );
355                        displayXMLString(_out, "DataSourceInfo", dataSourceInfo);
356                        displayXMLString(_out, "Definition", definition);
357                        _out.endTag("Catalog");
358                }
359                public boolean displayDiff(org.eigenbase.xom.ElementDef _other, java.io.PrintWriter _out, int _indent)
360                {
361                        Catalog _cother = (Catalog)_other;
362                        boolean _diff = displayAttributeDiff("name", name, _cother.name, _out, _indent+1);
363                        _diff = _diff && displayStringDiff("dataSourceInfo", dataSourceInfo, _cother.dataSourceInfo, _out, _indent+1);
364                        _diff = _diff && displayStringDiff("definition", definition, _cother.definition, _out, _indent+1);
365                        return _diff;
366                }
367        }
368
369
370}