View Javadoc
1   /*
2    * This file is part of Waarp Project (named also Waarp or GG).
3    *
4    *  Copyright (c) 2019, Waarp SAS, and individual contributors by the @author
5    *  tags. See the COPYRIGHT.txt in the distribution for a full listing of
6    * individual contributors.
7    *
8    *  All Waarp Project is free software: you can redistribute it and/or
9    * modify it under the terms of the GNU General Public License as published by
10   * the Free Software Foundation, either version 3 of the License, or (at your
11   * option) any later version.
12   *
13   * Waarp is distributed in the hope that it will be useful, but WITHOUT ANY
14   * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
15   * A PARTICULAR PURPOSE. See the GNU General Public License for more details.
16   *
17   *  You should have received a copy of the GNU General Public License along with
18   * Waarp . If not, see <http://www.gnu.org/licenses/>.
19   */
20  
21  package org.waarp.openr66.configuration;
22  
23  import org.waarp.common.xml.XmlDecl;
24  import org.waarp.common.xml.XmlType;
25  import org.waarp.openr66.database.data.DbHostConfiguration;
26  
27  public class FileBasedElements {
28    /**
29     * Authentication Fields
30     */
31    public static final String XML_AUTHENTICATION_ROOT = "authent";
32    /**
33     * Authentication Fields
34     */
35    public static final String XML_AUTHENTICATION_ENTRY = "entry";
36    /**
37     * Authentication Fields
38     */
39    public static final String XML_AUTHENTICATION_HOSTID = "hostid";
40    /**
41     * Authentication Fields
42     */
43    public static final String XML_AUTHENTICATION_KEYFILE = "keyfile";
44    /**
45     * Authentication Fields
46     */
47    public static final String XML_AUTHENTICATION_KEY = "key";
48    /**
49     * Authentication Fields
50     */
51    public static final String XML_AUTHENTICATION_ADMIN = "admin";
52    /**
53     * Authentication Fields
54     */
55    public static final String XML_AUTHENTICATION_ADDRESS = "address";
56    /**
57     * Authentication Fields
58     */
59    public static final String XML_AUTHENTICATION_PORT = "port";
60    /**
61     * Authentication Fields
62     */
63    public static final String XML_AUTHENTICATION_ISSSL = "isssl";
64    /**
65     * Authentication Fields
66     */
67    public static final String XML_AUTHENTICATION_ISCLIENT = "isclient";
68    /**
69     * Authentication Fields
70     */
71    public static final String XML_AUTHENTICATION_ISACTIVE = "isactive";
72    /**
73     * Authentication Fields
74     */
75    public static final String XML_AUTHENTICATION_ISPROXIFIED = "isproxified";
76    /**
77     * Authentication Fields
78     */
79    public static final String XML_AUTHENTICATION_BASED =
80        '/' + XML_AUTHENTICATION_ROOT + '/' + XML_AUTHENTICATION_ENTRY;
81    /**
82     * Structure of the Configuration file
83     */
84    private static final XmlDecl[] configAuthenticationDecls = {
85        // identity
86        new XmlDecl(XmlType.STRING, XML_AUTHENTICATION_HOSTID),
87        new XmlDecl(XmlType.STRING, XML_AUTHENTICATION_KEYFILE),
88        new XmlDecl(XmlType.STRING, XML_AUTHENTICATION_KEY),
89        new XmlDecl(XmlType.BOOLEAN, XML_AUTHENTICATION_ADMIN),
90        new XmlDecl(XmlType.STRING, XML_AUTHENTICATION_ADDRESS),
91        new XmlDecl(XmlType.INTEGER, XML_AUTHENTICATION_PORT),
92        new XmlDecl(XmlType.BOOLEAN, XML_AUTHENTICATION_ISSSL),
93        new XmlDecl(XmlType.BOOLEAN, XML_AUTHENTICATION_ISCLIENT),
94        new XmlDecl(XmlType.BOOLEAN, XML_AUTHENTICATION_ISACTIVE),
95        new XmlDecl(XmlType.BOOLEAN, XML_AUTHENTICATION_ISPROXIFIED)
96    };
97    /**
98     * Global Structure for Server Configuration
99     */
100   public static final XmlDecl[] authentElements = {
101       new XmlDecl(XML_AUTHENTICATION_ENTRY, XmlType.XVAL,
102                   XML_AUTHENTICATION_BASED, configAuthenticationDecls, true)
103   };
104   /**
105    * XML_LOCALE
106    */
107   public static final String XML_LOCALE = "locale";
108   /**
109    * SERVER HOSTID
110    */
111   public static final String XML_SERVER_HOSTID = "hostid";
112   /**
113    * SERVER SSL HOSTID
114    */
115   public static final String XML_SERVER_SSLHOSTID = "sslhostid";
116   /**
117    * ADMINISTRATOR SERVER NAME (shutdown)
118    */
119   public static final String XML_SERVER_ADMIN = "serveradmin";
120   /**
121    * SERVER PASSWORD (shutdown)
122    */
123   public static final String XML_SERVER_PASSWD = "serverpasswd";//NOSONAR
124   /**
125    * SERVER PASSWORD FILE (shutdown)
126    */
127   public static final String XML_SERVER_PASSWD_FILE =//NOSONAR
128       "serverpasswdfile";//NOSONAR
129   /**
130    * Authentication
131    */
132   public static final String XML_AUTHENTIFICATION_FILE = "authentfile";
133   /**
134    * SERVER PORT
135    */
136   public static final String XML_SERVER_PORT = "serverport";
137   /**
138    * SERVER SSL PORT
139    */
140   public static final String XML_SERVER_SSLPORT = "serversslport";
141   /**
142    * SERVER HTTP PORT
143    */
144   public static final String XML_SERVER_HTTPPORT = "serverhttpport";
145   /**
146    * SERVER HTTPS PORT
147    */
148   public static final String XML_SERVER_HTTPSPORT = "serverhttpsport";
149   /**
150    * SERVER PORT
151    */
152   public static final String XML_SERVER_ADDRESSES = "serveraddresses";
153   /**
154    * SERVER SSL PORT
155    */
156   public static final String XML_SERVER_SSL_ADDRESSES = "serverssladdresses";
157   /**
158    * SERVER HTTP PORT
159    */
160   public static final String XML_SERVER_HTTP_ADDRESSES = "serverhttpaddresses";
161   /**
162    * SERVER HTTPS PORT
163    */
164   public static final String XML_SERVER_HTTPS_ADDRESSES =
165       "serverhttpsaddresses";
166   /**
167    * Structure of the Configuration file
168    */
169   private static final XmlDecl[] configNetworkServerDecls = {
170       // network
171       new XmlDecl(XmlType.INTEGER, XML_SERVER_PORT),
172       new XmlDecl(XmlType.INTEGER, XML_SERVER_SSLPORT),
173       new XmlDecl(XmlType.INTEGER, XML_SERVER_HTTPPORT),
174       new XmlDecl(XmlType.INTEGER, XML_SERVER_HTTPSPORT),
175       new XmlDecl(XmlType.STRING, XML_SERVER_ADDRESSES),
176       new XmlDecl(XmlType.STRING, XML_SERVER_SSL_ADDRESSES),
177       new XmlDecl(XmlType.STRING, XML_SERVER_HTTP_ADDRESSES),
178       new XmlDecl(XmlType.STRING, XML_SERVER_HTTPS_ADDRESSES)
179   };
180   /**
181    * SERVER SSL STOREKEY PATH
182    */
183   public static final String XML_PATH_KEYPATH = "keypath";
184   /**
185    * SERVER SSL KEY PASS
186    */
187   public static final String XML_PATH_KEYPASS = "keypass";
188   /**
189    * SERVER SSL STOREKEY PASS
190    */
191   public static final String XML_PATH_KEYSTOREPASS = "keystorepass";
192   /**
193    * SERVER SSL TRUSTSTOREKEY PATH
194    */
195   public static final String XML_PATH_TRUSTKEYPATH = "trustkeypath";
196   /**
197    * SERVER SSL TRUSTSTOREKEY PASS
198    */
199   public static final String XML_PATH_TRUSTKEYSTOREPASS = "trustkeystorepass";
200   /**
201    * SERVER SSL STOREKEY PATH ADMIN
202    */
203   public static final String XML_PATH_ADMIN_KEYPATH = "admkeypath";
204   /**
205    * SERVER SSL KEY PASS ADMIN
206    */
207   public static final String XML_PATH_ADMIN_KEYPASS = "admkeypass";
208   /**
209    * SERVER SSL STOREKEY PASS ADMIN
210    */
211   public static final String XML_PATH_ADMIN_KEYSTOREPASS = "admkeystorepass";
212   /**
213    * SERVER CRYPTO for Password
214    */
215   public static final String XML_PATH_CRYPTOKEY = "cryptokey";
216   /**
217    * Structure of the Configuration file
218    */
219   public static final XmlDecl[] configIdentityDecls = {
220       // identity
221       new XmlDecl(XmlType.STRING, XML_SERVER_HOSTID),
222       new XmlDecl(XmlType.STRING, XML_SERVER_SSLHOSTID),
223       new XmlDecl(XmlType.STRING, XML_PATH_CRYPTOKEY),
224       new XmlDecl(XmlType.STRING, XML_AUTHENTIFICATION_FILE),
225       new XmlDecl(XmlType.STRING, XML_LOCALE)
226   };
227   /**
228    * Base Directory
229    */
230   public static final String XML_SERVER_HOME = "serverhome";
231   /**
232    * IN Directory
233    */
234   public static final String XML_INPATH = "in";
235   /**
236    * OUT Directory
237    */
238   public static final String XML_OUTPATH = "out";
239   /**
240    * ARCHIVE Directory
241    */
242   public static final String XML_ARCHIVEPATH = "arch";
243   /**
244    * WORKING Directory
245    */
246   public static final String XML_WORKINGPATH = "work";
247   /**
248    * CONFIG Directory
249    */
250   public static final String XML_CONFIGPATH = "conf";
251   /**
252    * Structure of the Configuration file
253    */
254   private static final XmlDecl[] configDirectoryDecls = {
255       // directory
256       new XmlDecl(XmlType.STRING, XML_SERVER_HOME),
257       new XmlDecl(XmlType.STRING, XML_INPATH),
258       new XmlDecl(XmlType.STRING, XML_OUTPATH),
259       new XmlDecl(XmlType.STRING, XML_ARCHIVEPATH),
260       new XmlDecl(XmlType.STRING, XML_WORKINGPATH),
261       new XmlDecl(XmlType.STRING, XML_CONFIGPATH)
262   };
263   /**
264    * Extended Task Factory configuration
265    */
266   public static final String XML_EXTENDED_TASK_FACTORIES =
267       "extendedtaskfactories";
268   /**
269    * Structure of the Configuration file
270    */
271   private static final XmlDecl[] configExtendTaskFactoryDecls = {
272       // extendTaskFactory
273       new XmlDecl(XmlType.STRING, XML_EXTENDED_TASK_FACTORIES)
274   };
275   /**
276    * HTTP Admin Directory
277    */
278   public static final String XML_HTTPADMINPATH = "httpadmin";
279   /**
280    * HTTP Admin model (fix = 0 or responsive = 1, not mandatory since auto
281    * detection)
282    */
283   public static final String XML_HTTPADMINMODEL = "httpmodel";
284   /**
285    * Use SSL for R66 connection
286    */
287   public static final String XML_USESSL = "usessl";
288   /**
289    * Use non SSL for R66 connection
290    */
291   public static final String XML_USENOSSL = "usenossl";
292   /**
293    * Use HTTP compression for R66 HTTP connection
294    */
295   public static final String XML_USEHTTPCOMP = "usehttpcomp";
296   /**
297    * SERVER SSL Use TrustStore for Client Authentication
298    */
299   public static final String XML_USECLIENT_AUTHENT =
300       "trustuseclientauthenticate";
301   /**
302    * Structure of the Configuration file
303    */
304   public static final XmlDecl[] configSslDecls = {
305       // ssl
306       new XmlDecl(XmlType.STRING, XML_PATH_KEYPATH),
307       new XmlDecl(XmlType.STRING, XML_PATH_KEYSTOREPASS),
308       new XmlDecl(XmlType.STRING, XML_PATH_KEYPASS),
309       new XmlDecl(XmlType.STRING, XML_PATH_TRUSTKEYPATH),
310       new XmlDecl(XmlType.STRING, XML_PATH_TRUSTKEYSTOREPASS),
311       new XmlDecl(XmlType.BOOLEAN, XML_USECLIENT_AUTHENT)
312   };
313 
314   /**
315    * Limit per session
316    */
317   public static final String XML_LIMITSESSION = "sessionlimit";
318   /**
319    * Limit global
320    */
321   public static final String XML_LIMITGLOBAL = "globallimit";
322   /**
323    * Delay between two checks for Limit
324    */
325   public static final String XML_LIMITDELAY = "delaylimit";
326   /**
327    * Monitoring: how long in ms to get back in monitoring
328    */
329   public static final String XML_MONITOR_PASTLIMIT = "pastlimit";
330   /**
331    * Monitoring: minimal interval in ms before redo real monitoring
332    */
333   public static final String XML_MONITOR_MINIMALDELAY = "minimaldelay";
334   /**
335    * Monitoring: snmp configuration file (if empty, no snmp support)
336    */
337   public static final String XML_MONITOR_SNMP_CONFIG = "snmpconfig";
338   /**
339    * In case of multiple OpenR66 Monitors behing a loadbalancer (ha config)
340    */
341   public static final String XML_MULTIPLE_MONITORS = "multiplemonitors";
342   /**
343    * If you need a special Business Factory, you must specify the full class
344    * name here. Default is:
345    * org.waarp.openr66.context.R66DefaultBusinessFactory which only logs in
346    * DEBUG mode.
347    */
348   public static final String XML_BUSINESS_FACTORY = "businessfactory";
349 
350   /**
351    * Usage of CPU Limit
352    */
353   public static final String XML_CSTRT_USECPULIMIT = "usecpulimit";
354   /**
355    * Usage of JDK CPU Limit (True) or SysMon CPU Limit
356    */
357   public static final String XML_CSTRT_USECPUJDKLIMIT = "usejdkcpulimit";
358   /**
359    * CPU LIMIT between 0 and 1, where 1 stands for no limit
360    */
361   public static final String XML_CSTRT_CPULIMIT = "cpulimit";
362   /**
363    * Connection limit where 0 stands for no limit
364    */
365   public static final String XML_CSTRT_CONNLIMIT = "connlimit";
366   /**
367    * CPU LOW limit to apply increase of throttle
368    */
369   public static final String XML_CSTRT_LOWCPULIMIT = "lowcpulimit";
370   /**
371    * CPU HIGH limit to apply decrease of throttle, 0 meaning no throttle
372    * activated
373    */
374   public static final String XML_CSTRT_HIGHCPULIMIT = "highcpulimit";
375   /**
376    * PERCENTAGE DECREASE of Bandwidth
377    */
378   public static final String XML_CSTRT_PERCENTDECREASE = "percentdecrease";
379   /**
380    * Delay between 2 checks of throttle test
381    */
382   public static final String XML_CSTRT_DELAYTHROTTLE = "delaythrottle";
383   /**
384    * Bandwidth low limit to not got below
385    */
386   public static final String XML_CSTRT_LIMITLOWBANDWIDTH = "limitlowbandwidth";
387   /**
388    * Usage of checking remote address with the DbHost definition
389    */
390   public static final String XML_CHECK_ADDRESS = "checkaddress";
391   /**
392    * Usage of checking remote address also for Client
393    */
394   public static final String XML_CHECK_CLIENTADDRESS = "checkclientaddress";
395   /**
396    * In case of No Db Client, Usage of saving TaskRunner into independent XML
397    * file
398    */
399   public static final String XML_SAVE_TASKRUNNERNODB = "taskrunnernodb";
400   /**
401    * Structure of the Configuration file
402    */
403   private static final XmlDecl[] configClientParamDecls = {
404       // client
405       new XmlDecl(XmlType.BOOLEAN, XML_SAVE_TASKRUNNERNODB),
406       new XmlDecl(XmlType.STRING, XML_BUSINESS_FACTORY)
407   };
408   /**
409    * Use external Waarp Local Exec for ExecTask and ExecMoveTask
410    */
411   public static final String XML_USELOCALEXEC = "uselocalexec";
412   /**
413    * Address of Waarp Local Exec for ExecTask and ExecMoveTask
414    */
415   public static final String XML_LEXECADDR = "lexecaddr";
416   /**
417    * Port of Waarp Local Exec for ExecTask and ExecMoveTask
418    */
419   public static final String XML_LEXECPORT = "lexecport";
420   /**
421    * Structure of the Configuration file
422    */
423   private static final XmlDecl[] configServerParamDecls = {
424       // server
425       new XmlDecl(XmlType.BOOLEAN, XML_USESSL),
426       new XmlDecl(XmlType.BOOLEAN, XML_USENOSSL),
427       new XmlDecl(XmlType.BOOLEAN, XML_USEHTTPCOMP),
428       new XmlDecl(XmlType.BOOLEAN, XML_USELOCALEXEC),
429       new XmlDecl(XmlType.STRING, XML_LEXECADDR),
430       new XmlDecl(XmlType.INTEGER, XML_LEXECPORT),
431       new XmlDecl(XmlType.BOOLEAN, XML_CHECK_ADDRESS),
432       new XmlDecl(XmlType.BOOLEAN, XML_CHECK_CLIENTADDRESS),
433       new XmlDecl(XmlType.STRING, XML_SERVER_ADMIN),
434       new XmlDecl(XmlType.STRING, XML_SERVER_PASSWD),
435       new XmlDecl(XmlType.STRING, XML_SERVER_PASSWD_FILE),
436       new XmlDecl(XmlType.STRING, XML_HTTPADMINPATH),
437       new XmlDecl(XmlType.INTEGER, XML_HTTPADMINMODEL),
438       new XmlDecl(XmlType.STRING, XML_PATH_ADMIN_KEYPATH),
439       new XmlDecl(XmlType.STRING, XML_PATH_ADMIN_KEYSTOREPASS),
440       new XmlDecl(XmlType.STRING, XML_PATH_ADMIN_KEYPASS),
441       new XmlDecl(XmlType.LONG, XML_MONITOR_PASTLIMIT),
442       new XmlDecl(XmlType.LONG, XML_MONITOR_MINIMALDELAY),
443       new XmlDecl(XmlType.STRING, XML_MONITOR_SNMP_CONFIG),
444       new XmlDecl(XmlType.INTEGER, XML_MULTIPLE_MONITORS),
445       new XmlDecl(XmlType.STRING, XML_BUSINESS_FACTORY)
446   };
447   // Common part with REST API and Elasticsearch API
448   /**
449    * URL as http://myrest.org for PUSH REST JSON Monitor
450    */
451   public static final String XML_PUSH_MONITOR_URL = "url";
452   /**
453    * Delay in ms between 2 attempts for PUSH REST JSON Monitor
454    */
455   public static final String XML_PUSH_MONITOR_DELAY = "delay";
456   /**
457    * Keep Monitor Interval Included
458    */
459   public static final String XML_PUSH_MONITOR_INTERVAL_INCLUDED =
460       "intervalincluded";
461   /**
462    * Keep monitorTransformLongAsString
463    */
464   public static final String XML_PUSH_MONITOR_TRANSFORM_LONG_AS_STRING =
465       "transformlongasstring";
466   /**
467    * If a token is necessary as fixed Bearer Token
468    * (Default: null)
469    */
470   public static final String XML_PUSH_MONITOR_TOKEN = "token";
471   /**
472    * If a token is necessary as fixed Bearer API Key as 'apiId:apiKey'
473    * (Default: null)
474    */
475   public static final String XML_PUSH_MONITOR_APIKEY = "apiKey";
476   // Specific REST API Part
477   /**
478    * End Point as /status such as URL + end point give
479    * http://myrest.org/status for PUSH REST JSON Monitor
480    */
481   public static final String XML_PUSH_MONITOR_ENDPOINT = "endpoint";
482   /**
483    * Keep connection between 2 attempts for PUSH REST JSON Monitor
484    */
485   public static final String XML_PUSH_MONITOR_KEEP_CONNECTION =
486       "keepconnection";
487   /**
488    * If a Base 64 Bearer Basic Authentication is necessary
489    * (Default: null)
490    */
491   public static final String XML_PUSH_MONITOR_BASIC_AUTHENT = "basicAuthent";
492 
493   // Specific Elasticsearch Part
494   /**
495    * Contains the index name, with possible substitution as %%WARPHOST%%
496    * %%DATETIME%%, %%DATEHOUR%%, %%DATE%%, %%YEARMONTH%%, %%YEAR%%.
497    * The index name will be finally lower cased.
498    */
499   public static final String XML_PUSH_MONITOR_ES_INDEX = "index";
500   /**
501    * Specify a possible prefix to add to each request, in particular if
502    * Elasticsearch is behind a Proxy
503    * (Default: null)
504    */
505   public static final String XML_PUSH_MONITOR_ES_PREFIX = "prefix";
506   /**
507    * If a username/password is necessary as Basic Authentication
508    * (Default: null)
509    */
510   public static final String XML_PUSH_MONITOR_ES_USERNAME = "username";
511   /**
512    * If a username/password is necessary as Basic Authentication
513    * (Default: null)
514    */
515   public static final String XML_PUSH_MONITOR_ES_PWD = "paswd";
516   /**
517    * Defines if the Elasticsearch client will use compression (Default: True)
518    */
519   public static final String XML_PUSH_MONITOR_ES_COMPRESSION = "compression";
520 
521   /**
522    * Structure of the Configuration file: Push Monitor for Server only
523    */
524   private static final XmlDecl[] configServerPushMonitorParamDecls = {
525       // pushMonitor
526       // Common
527       new XmlDecl(XmlType.STRING, XML_PUSH_MONITOR_URL),
528       new XmlDecl(XmlType.INTEGER, XML_PUSH_MONITOR_DELAY),
529       new XmlDecl(XmlType.BOOLEAN, XML_PUSH_MONITOR_INTERVAL_INCLUDED),
530       new XmlDecl(XmlType.BOOLEAN, XML_PUSH_MONITOR_TRANSFORM_LONG_AS_STRING),
531       new XmlDecl(XmlType.STRING, XML_PUSH_MONITOR_TOKEN),
532       new XmlDecl(XmlType.STRING, XML_PUSH_MONITOR_APIKEY),
533 
534       // REST Api
535       new XmlDecl(XmlType.BOOLEAN, XML_PUSH_MONITOR_KEEP_CONNECTION),
536       new XmlDecl(XmlType.STRING, XML_PUSH_MONITOR_ENDPOINT),
537       new XmlDecl(XmlType.STRING, XML_PUSH_MONITOR_BASIC_AUTHENT),
538 
539       // Elasticsearch client API
540       new XmlDecl(XmlType.STRING, XML_PUSH_MONITOR_ES_INDEX),
541       new XmlDecl(XmlType.STRING, XML_PUSH_MONITOR_ES_PREFIX),
542       new XmlDecl(XmlType.STRING, XML_PUSH_MONITOR_ES_USERNAME),
543       new XmlDecl(XmlType.STRING, XML_PUSH_MONITOR_ES_PWD),
544       new XmlDecl(XmlType.BOOLEAN, XML_PUSH_MONITOR_ES_COMPRESSION)
545   };
546   /**
547    * Default number of threads in pool for Server.
548    */
549   public static final String XML_SERVER_THREAD = "serverthread";
550   /**
551    * Default number of threads in pool for Client (truly concurrent).
552    */
553   public static final String XML_CLIENT_THREAD = "clientthread";
554   /**
555    * Memory Limit to use.
556    */
557   public static final String XML_MEMORY_LIMIT = "memorylimit";
558   /**
559    * Limit of number of active Runner from Commander
560    */
561   public static final String XML_LIMITRUNNING = "runlimit";
562   /**
563    * Delay between two checks for Commander
564    */
565   public static final String XML_DELAYCOMMANDER = "delaycommand";
566   /**
567    * Delay between two retry after bad connection
568    */
569   public static final String XML_DELAYRETRY = "delayretry";
570   /**
571    * Nb of milliseconds after connection is in timeout
572    */
573   public static final String XML_TIMEOUTCON = "timeoutcon";
574   /**
575    * Should a file MD5 SHA1 be computed using NIO (not recommended anymore)
576    */
577   public static final String XML_USENIO = "usenio";
578   /**
579    * What Digest to use: CRC32=0, ADLER32=1, MD5=2, MD2=3, SHA1=4, SHA256=5,
580    * SHA384=6, SHA512=7 : recommended value is 7
581    */
582   public static final String XML_DIGEST = "digest";
583   /**
584    * Should a file MD5 be computed using FastMD5 (not recommended anymore)
585    */
586   public static final String XML_USEFASTMD5 = "usefastmd5";
587   /**
588    * If using Fast MD5, should we used the binary JNI library, empty meaning
589    * no
590    */
591   public static final String XML_FASTMD5 = "fastmd5";
592   /**
593    * number of rank to go back when a transfer is restarted. restart is
594    * gaprestart*blocksize
595    */
596   public static final String XML_GAPRESTART = "gaprestart";
597   /**
598    * Size by default of block size for receive/sending files. Should be a
599    * multiple of 8192 (maximum = 64K due to
600    * block limitation to 2 bytes)
601    */
602   public static final String XML_BLOCKSIZE = "blocksize";
603   /**
604    * Structure of the Configuration file
605    */
606   private static final XmlDecl[] configSubmitLimitDecls = {
607       // limit
608       new XmlDecl(XmlType.INTEGER, XML_BLOCKSIZE)
609   };
610   /**
611    * If set to <=0, will not use Thrift support, if set >0 (preferably > 1024)
612    * will enable Thrift support on the
613    * TCP port specified by this number
614    */
615   public static final String XML_USETHRIFT = "usethrift";
616   /**
617    * Database Driver as of oracle, mysql, postgresql, h2
618    */
619   public static final String XML_DBDRIVER = "dbdriver";
620   /**
621    * Database Server connection string as of jdbc:type://[host:port],[failoverhost:port]
622    * .../[database][?propertyName1][ =propertyValue1][&propertyName2][=propertyValue2]...
623    */
624   public static final String XML_DBSERVER = "dbserver";
625   /**
626    * Database User
627    */
628   public static final String XML_DBUSER = "dbuser";
629   /**
630    * Database Password
631    */
632   public static final String XML_DBPASSWD = "dbpasswd";//NOSONAR
633   /**
634    * Database Checking
635    */
636   @Deprecated
637   public static final String XML_DBCHECK = "dbcheck";
638   /**
639    * Upgrade database
640    */
641   public static final String XML_DBAUTOUPGRADE = "autoUpgrade";
642   /**
643    * Structure of the Configuration file
644    */
645   private static final XmlDecl[] configDbDecls = {
646       // db
647       new XmlDecl(XmlType.STRING, XML_DBDRIVER),
648       new XmlDecl(XmlType.STRING, XML_DBSERVER),
649       new XmlDecl(XmlType.STRING, XML_DBUSER),
650       new XmlDecl(XmlType.STRING, XML_DBPASSWD),
651       new XmlDecl(XmlType.BOOLEAN, XML_DBCHECK),
652       new XmlDecl(XmlType.BOOLEAN, XML_DBAUTOUPGRADE),
653       new XmlDecl(XmlType.BOOLEAN, XML_SAVE_TASKRUNNERNODB)
654   };
655   /**
656    * Check version in protocol
657    */
658   public static final String XML_CHECKVERSION = "checkversion";
659   /**
660    * Global digest by transfer enable
661    */
662   public static final String XML_GLOBALDIGEST = "globaldigest";
663   /**
664    * Final local digest check by transfer enable
665    */
666   public static final String XML_LOCALDIGEST = "localdigest";
667   /**
668    * Enabling compression (default true)
669    */
670   public static final String XML_COMPRESSION = "compression";
671   /**
672    * Structure of the Configuration file
673    */
674   private static final XmlDecl[] configLimitDecls = {
675       // limit
676       new XmlDecl(XmlType.LONG, XML_LIMITSESSION),
677       new XmlDecl(XmlType.LONG, XML_LIMITGLOBAL),
678       new XmlDecl(XmlType.LONG, XML_LIMITDELAY),
679       new XmlDecl(XmlType.INTEGER, XML_LIMITRUNNING),
680       new XmlDecl(XmlType.LONG, XML_DELAYCOMMANDER),
681       new XmlDecl(XmlType.LONG, XML_DELAYRETRY),
682       new XmlDecl(XmlType.INTEGER, XML_SERVER_THREAD),
683       new XmlDecl(XmlType.INTEGER, XML_CLIENT_THREAD),
684       new XmlDecl(XmlType.LONG, XML_MEMORY_LIMIT),
685       new XmlDecl(XmlType.BOOLEAN, XML_CSTRT_USECPULIMIT),
686       new XmlDecl(XmlType.BOOLEAN, XML_CSTRT_USECPUJDKLIMIT),
687       new XmlDecl(XmlType.DOUBLE, XML_CSTRT_CPULIMIT),
688       new XmlDecl(XmlType.INTEGER, XML_CSTRT_CONNLIMIT),
689       new XmlDecl(XmlType.DOUBLE, XML_CSTRT_LOWCPULIMIT),
690       new XmlDecl(XmlType.DOUBLE, XML_CSTRT_HIGHCPULIMIT),
691       new XmlDecl(XmlType.DOUBLE, XML_CSTRT_PERCENTDECREASE),
692       new XmlDecl(XmlType.LONG, XML_CSTRT_LIMITLOWBANDWIDTH),
693       new XmlDecl(XmlType.LONG, XML_CSTRT_DELAYTHROTTLE),
694       new XmlDecl(XmlType.LONG, XML_TIMEOUTCON),
695       new XmlDecl(XmlType.BOOLEAN, XML_USENIO),
696       new XmlDecl(XmlType.INTEGER, XML_DIGEST),
697       new XmlDecl(XmlType.BOOLEAN, XML_USEFASTMD5),
698       new XmlDecl(XmlType.STRING, XML_FASTMD5),
699       new XmlDecl(XmlType.INTEGER, XML_GAPRESTART),
700       new XmlDecl(XmlType.INTEGER, XML_BLOCKSIZE),
701       new XmlDecl(XmlType.INTEGER, XML_USETHRIFT),
702       new XmlDecl(XmlType.BOOLEAN, XML_CHECKVERSION),
703       new XmlDecl(XmlType.BOOLEAN, XML_GLOBALDIGEST),
704       new XmlDecl(XmlType.BOOLEAN, XML_LOCALDIGEST),
705       new XmlDecl(XmlType.BOOLEAN, XML_COMPRESSION)
706   };
707   /**
708    * SERVER REST interface address usage (and not all available IPs)
709    */
710   public static final String XML_REST_ADDRESS = "restaddress";
711   /**
712    * SERVER HTTP(S) PORT for REST interface
713    */
714   public static final String XML_SERVER_REST_PORT = "restport";
715   /**
716    * SERVER REST interface using SSL
717    */
718   public static final String XML_REST_SSL = "restssl";
719   /**
720    * SERVER REST interface using time limit
721    */
722   public static final String XML_REST_TIME_LIMIT = "resttimelimit";
723   /**
724    * SERVER REST interface using authentication
725    */
726   public static final String XML_REST_AUTHENTICATED = "restauthenticated";
727   /**
728    * SERVER REST interface SHA Key for request checking
729    */
730   public static final String XML_REST_AUTH_KEY = "restsigkey";
731   /**
732    * SERVER REST interface signature usage (auth key usage)
733    */
734   public static final String XML_REST_SIGNATURE = "restsignature";
735   /**
736    * SERVER REST interface method
737    */
738   public static final String XML_REST_METHOD = "restmethod";
739   /**
740    * SERVER REST interface method
741    */
742   public static final String XML_REST_METHOD_NAME = "restname";
743   /**
744    * SERVER REST interface CRUD per method
745    */
746   public static final String XML_REST_CRUD = "restcrud";
747   public static final XmlDecl[] configRestMethodDecls = {
748       // Rest Method
749       new XmlDecl(XmlType.STRING, XML_REST_METHOD_NAME),
750       new XmlDecl(XmlType.STRING, XML_REST_CRUD)
751   };
752   /**
753    * Structure of the Configuration file
754    */
755   private static final XmlDecl[] configRestDecls = {
756       // Rest support configuration
757       new XmlDecl(XmlType.STRING, XML_REST_ADDRESS),
758       new XmlDecl(XmlType.INTEGER, XML_SERVER_REST_PORT),
759       new XmlDecl(XmlType.BOOLEAN, XML_REST_SSL),
760       new XmlDecl(XmlType.BOOLEAN, XML_REST_AUTHENTICATED),
761       new XmlDecl(XmlType.LONG, XML_REST_TIME_LIMIT),
762       new XmlDecl(XmlType.BOOLEAN, XML_REST_SIGNATURE),
763       new XmlDecl(XmlType.STRING, XML_REST_AUTH_KEY),
764       new XmlDecl(XML_REST_METHOD, XmlType.XVAL, XML_REST_METHOD,
765                   configRestMethodDecls, true)
766   };
767   /**
768    * Overall structure of the Configuration file
769    */
770   public static final String XML_ROOT = "/config/";
771   public static final String XML_IDENTITY = "identity";
772   public static final String XML_SERVER = "server";
773   public static final String XML_CLIENT = "client";
774   public static final String XML_DIRECTORY = "directory";
775   public static final String XML_LIMIT = "limit";
776   public static final String XML_NETWORK = "network";
777   public static final String XML_SSL = "ssl";
778   public static final String XML_DB = "db";
779   public static final String XML_EXTEND_TASK_FACTORY = "extendTaskFactory";
780   public static final String XML_PUSH_MONITOR = "pushMonitor";
781   /**
782    * Global Structure for Submit only Client Configuration
783    */
784   public static final XmlDecl[] configSubmitClient = {
785       new XmlDecl(XML_IDENTITY, XmlType.XVAL, XML_ROOT + XML_IDENTITY,
786                   configIdentityDecls, false),
787       new XmlDecl(XML_DIRECTORY, XmlType.XVAL, XML_ROOT + XML_DIRECTORY,
788                   configDirectoryDecls, false),
789       new XmlDecl(XML_LIMIT, XmlType.XVAL, XML_ROOT + XML_LIMIT,
790                   configSubmitLimitDecls, false),
791       new XmlDecl(XML_DB, XmlType.XVAL, XML_ROOT + XML_DB, configDbDecls,
792                   false), new XmlDecl(XML_EXTEND_TASK_FACTORY, XmlType.XVAL,
793                                       XML_ROOT + XML_EXTEND_TASK_FACTORY,
794                                       configExtendTaskFactoryDecls, false),
795       new XmlDecl(DbHostConfiguration.XML_ALIASES, XmlType.XVAL,
796                   XML_ROOT + DbHostConfiguration.XML_ALIASES + '/' +
797                   DbHostConfiguration.XML_ALIAS,
798                   DbHostConfiguration.configAliasDecls, true)
799   };
800   public static final String XML_REST = "rest";
801   /**
802    * Global Structure for Client Configuration
803    */
804   public static final XmlDecl[] configClient = {
805       new XmlDecl(XML_IDENTITY, XmlType.XVAL, XML_ROOT + XML_IDENTITY,
806                   configIdentityDecls, false),
807       new XmlDecl(XML_CLIENT, XmlType.XVAL, XML_ROOT + XML_CLIENT,
808                   configClientParamDecls, false),
809       new XmlDecl(XML_SSL, XmlType.XVAL, XML_ROOT + XML_SSL, configSslDecls,
810                   false),
811       new XmlDecl(XML_DIRECTORY, XmlType.XVAL, XML_ROOT + XML_DIRECTORY,
812                   configDirectoryDecls, false),
813       new XmlDecl(XML_LIMIT, XmlType.XVAL, XML_ROOT + XML_LIMIT,
814                   configLimitDecls, false),
815       new XmlDecl(XML_REST, XmlType.XVAL, XML_ROOT + XML_REST, configRestDecls,
816                   false),
817       new XmlDecl(XML_DB, XmlType.XVAL, XML_ROOT + XML_DB, configDbDecls,
818                   false), new XmlDecl(XML_EXTEND_TASK_FACTORY, XmlType.XVAL,
819                                       XML_ROOT + XML_EXTEND_TASK_FACTORY,
820                                       configExtendTaskFactoryDecls, false),
821       new XmlDecl(DbHostConfiguration.XML_BUSINESS, XmlType.STRING,
822                   XML_ROOT + DbHostConfiguration.XML_BUSINESS + '/' +
823                   DbHostConfiguration.XML_BUSINESSID, true),
824       new XmlDecl(DbHostConfiguration.XML_ALIASES, XmlType.XVAL,
825                   XML_ROOT + DbHostConfiguration.XML_ALIASES + '/' +
826                   DbHostConfiguration.XML_ALIAS,
827                   DbHostConfiguration.configAliasDecls, true)
828   };
829   /**
830    * Global Structure for Server Configuration
831    */
832   public static final XmlDecl[] configServer = {
833       new XmlDecl(XML_IDENTITY, XmlType.XVAL, XML_ROOT + XML_IDENTITY,
834                   configIdentityDecls, false),
835       new XmlDecl(XML_SERVER, XmlType.XVAL, XML_ROOT + XML_SERVER,
836                   configServerParamDecls, false),
837       new XmlDecl(XML_NETWORK, XmlType.XVAL, XML_ROOT + XML_NETWORK,
838                   configNetworkServerDecls, false),
839       new XmlDecl(XML_SSL, XmlType.XVAL, XML_ROOT + XML_SSL, configSslDecls,
840                   false),
841       new XmlDecl(XML_DIRECTORY, XmlType.XVAL, XML_ROOT + XML_DIRECTORY,
842                   configDirectoryDecls, false),
843       new XmlDecl(XML_LIMIT, XmlType.XVAL, XML_ROOT + XML_LIMIT,
844                   configLimitDecls, false),
845       new XmlDecl(XML_REST, XmlType.XVAL, XML_ROOT + XML_REST, configRestDecls,
846                   true),
847       new XmlDecl(XML_DB, XmlType.XVAL, XML_ROOT + XML_DB, configDbDecls,
848                   false), new XmlDecl(XML_EXTEND_TASK_FACTORY, XmlType.XVAL,
849                                       XML_ROOT + XML_EXTEND_TASK_FACTORY,
850                                       configExtendTaskFactoryDecls, false),
851       new XmlDecl(XML_PUSH_MONITOR, XmlType.XVAL, XML_ROOT + XML_PUSH_MONITOR,
852                   configServerPushMonitorParamDecls, false),
853       new XmlDecl(DbHostConfiguration.XML_BUSINESS, XmlType.STRING,
854                   XML_ROOT + DbHostConfiguration.XML_BUSINESS + '/' +
855                   DbHostConfiguration.XML_BUSINESSID, true),
856       new XmlDecl(DbHostConfiguration.XML_ROLES, XmlType.XVAL,
857                   XML_ROOT + DbHostConfiguration.XML_ROLES + '/' +
858                   DbHostConfiguration.XML_ROLE,
859                   DbHostConfiguration.configRoleDecls, true),
860       new XmlDecl(DbHostConfiguration.XML_ALIASES, XmlType.XVAL,
861                   XML_ROOT + DbHostConfiguration.XML_ALIASES + '/' +
862                   DbHostConfiguration.XML_ALIAS,
863                   DbHostConfiguration.configAliasDecls, true)
864   };
865 
866 }