You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by an...@apache.org on 2015/11/10 07:57:43 UTC

[1/7] ignite git commit: IGNITE-1857 Generate configuration zip on client side.

Repository: ignite
Updated Branches:
  refs/heads/ignite-843-rc1 0a76801ce -> 2dc76991a


http://git-wip-us.apache.org/repos/asf/ignite/blob/ce945056/modules/control-center-web/src/main/js/routes/generator/generator-pom.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/routes/generator/generator-pom.js b/modules/control-center-web/src/main/js/routes/generator/generator-pom.js
deleted file mode 100644
index b7bd05e..0000000
--- a/modules/control-center-web/src/main/js/routes/generator/generator-pom.js
+++ /dev/null
@@ -1,157 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-// For server side we should load required libraries.
-if (typeof window === 'undefined') {
-    _ = require('lodash');
-
-    $generatorCommon = require('./generator-common');
-}
-
-// pom.xml generation entry point.
-$generatorPom = {};
-
-/**
- * Generate pom.xml.
- *
- * @param caches Collection of caches to take info about used JDBC dialects.
- * @param igniteVersion Ignite version for Ignite dependencies.
- * @param res Resulting output with generated pom.
- * @returns {string} Generated content.
- */
-$generatorPom.pom = function (caches, igniteVersion, res) {
-    if (!res)
-        res = $generatorCommon.builder();
-
-    var dialect = {};
-
-    _.forEach(caches, function (cache) {
-        if (cache.cacheStoreFactory && cache.cacheStoreFactory.kind == 'CacheJdbcPojoStoreFactory') {
-            if (cache.cacheStoreFactory.CacheJdbcPojoStoreFactory) {
-                dialect[cache.cacheStoreFactory.CacheJdbcPojoStoreFactory.dialect] = true;
-            }
-        }
-    });
-
-    function addProperty(tag, val) {
-        res.line('<' + tag + '>' + val + '</' + tag + '>');
-    }
-
-    function addDependency(groupId, artifactId, version, jar) {
-        res.startBlock('<dependency>');
-        addProperty('groupId', groupId);
-        addProperty('artifactId', artifactId);
-        addProperty('version', version);
-
-        if (jar) {
-            addProperty('scope', 'system');
-            addProperty('systemPath', '${project.basedir}/jdbc-drivers/' + jar);
-        }
-
-        res.endBlock('</dependency>');
-    }
-
-    function addResource(dir, exclude) {
-        res.startBlock('<resource>');
-        if (dir)
-            addProperty('directory', dir);
-
-        if (exclude) {
-            res.startBlock('<excludes>');
-            addProperty('exclude', exclude);
-            res.endBlock('</excludes>');
-        }
-
-        res.endBlock('</resource>');
-    }
-
-    res.line('<?xml version="1.0" encoding="UTF-8"?>');
-
-    res.needEmptyLine = true;
-
-    res.line('<!-- ' + $generatorCommon.mainComment() + ' -->');
-
-    res.needEmptyLine = true;
-
-    res.startBlock('<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">');
-
-    res.line('<modelVersion>4.0.0</modelVersion>');
-
-    res.needEmptyLine = true;
-
-    addProperty('groupId', 'org.apache.ignite');
-    addProperty('artifactId', 'ignite-generated-model');
-    addProperty('version', igniteVersion);
-
-    res.needEmptyLine = true;
-
-    res.startBlock('<dependencies>');
-
-    addDependency('org.apache.ignite', 'ignite-core', igniteVersion);
-    addDependency('org.apache.ignite', 'ignite-spring', igniteVersion);
-    addDependency('org.apache.ignite', 'ignite-indexing', igniteVersion);
-    addDependency('org.apache.ignite', 'ignite-rest-http', igniteVersion);
-
-    if (dialect.MySQL)
-        addDependency('mysql', 'mysql-connector-java', '5.1.37');
-
-    if (dialect.PosgreSQL)
-        addDependency('org.postgresql', 'postgresql', '9.4-1204-jdbc42');
-
-    if (dialect.H2)
-        addDependency('com.h2database', 'h2', '1.3.175');
-
-    if (dialect.Oracle)
-        addDependency('oracle', 'jdbc', '11.2', 'ojdbc6.jar');
-
-    if (dialect.DB2)
-        addDependency('ibm', 'jdbc', '4.19.26', 'db2jcc4.jar');
-
-    if (dialect.SQLServer)
-        addDependency('microsoft', 'jdbc', '4.1', 'sqljdbc41.jar');
-
-    res.endBlock('</dependencies>');
-
-    res.needEmptyLine = true;
-
-    res.startBlock('<build>');
-    res.startBlock('<resources>');
-    addResource('src/main/java', '**/*.java');
-    addResource('src/main/resources');
-    res.endBlock('</resources>');
-
-    res.startBlock('<plugins>');
-    res.startBlock('<plugin>');
-    addProperty('artifactId', 'maven-compiler-plugin');
-    addProperty('version', '3.1');
-    res.startBlock('<configuration>');
-    addProperty('source', '1.7');
-    addProperty('target', '1.7');
-    res.endBlock('</configuration>');
-    res.endBlock('</plugin>');
-    res.endBlock('</plugins>');
-    res.endBlock('</build>');
-
-    res.endBlock('</project>');
-
-    return res;
-};
-
-// For server side we should export properties generation entry point.
-if (typeof window === 'undefined') {
-    module.exports = $generatorPom;
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/ce945056/modules/control-center-web/src/main/js/routes/generator/generator-properties.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/routes/generator/generator-properties.js b/modules/control-center-web/src/main/js/routes/generator/generator-properties.js
deleted file mode 100644
index 5a1dafe..0000000
--- a/modules/control-center-web/src/main/js/routes/generator/generator-properties.js
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-// For server side we should load required libraries.
-if (typeof window === 'undefined') {
-    _ = require('lodash');
-
-    $generatorCommon = require('./generator-common');
-}
-
-// Properties generation entry point.
-$generatorProperties = {};
-
-/**
- * Generate properties file with properties stubs for stores data sources.
- *
- * @param cluster Configuration to process.
- * @param res Resulting output with generated properties.
- * @returns {string} Generated content.
- */
-$generatorProperties.dataSourcesProperties = function (cluster, res) {
-    var datasources = [];
-
-    if (cluster.caches && cluster.caches.length > 0) {
-        _.forEach(cluster.caches, function (cache) {
-            if (cache.cacheStoreFactory && cache.cacheStoreFactory.kind) {
-                var storeFactory = cache.cacheStoreFactory[cache.cacheStoreFactory.kind];
-
-                if (storeFactory.dialect) {
-                    var beanId = storeFactory.dataSourceBean;
-
-                    if (!_.contains(datasources, beanId)) {
-                        datasources.push(beanId);
-
-                        if (!res) {
-                            res = $generatorCommon.builder();
-
-                            res.line('# ' + $generatorCommon.mainComment());
-                        }
-
-                        res.needEmptyLine = true;
-
-                        switch (storeFactory.dialect) {
-                            case 'DB2':
-                                res.line(beanId + '.jdbc.server_name=YOUR_JDBC_SERVER_NAME');
-                                res.line(beanId + '.jdbc.port_number=YOUR_JDBC_PORT_NUMBER');
-                                res.line(beanId + '.jdbc.database_name=YOUR_JDBC_DATABASE_TYPE');
-                                res.line(beanId + '.jdbc.driver_type=YOUR_JDBC_DRIVER_TYPE');
-                                break;
-
-                            default:
-                                res.line(beanId + '.jdbc.url=YOUR_JDBC_URL');
-                        }
-
-                        res.line(beanId + '.jdbc.username=YOUR_USER_NAME');
-                        res.line(beanId + '.jdbc.password=YOUR_PASSWORD');
-                        res.line();
-                    }
-                }
-            }
-        });
-    }
-
-    return res;
-};
-
-/**
- * Generate properties file with properties stubs for cluster SSL configuration.
- *
- * @param cluster Cluster to get SSL configuration.
- * @param res Optional configuration presentation builder object.
- * @returns Configuration presentation builder object
- */
-$generatorProperties.sslProperties = function (cluster, res) {
-    if (cluster.sslEnabled && cluster.sslContextFactory) {
-        if (!res) {
-            res = $generatorCommon.builder();
-
-            res.line('# ' + $generatorCommon.mainComment());
-        }
-
-        res.needEmptyLine = true;
-
-        if ($commonUtils.isDefinedAndNotEmpty(cluster.sslContextFactory.keyStoreFilePath))
-            res.line('ssl.key.storage.password=YOUR_SSL_KEY_STORAGE_PASSWORD');
-
-        if ($commonUtils.isDefinedAndNotEmpty(cluster.sslContextFactory.trustStoreFilePath))
-            res.line('ssl.trust.storage.password=YOUR_SSL_TRUST_STORAGE_PASSWORD');
-    }
-
-    return res;
-};
-
-// For server side we should export properties generation entry point.
-if (typeof window === 'undefined') {
-    module.exports = $generatorProperties;
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/ce945056/modules/control-center-web/src/main/js/routes/generator/generator-readme.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/routes/generator/generator-readme.js b/modules/control-center-web/src/main/js/routes/generator/generator-readme.js
deleted file mode 100644
index 5278e7f..0000000
--- a/modules/control-center-web/src/main/js/routes/generator/generator-readme.js
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-// For server side we should load required libraries.
-if (typeof window === 'undefined') {
-    $generatorCommon = require('./generator-common');
-}
-
-// README.txt generation entry point.
-$generatorReadme = {};
-
-/**
- * Generate README.txt.
- *
- * @param res Resulting output with generated pom.
- * @returns {string} Generated content.
- */
-$generatorReadme.readme = function (res) {
-    if (!res)
-        res = $generatorCommon.builder();
-
-    res.line('Content of this folder was generated by Apache Ignite Web Console');
-    res.line('=================================================================');
-
-    res.needEmptyLine = true;
-
-    res.line('Ignite ships with CacheJdbcPojoStore, which is out-of-the-box JDBC');
-    res.line('implementation of the IgniteCacheStore interface, and automatically');
-    res.line('handles all the write-through and read-through logic.');
-
-    res.needEmptyLine = true;
-
-    res.line('You can use generated configuration and POJO classes as part of your application.');
-
-    res.needEmptyLine = true;
-
-    res.line('Note, in case of using proprietary JDBC drivers (Oracle, IBM DB2, Microsoft SQL Server)');
-    res.line('you should download them and copy into ./jdbc-drivers folder.');
-
-    return res;
-};
-
-// For server side we should export properties generation entry point.
-if (typeof window === 'undefined') {
-    module.exports = $generatorReadme;
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/ce945056/modules/control-center-web/src/main/js/routes/generator/generator-xml.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/routes/generator/generator-xml.js b/modules/control-center-web/src/main/js/routes/generator/generator-xml.js
deleted file mode 100644
index 38885c5..0000000
--- a/modules/control-center-web/src/main/js/routes/generator/generator-xml.js
+++ /dev/null
@@ -1,1493 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-// For server side we should load required libraries.
-if (typeof window === 'undefined') {
-    _ = require('lodash');
-
-    $commonUtils = require('../../helpers/common-utils');
-    $dataStructures = require('../../helpers/data-structures');
-    $generatorCommon = require('./generator-common');
-}
-
-// XML generation entry point.
-$generatorXml = {};
-
-// Do XML escape.
-$generatorXml.escape = function (s) {
-    if (typeof(s) != 'string')
-        return s;
-
-    return s.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/"/g, '&quot;');
-};
-
-// Add XML element.
-$generatorXml.element = function (res, tag, attr1, val1, attr2, val2) {
-    var elem = '<' + tag;
-
-    if (attr1)
-        elem += ' ' + attr1 + '="' + val1 + '"';
-
-    if (attr2)
-        elem += ' ' + attr2 + '="' + val2 + '"';
-
-    elem += '/>';
-
-    res.emptyLineIfNeeded();
-    res.line(elem);
-};
-
-// Add property.
-$generatorXml.property = function (res, obj, propName, setterName, dflt) {
-    if ($commonUtils.isDefined(obj)) {
-        var val = obj[propName];
-
-        if ($commonUtils.isDefinedAndNotEmpty(val)) {
-            var hasDflt = $commonUtils.isDefined(dflt);
-
-            // Add to result if no default provided or value not equals to default.
-            if (!hasDflt || (hasDflt && val != dflt)) {
-                $generatorXml.element(res, 'property', 'name', setterName ? setterName : propName, 'value', $generatorXml.escape(val));
-
-                return true;
-            }
-        }
-    }
-
-    return false;
-};
-
-// Add property for class name.
-$generatorXml.classNameProperty = function (res, obj, propName) {
-    var val = obj[propName];
-
-    if ($commonUtils.isDefined(val))
-        $generatorXml.element(res, 'property', 'name', propName, 'value', $dataStructures.fullClassName(val));
-};
-
-// Add list property.
-$generatorXml.listProperty = function (res, obj, propName, listType, rowFactory) {
-    var val = obj[propName];
-
-    if (val && val.length > 0) {
-        res.emptyLineIfNeeded();
-
-        if (!listType)
-            listType = 'list';
-
-        if (!rowFactory)
-            rowFactory = function (val) {
-                return '<value>' + $generatorXml.escape(val) + '</value>'
-            };
-
-        res.startBlock('<property name="' + propName + '">');
-        res.startBlock('<' + listType + '>');
-
-        _.forEach(val, function(v) {
-            res.line(rowFactory(v));
-        });
-
-        res.endBlock('</' + listType + '>');
-        res.endBlock('</property>');
-
-        res.needEmptyLine = true;
-    }
-};
-
-// Add array property
-$generatorXml.arrayProperty = function (res, obj, propName, descr, rowFactory) {
-    var val = obj[propName];
-
-    if (val && val.length > 0) {
-        res.emptyLineIfNeeded();
-
-        if (!rowFactory)
-            rowFactory = function (val) {
-                return '<bean class="' + val + '"/>';
-            };
-
-        res.startBlock('<property name="' + propName + '">');
-        res.startBlock('<list>');
-
-        _.forEach(val, function (v) {
-            res.append(rowFactory(v))
-        });
-
-        res.endBlock('</list>');
-        res.endBlock('</property>');
-    }
-};
-
-// Add bean property.
-$generatorXml.beanProperty = function (res, bean, beanPropName, desc, createBeanAlthoughNoProps) {
-    var props = desc.fields;
-
-    if (bean && $commonUtils.hasProperty(bean, props)) {
-        res.startSafeBlock();
-
-        res.emptyLineIfNeeded();
-        res.startBlock('<property name="' + beanPropName + '">');
-        res.startBlock('<bean class="' + desc.className + '">');
-
-        var hasData = false;
-
-        _.forIn(props, function(descr, propName) {
-            if (props.hasOwnProperty(propName)) {
-                if (descr) {
-                    switch (descr.type) {
-                        case 'list':
-                            $generatorXml.listProperty(res, bean, propName, descr.setterName);
-
-                            break;
-
-                        case 'array':
-                            $generatorXml.arrayProperty(res, bean, propName, descr);
-
-                            break;
-
-                        case 'propertiesAsList':
-                            var val = bean[propName];
-
-                            if (val && val.length > 0) {
-                                res.startBlock('<property name="' + propName + '">');
-                                res.startBlock('<props>');
-
-                                _.forEach(val, function(nameAndValue) {
-                                    var eqIndex = nameAndValue.indexOf('=');
-                                    if (eqIndex >= 0) {
-                                        res.line('<prop key="' + $generatorXml.escape(nameAndValue.substring(0, eqIndex)) + '">' +
-                                            $generatorXml.escape(nameAndValue.substr(eqIndex + 1)) + '</prop>');
-                                    }
-                                });
-
-                                res.endBlock('</props>');
-                                res.endBlock('</property>');
-
-                                hasData = true;
-                            }
-
-                            break;
-
-                        case 'bean':
-                            if ($commonUtils.isDefinedAndNotEmpty(bean[propName])) {
-                                res.startBlock('<property name="' + propName + '">');
-                                res.line('<bean class="' + bean[propName] + '"/>');
-                                res.endBlock('</property>');
-
-                                hasData = true;
-                            }
-
-                            break;
-
-                        default:
-                            if ($generatorXml.property(res, bean, propName, descr.setterName, descr.dflt))
-                                hasData = true;
-                    }
-                }
-                else
-                    if ($generatorXml.property(res, bean, propName))
-                        hasData = true;
-            }
-        });
-
-        res.endBlock('</bean>');
-        res.endBlock('</property>');
-
-        if (!hasData)
-            res.rollbackSafeBlock();
-    }
-    else if (createBeanAlthoughNoProps) {
-        res.emptyLineIfNeeded();
-        res.line('<property name="' + beanPropName + '">');
-        res.line('    <bean class="' + desc.className + '"/>');
-        res.line('</property>');
-    }
-};
-
-// Generate eviction policy.
-$generatorXml.evictionPolicy = function (res, evtPlc, propName) {
-    if (evtPlc && evtPlc.kind) {
-        $generatorXml.beanProperty(res, evtPlc[evtPlc.kind.toUpperCase()], propName,
-            $generatorCommon.EVICTION_POLICIES[evtPlc.kind], true);
-    }
-};
-
-// Generate discovery.
-$generatorXml.clusterGeneral = function (cluster, res) {
-    if (!res)
-        res = $generatorCommon.builder();
-
-    $generatorXml.property(res, cluster, 'name', 'gridName');
-
-    if (cluster.discovery) {
-        res.startBlock('<property name="discoverySpi">');
-        res.startBlock('<bean class="org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi">');
-        res.startBlock('<property name="ipFinder">');
-
-        var d = cluster.discovery;
-
-        switch (d.kind) {
-            case 'Multicast':
-                res.startBlock('<bean class="org.apache.ignite.spi.discovery.tcp.ipfinder.multicast.TcpDiscoveryMulticastIpFinder">');
-
-                if (d.Multicast) {
-                    $generatorXml.property(res, d.Multicast, 'multicastGroup');
-                    $generatorXml.property(res, d.Multicast, 'multicastPort');
-                    $generatorXml.property(res, d.Multicast, 'responseWaitTime');
-                    $generatorXml.property(res, d.Multicast, 'addressRequestAttempts');
-                    $generatorXml.property(res, d.Multicast, 'localAddress');
-                    $generatorXml.listProperty(res, d.Multicast, 'addresses');
-                }
-
-                res.endBlock('</bean>');
-
-                break;
-
-            case 'Vm':
-                res.startBlock('<bean class="org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder">');
-
-                if (d.Vm) {
-                    $generatorXml.listProperty(res, d.Vm, 'addresses');
-                }
-
-                res.endBlock('</bean>');
-
-                break;
-
-            case 'S3':
-                res.startBlock('<bean class="org.apache.ignite.spi.discovery.tcp.ipfinder.s3.TcpDiscoveryS3IpFinder">');
-
-                if (d.S3) {
-                    if (d.S3.bucketName)
-                        res.line('<property name="bucketName" value="' + $generatorXml.escape(d.S3.bucketName) + '" />');
-                }
-
-                res.endBlock('</bean>');
-
-                break;
-
-            case 'Cloud':
-                res.startBlock('<bean class="org.apache.ignite.spi.discovery.tcp.ipfinder.cloud.TcpDiscoveryCloudIpFinder">');
-
-                if (d.Cloud) {
-                    $generatorXml.property(res, d.Cloud, 'credential');
-                    $generatorXml.property(res, d.Cloud, 'credentialPath');
-                    $generatorXml.property(res, d.Cloud, 'identity');
-                    $generatorXml.property(res, d.Cloud, 'provider');
-                    $generatorXml.listProperty(res, d.Cloud, 'regions');
-                    $generatorXml.listProperty(res, d.Cloud, 'zones');
-                }
-
-                res.endBlock('</bean>');
-
-                break;
-
-            case 'GoogleStorage':
-                res.startBlock('<bean class="org.apache.ignite.spi.discovery.tcp.ipfinder.gce.TcpDiscoveryGoogleStorageIpFinder">');
-
-                if (d.GoogleStorage) {
-                    $generatorXml.property(res, d.GoogleStorage, 'projectName');
-                    $generatorXml.property(res, d.GoogleStorage, 'bucketName');
-                    $generatorXml.property(res, d.GoogleStorage, 'serviceAccountP12FilePath');
-                    $generatorXml.property(res, d.GoogleStorage, 'serviceAccountId');
-                }
-
-                res.endBlock('</bean>');
-
-                break;
-
-            case 'Jdbc':
-                res.startBlock('<bean class="org.apache.ignite.spi.discovery.tcp.ipfinder.jdbc.TcpDiscoveryJdbcIpFinder">');
-
-                if (d.Jdbc) {
-                    res.line('<property name="initSchema" value="' + ($commonUtils.isDefined(d.Jdbc.initSchema) && d.Jdbc.initSchema) + '"/>');
-                }
-
-                res.endBlock('</bean>');
-
-                break;
-
-            case 'SharedFs':
-                res.startBlock('<bean class="org.apache.ignite.spi.discovery.tcp.ipfinder.sharedfs.TcpDiscoverySharedFsIpFinder">');
-
-                if (d.SharedFs) {
-                    $generatorXml.property(res, d.SharedFs, 'path');
-                }
-
-                res.endBlock('</bean>');
-
-                break;
-
-            default:
-                throw "Unknown discovery kind: " + d.kind;
-        }
-
-        res.endBlock('</property>');
-
-        $generatorXml.clusterDiscovery(d, res);
-
-        res.endBlock('</bean>');
-        res.endBlock('</property>');
-
-        res.needEmptyLine = true;
-    }
-
-    return res;
-};
-
-// Generate atomics group.
-$generatorXml.clusterAtomics = function (cluster, res) {
-    if (!res)
-        res = $generatorCommon.builder();
-
-    var atomics = cluster.atomicConfiguration;
-
-    if ($commonUtils.hasAtLeastOneProperty(atomics, ['cacheMode', 'atomicSequenceReserveSize', 'backups'])) {
-        res.startSafeBlock();
-
-        res.emptyLineIfNeeded();
-
-        res.startBlock('<property name="atomicConfiguration">');
-        res.startBlock('<bean class="org.apache.ignite.configuration.AtomicConfiguration">');
-
-        var cacheMode = atomics.cacheMode ? atomics.cacheMode : 'PARTITIONED';
-
-        var hasData = cacheMode != 'PARTITIONED';
-
-        $generatorXml.property(res, atomics, 'cacheMode');
-
-        hasData = $generatorXml.property(res, atomics, 'atomicSequenceReserveSize') || hasData;
-
-        if (cacheMode == 'PARTITIONED')
-            hasData = $generatorXml.property(res, atomics, 'backups') || hasData;
-
-        res.endBlock('</bean>');
-        res.endBlock('</property>');
-
-        res.needEmptyLine = true;
-
-        if (!hasData)
-            res.rollbackSafeBlock();
-    }
-
-    return res;
-};
-
-// Generate communication group.
-$generatorXml.clusterCommunication = function (cluster, res) {
-    if (!res)
-        res = $generatorCommon.builder();
-
-    $generatorXml.beanProperty(res, cluster.communication, 'communicationSpi', $generatorCommon.COMMUNICATION_CONFIGURATION);
-
-    $generatorXml.property(res, cluster, 'networkTimeout', undefined, 5000);
-    $generatorXml.property(res, cluster, 'networkSendRetryDelay', undefined, 1000);
-    $generatorXml.property(res, cluster, 'networkSendRetryCount', undefined, 3);
-    $generatorXml.property(res, cluster, 'segmentCheckFrequency');
-    $generatorXml.property(res, cluster, 'waitForSegmentOnStart', null, false);
-    $generatorXml.property(res, cluster, 'discoveryStartupDelay', undefined, 600000);
-
-    res.needEmptyLine = true;
-
-    return res;
-};
-
-/**
- * XML generator for cluster's REST access configuration.
- *
- * @param cluster Cluster to get REST configuration.
- * @param res Optional configuration presentation builder object.
- * @returns Configuration presentation builder object
- */
-$generatorXml.clusterConnector = function(cluster, res) {
-    if (!res)
-        res = $generatorCommon.builder();
-
-    if ($commonUtils.isDefined(cluster.connector) && cluster.connector.enabled) {
-        var cfg = _.cloneDeep($generatorCommon.CONNECTOR_CONFIGURATION);
-
-        if (cluster.connector.sslEnabled) {
-            cfg.fields.sslClientAuth = {dflt: false};
-            cfg.fields.sslFactory = {type: 'bean'};
-        }
-
-        $generatorXml.beanProperty(res, cluster.connector, 'connectorConfiguration', cfg, true);
-
-        res.needEmptyLine = true;
-    }
-
-    return res;
-};
-
-// Generate deployment group.
-$generatorXml.clusterDeployment = function (cluster, res) {
-    if (!res)
-        res = $generatorCommon.builder();
-
-    if ($generatorXml.property(res, cluster, 'deploymentMode', null, 'SHARED'))
-        res.needEmptyLine = true;
-
-    var p2pEnabled = cluster.peerClassLoadingEnabled;
-
-    if ($commonUtils.isDefined(p2pEnabled)) {
-        $generatorXml.property(res, cluster, 'peerClassLoadingEnabled', null, false);
-
-        if (p2pEnabled) {
-            $generatorXml.property(res, cluster, 'peerClassLoadingMissedResourcesCacheSize');
-            $generatorXml.property(res, cluster, 'peerClassLoadingThreadPoolSize');
-            $generatorXml.listProperty(res, cluster, 'peerClassLoadingLocalClassPathExclude');
-        }
-
-        res.needEmptyLine = true;
-    }
-
-    return res;
-};
-
-// Generate discovery group.
-$generatorXml.clusterDiscovery = function (disco, res) {
-    if (!res)
-        res = $generatorCommon.builder();
-
-    $generatorXml.property(res, disco, 'localAddress');
-    $generatorXml.property(res, disco, 'localPort', undefined, 47500);
-    $generatorXml.property(res, disco, 'localPortRange', undefined, 100);
-    if ($commonUtils.isDefinedAndNotEmpty(disco.addressResolver))
-        $generatorXml.beanProperty(res, disco, 'addressResolver', {className: disco.addressResolver}, true);
-    $generatorXml.property(res, disco, 'socketTimeout', undefined, 5000);
-    $generatorXml.property(res, disco, 'ackTimeout', undefined, 5000);
-    $generatorXml.property(res, disco, 'maxAckTimeout', undefined, 600000);
-    $generatorXml.property(res, disco, 'discoNetworkTimeout', 'setNetworkTimeout', 5000);
-    $generatorXml.property(res, disco, 'joinTimeout', undefined, 0);
-    $generatorXml.property(res, disco, 'threadPriority', undefined, 10);
-    $generatorXml.property(res, disco, 'heartbeatFrequency', undefined, 2000);
-    $generatorXml.property(res, disco, 'maxMissedHeartbeats', undefined, 1);
-    $generatorXml.property(res, disco, 'maxMissedClientHeartbeats', undefined, 5);
-    $generatorXml.property(res, disco, 'topHistorySize', undefined, 100);
-    if ($commonUtils.isDefinedAndNotEmpty(disco.listener))
-        $generatorXml.beanProperty(res, disco, 'listener', {className: disco.listener}, true);
-    if ($commonUtils.isDefinedAndNotEmpty(disco.dataExchange))
-        $generatorXml.beanProperty(res, disco, 'dataExchange', {className: disco.dataExchange}, true);
-    if ($commonUtils.isDefinedAndNotEmpty(disco.metricsProvider))
-        $generatorXml.beanProperty(res, disco, 'metricsProvider', {className: disco.metricsProvider}, true);
-    $generatorXml.property(res, disco, 'reconnectCount', undefined, 10);
-    $generatorXml.property(res, disco, 'statisticsPrintFrequency', undefined, 0);
-    $generatorXml.property(res, disco, 'ipFinderCleanFrequency', undefined, 60000);
-    if ($commonUtils.isDefinedAndNotEmpty(disco.authenticator))
-        $generatorXml.beanProperty(res, disco, 'authenticator', {className: disco.authenticator}, true);
-    $generatorXml.property(res, disco, 'forceServerMode', undefined, false);
-    $generatorXml.property(res, disco, 'clientReconnectDisabled', undefined, false);
-
-    res.needEmptyLine = true;
-
-    return res;
-};
-
-// Generate events group.
-$generatorXml.clusterEvents = function (cluster, res) {
-    if (!res)
-        res = $generatorCommon.builder();
-
-    if (cluster.includeEventTypes && cluster.includeEventTypes.length > 0) {
-        res.emptyLineIfNeeded();
-
-        res.startBlock('<property name="includeEventTypes">');
-
-        if (cluster.includeEventTypes.length == 1)
-            res.line('<util:constant static-field="org.apache.ignite.events.EventType.' + cluster.includeEventTypes[0] + '"/>');
-        else {
-            res.startBlock('<list>');
-
-            _.forEach(cluster.includeEventTypes, function(eventGroup, ix) {
-                if (ix > 0)
-                    res.line();
-
-                res.line('<!-- EventType.' + eventGroup + ' -->');
-
-                var eventList = $dataStructures.EVENT_GROUPS[eventGroup];
-
-                _.forEach(eventList, function(event) {
-                    res.line('<util:constant static-field="org.apache.ignite.events.EventType.' + event + '"/>')
-                });
-            });
-
-            res.endBlock('</list>');
-        }
-
-        res.endBlock('</property>');
-
-        res.needEmptyLine = true;
-    }
-
-    return res;
-};
-
-// Generate marshaller group.
-$generatorXml.clusterMarshaller = function (cluster, res) {
-    if (!res)
-        res = $generatorCommon.builder();
-
-    var marshaller = cluster.marshaller;
-
-    if (marshaller && marshaller.kind) {
-        $generatorXml.beanProperty(res, marshaller[marshaller.kind], 'marshaller', $generatorCommon.MARSHALLERS[marshaller.kind], true);
-
-        res.needEmptyLine = true;
-    }
-
-    $generatorXml.property(res, cluster, 'marshalLocalJobs', null, false);
-    $generatorXml.property(res, cluster, 'marshallerCacheKeepAliveTime');
-    $generatorXml.property(res, cluster, 'marshallerCacheThreadPoolSize');
-
-    res.needEmptyLine = true;
-
-    return res;
-};
-
-// Generate metrics group.
-$generatorXml.clusterMetrics = function (cluster, res) {
-    if (!res)
-        res = $generatorCommon.builder();
-
-    $generatorXml.property(res, cluster, 'metricsExpireTime');
-    $generatorXml.property(res, cluster, 'metricsHistorySize');
-    $generatorXml.property(res, cluster, 'metricsLogFrequency');
-    $generatorXml.property(res, cluster, 'metricsUpdateFrequency');
-
-    res.needEmptyLine = true;
-
-    return res;
-};
-
-// Generate swap group.
-$generatorXml.clusterSwap = function (cluster, res) {
-    if (!res)
-        res = $generatorCommon.builder();
-
-    if (cluster.swapSpaceSpi && cluster.swapSpaceSpi.kind == 'FileSwapSpaceSpi') {
-        $generatorXml.beanProperty(res, cluster.swapSpaceSpi.FileSwapSpaceSpi, 'swapSpaceSpi',
-            $generatorCommon.SWAP_SPACE_SPI, true);
-
-        res.needEmptyLine = true;
-    }
-
-    return res;
-};
-
-// Generate time group.
-$generatorXml.clusterTime = function (cluster, res) {
-    if (!res)
-        res = $generatorCommon.builder();
-
-    $generatorXml.property(res, cluster, 'clockSyncSamples');
-    $generatorXml.property(res, cluster, 'clockSyncFrequency');
-    $generatorXml.property(res, cluster, 'timeServerPortBase');
-    $generatorXml.property(res, cluster, 'timeServerPortRange');
-
-    res.needEmptyLine = true;
-
-    return res;
-};
-
-// Generate thread pools group.
-$generatorXml.clusterPools = function (cluster, res) {
-    if (!res)
-        res = $generatorCommon.builder();
-
-    $generatorXml.property(res, cluster, 'publicThreadPoolSize');
-    $generatorXml.property(res, cluster, 'systemThreadPoolSize');
-    $generatorXml.property(res, cluster, 'managementThreadPoolSize');
-    $generatorXml.property(res, cluster, 'igfsThreadPoolSize');
-
-    res.needEmptyLine = true;
-
-    return res;
-};
-
-// Generate transactions group.
-$generatorXml.clusterTransactions = function (cluster, res) {
-    if (!res)
-        res = $generatorCommon.builder();
-
-    $generatorXml.beanProperty(res, cluster.transactionConfiguration, 'transactionConfiguration', $generatorCommon.TRANSACTION_CONFIGURATION);
-
-    res.needEmptyLine = true;
-
-    return res;
-};
-
-/**
- * XML generator for cluster's SSL configuration.
- *
- * @param cluster Cluster to get SSL configuration.
- * @param res Optional configuration presentation builder object.
- * @returns Configuration presentation builder object
- */
-$generatorXml.clusterSsl = function(cluster, res) {
-    if (!res)
-        res = $generatorCommon.builder();
-
-    if (cluster.sslEnabled && $commonUtils.isDefined(cluster.sslContextFactory)) {
-        cluster.sslContextFactory.keyStorePassword =
-            $commonUtils.isDefinedAndNotEmpty(cluster.sslContextFactory.keyStoreFilePath) ? '${ssl.key.storage.password}' : undefined;
-
-        cluster.sslContextFactory.trustStorePassword =
-            $commonUtils.isDefinedAndNotEmpty(cluster.sslContextFactory.trustStoreFilePath) ? '${ssl.trust.storage.password}' : undefined;
-
-        var propsDesc = $commonUtils.isDefinedAndNotEmpty(cluster.sslContextFactory.trustManagers) ?
-            $generatorCommon.SSL_CONFIGURATION_TRUST_MANAGER_FACTORY :
-            $generatorCommon.SSL_CONFIGURATION_TRUST_FILE_FACTORY;
-
-        $generatorXml.beanProperty(res, cluster.sslContextFactory, 'sslContextFactory', propsDesc, true);
-
-        res.needEmptyLine = true;
-    }
-
-    return res;
-};
-
-// Generate cache general group.
-$generatorXml.cacheGeneral = function(cache, res) {
-    if (!res)
-        res = $generatorCommon.builder();
-
-    $generatorXml.property(res, cache, 'name');
-
-    $generatorXml.property(res, cache, 'cacheMode');
-    $generatorXml.property(res, cache, 'atomicityMode');
-
-    if (cache.cacheMode == 'PARTITIONED')
-        $generatorXml.property(res, cache, 'backups');
-
-    $generatorXml.property(res, cache, 'readFromBackup');
-    $generatorXml.property(res, cache, 'copyOnRead');
-    $generatorXml.property(res, cache, 'invalidate');
-
-    res.needEmptyLine = true;
-
-    return res;
-};
-
-// Generate cache memory group.
-$generatorXml.cacheMemory = function(cache, res) {
-    if (!res)
-        res = $generatorCommon.builder();
-
-    $generatorXml.property(res, cache, 'memoryMode');
-    $generatorXml.property(res, cache, 'offHeapMaxMemory');
-
-    res.needEmptyLine = true;
-
-    $generatorXml.evictionPolicy(res, cache.evictionPolicy, 'evictionPolicy');
-
-    res.needEmptyLine = true;
-
-    $generatorXml.property(res, cache, 'swapEnabled');
-    $generatorXml.property(res, cache, 'startSize');
-
-    res.needEmptyLine = true;
-
-    return res;
-};
-
-// Generate cache query & indexing group.
-$generatorXml.cacheQuery = function(cache, res) {
-    if (!res)
-        res = $generatorCommon.builder();
-
-    $generatorXml.property(res, cache, 'sqlOnheapRowCacheSize');
-    $generatorXml.property(res, cache, 'longQueryWarningTimeout');
-
-    if (cache.indexedTypes && cache.indexedTypes.length > 0) {
-        res.startBlock('<property name="indexedTypes">');
-        res.startBlock('<list>');
-
-        _.forEach(cache.indexedTypes, function(pair) {
-            res.line('<value>' + $dataStructures.fullClassName(pair.keyClass) + '</value>');
-            res.line('<value>' + $dataStructures.fullClassName(pair.valueClass) + '</value>');
-        });
-
-        res.endBlock('</list>');
-        res.endBlock('</property>');
-
-        res.needEmptyLine = true;
-    }
-
-    $generatorXml.listProperty(res, cache, 'sqlFunctionClasses');
-
-    $generatorXml.property(res, cache, 'sqlEscapeAll');
-
-    res.needEmptyLine = true;
-
-    return res;
-};
-
-// Generate cache store group.
-$generatorXml.cacheStore = function(cache, res) {
-    if (!res)
-        res = $generatorCommon.builder();
-
-    if (cache.cacheStoreFactory && cache.cacheStoreFactory.kind) {
-        var factoryKind = cache.cacheStoreFactory.kind;
-
-        var storeFactory = cache.cacheStoreFactory[factoryKind];
-
-        if (storeFactory) {
-            if (factoryKind == 'CacheJdbcPojoStoreFactory') {
-                res.startBlock('<property name="cacheStoreFactory">');
-                res.startBlock('<bean class="org.apache.ignite.cache.store.jdbc.CacheJdbcPojoStoreFactory">');
-                res.startBlock('<property name="configuration">');
-                res.startBlock('<bean class="org.apache.ignite.cache.store.jdbc.CacheJdbcPojoStoreConfiguration">');
-
-                $generatorXml.property(res, storeFactory, 'dataSourceBean');
-
-                res.startBlock('<property name="dialect">');
-                res.line('<bean class="' + $generatorCommon.jdbcDialectClassName(storeFactory.dialect) + '"/>');
-                res.endBlock('</property>');
-
-                var metadatas = cache.metadatas;
-
-                if (metadatas && metadatas.length > 0) {
-                    res.startBlock('<property name="types">');
-                    res.startBlock('<list>');
-
-                    _.forEach(metadatas, function (meta) {
-                        res.startBlock('<bean class="org.apache.ignite.cache.store.jdbc.JdbcType">');
-
-                        $generatorXml.classNameProperty(res, meta, 'keyType');
-                        $generatorXml.property(res, meta, 'valueType');
-                        $generatorXml.property(res, meta, 'keepSerialized', null, null, false);
-
-                        res.endBlock('</bean>');
-                    });
-
-                    res.endBlock('</list>');
-                    res.endBlock('</property>');
-                }
-
-                res.endBlock('</bean>');
-                res.endBlock("</property>");
-                res.endBlock('</bean>');
-                res.endBlock("</property>")
-            }
-            else {
-                $generatorXml.beanProperty(res, storeFactory, 'cacheStoreFactory', $generatorCommon.STORE_FACTORIES[factoryKind], true);
-
-                if (storeFactory.dialect) {
-                    if (_.findIndex(res.datasources, function (ds) {
-                            return ds.dataSourceBean == storeFactory.dataSourceBean;
-                        }) < 0) {
-                        res.datasources.push({
-                            dataSourceBean: storeFactory.dataSourceBean,
-                            className: $generatorCommon.DATA_SOURCES[storeFactory.dialect],
-                            dialect: storeFactory.dialect
-                        });
-                    }
-                }
-            }
-
-            res.needEmptyLine = true;
-        }
-    }
-
-    $generatorXml.property(res, cache, 'loadPreviousValue');
-    $generatorXml.property(res, cache, 'readThrough');
-    $generatorXml.property(res, cache, 'writeThrough');
-
-    res.needEmptyLine = true;
-
-    $generatorXml.property(res, cache, 'writeBehindEnabled');
-    $generatorXml.property(res, cache, 'writeBehindBatchSize');
-    $generatorXml.property(res, cache, 'writeBehindFlushSize');
-    $generatorXml.property(res, cache, 'writeBehindFlushFrequency');
-    $generatorXml.property(res, cache, 'writeBehindFlushThreadCount');
-
-    res.needEmptyLine = true;
-
-    return res;
-};
-
-// Generate cache concurrency group.
-$generatorXml.cacheConcurrency = function(cache, res) {
-    if (!res)
-        res = $generatorCommon.builder();
-
-    $generatorXml.property(res, cache, 'maxConcurrentAsyncOperations');
-    $generatorXml.property(res, cache, 'defaultLockTimeout');
-    $generatorXml.property(res, cache, 'atomicWriteOrderMode');
-    $generatorXml.property(res, cache, 'writeSynchronizationMode');
-
-    res.needEmptyLine = true;
-
-    return res;
-};
-
-// Generate cache rebalance group.
-$generatorXml.cacheRebalance = function(cache, res) {
-    if (!res)
-        res = $generatorCommon.builder();
-
-    if (cache.cacheMode != 'LOCAL') {
-        $generatorXml.property(res, cache, 'rebalanceMode');
-        $generatorXml.property(res, cache, 'rebalanceThreadPoolSize');
-        $generatorXml.property(res, cache, 'rebalanceBatchSize');
-        $generatorXml.property(res, cache, 'rebalanceOrder');
-        $generatorXml.property(res, cache, 'rebalanceDelay');
-        $generatorXml.property(res, cache, 'rebalanceTimeout');
-        $generatorXml.property(res, cache, 'rebalanceThrottle');
-
-        res.needEmptyLine = true;
-    }
-
-    if (cache.igfsAffinnityGroupSize) {
-        res.startBlock('<property name="affinityMapper">');
-        res.startBlock('<bean class="org.apache.ignite.igfs.IgfsGroupDataBlocksKeyMapper">');
-        res.line('<constructor-arg value="' + cache.igfsAffinnityGroupSize + '"/>');
-        res.endBlock('</bean>');
-        res.endBlock('</property>');
-    }
-
-    return res;
-};
-
-// Generate cache server near cache group.
-$generatorXml.cacheServerNearCache = function(cache, res) {
-    if (!res)
-        res = $generatorCommon.builder();
-
-    if (cache.cacheMode == 'PARTITIONED' && cache.nearCacheEnabled) {
-        res.emptyLineIfNeeded();
-
-        res.startBlock('<property name="nearConfiguration">');
-        res.startBlock('<bean class="org.apache.ignite.configuration.NearCacheConfiguration">');
-
-        if (cache.nearConfiguration) {
-            if (cache.nearConfiguration.nearStartSize)
-                $generatorXml.property(res, cache.nearConfiguration, 'nearStartSize');
-
-
-            $generatorXml.evictionPolicy(res, cache.nearConfiguration.nearEvictionPolicy, 'nearEvictionPolicy');
-        }
-
-
-
-        res.endBlock('</bean>');
-        res.endBlock('</property>');
-    }
-
-    res.needEmptyLine = true;
-
-    return res;
-};
-
-// Generate cache statistics group.
-$generatorXml.cacheStatistics = function(cache, res) {
-    if (!res)
-        res = $generatorCommon.builder();
-
-    $generatorXml.property(res, cache, 'statisticsEnabled');
-    $generatorXml.property(res, cache, 'managementEnabled');
-
-    res.needEmptyLine = true;
-
-    return res;
-};
-
-// Generate metadata query fields.
-$generatorXml.metadataQueryFields = function (res, meta) {
-    var fields = meta.fields;
-
-    if (fields && fields.length > 0) {
-        res.emptyLineIfNeeded();
-
-        res.startBlock('<property name="fields">');
-        res.startBlock('<map>');
-
-        _.forEach(fields, function (field) {
-            $generatorXml.element(res, 'entry', 'key', field.name.toUpperCase(), 'value', $dataStructures.fullClassName(field.className));
-        });
-
-        res.endBlock('</map>');
-        res.endBlock('</property>');
-
-        res.needEmptyLine = true;
-    }
-};
-
-// Generate metadata query fields.
-$generatorXml.metadataQueryAliases = function (res, meta) {
-    var aliases = meta.aliases;
-
-    if (aliases && aliases.length > 0) {
-        res.emptyLineIfNeeded();
-
-        res.startBlock('<property name="aliases">');
-        res.startBlock('<map>');
-
-        _.forEach(aliases, function (alias) {
-            $generatorXml.element(res, 'entry', 'key', alias.field, 'value', alias.alias);
-        });
-
-        res.endBlock('</map>');
-        res.endBlock('</property>');
-
-        res.needEmptyLine = true;
-    }
-};
-
-// Generate metadata indexes.
-$generatorXml.metadataQueryIndexes = function (res, meta) {
-    var indexes = meta.indexes;
-
-    if (indexes && indexes.length > 0) {
-        res.emptyLineIfNeeded();
-
-        res.startBlock('<property name="indexes">');
-        res.startBlock('<list>');
-
-        _.forEach(indexes, function (index) {
-            res.startBlock('<bean class="org.apache.ignite.cache.store.QueryEntityIndex">');
-
-            $generatorXml.property(res, index, 'name');
-            $generatorXml.property(res, index, 'type');
-
-            var fields = index.fields;
-
-            if (fields && fields.length > 0) {
-                res.startBlock('<property name="fields">');
-                res.startBlock('<map>');
-
-                _.forEach(fields, function (field) {
-                    $generatorXml.element(res, 'entry', 'key', field.name, 'value', field.direction);
-                });
-
-                res.endBlock('</map>');
-                res.endBlock('</property>');
-            }
-
-            res.endBlock('</bean>');
-        });
-
-        res.endBlock('</list>');
-        res.endBlock('</property>');
-
-        res.needEmptyLine = true;
-    }
-};
-
-// Generate metadata db fields.
-$generatorXml.metadataDatabaseFields = function (res, meta, fieldProp) {
-    var fields = meta[fieldProp];
-
-    if (fields && fields.length > 0) {
-        res.emptyLineIfNeeded();
-
-        res.startBlock('<property name="' + fieldProp + '">');
-
-        res.startBlock('<list>');
-
-        _.forEach(fields, function (field) {
-            res.startBlock('<bean class="org.apache.ignite.cache.store.jdbc.JdbcTypeField">');
-
-            $generatorXml.property(res, field, 'databaseName');
-
-            res.startBlock('<property name="databaseType">');
-            res.line('<util:constant static-field="java.sql.Types.' + field.databaseType + '"/>');
-            res.endBlock('</property>');
-
-            $generatorXml.property(res, field, 'javaName');
-
-            $generatorXml.classNameProperty(res, field, 'javaType');
-
-            res.endBlock('</bean>');
-        });
-
-        res.endBlock('</list>');
-        res.endBlock('</property>');
-
-        res.needEmptyLine = true;
-    }
-};
-
-// Generate metadata general group.
-$generatorXml.metadataGeneral = function(meta, res) {
-    if (!res)
-        res = $generatorCommon.builder();
-
-    $generatorXml.classNameProperty(res, meta, 'keyType');
-    $generatorXml.property(res, meta, 'valueType');
-
-    res.needEmptyLine = true;
-
-    return res;
-};
-
-// Generate metadata for query group.
-$generatorXml.metadataQuery = function(meta, res) {
-    if (!res)
-        res = $generatorCommon.builder();
-
-    $generatorXml.metadataQueryFields(res, meta);
-
-    $generatorXml.metadataQueryAliases(res, meta);
-
-    $generatorXml.metadataQueryIndexes(res, meta);
-
-    res.needEmptyLine = true;
-
-    return res;
-};
-
-// Generate metadata for store group.
-$generatorXml.metadataStore = function(meta, res) {
-    if (!res)
-        res = $generatorCommon.builder();
-
-    $generatorXml.property(res, meta, 'databaseSchema');
-    $generatorXml.property(res, meta, 'databaseTable');
-    $generatorXml.property(res, meta, 'keepSerialized');
-
-    res.needEmptyLine = true;
-
-    if (!$dataStructures.isJavaBuildInClass(meta.keyType))
-        $generatorXml.metadataDatabaseFields(res, meta, 'keyFields');
-
-    $generatorXml.metadataDatabaseFields(res, meta, 'valueFields');
-
-    res.needEmptyLine = true;
-
-    return res;
-};
-
-$generatorXml.cacheQueryMetadata = function(meta, res) {
-    if (!res)
-        res = $generatorCommon.builder();
-
-    res.startBlock('<bean class="org.apache.ignite.cache.store.QueryEntity">');
-
-    $generatorXml.classNameProperty(res, meta, 'keyType');
-    $generatorXml.property(res, meta, 'valueType');
-
-    $generatorXml.metadataQuery(meta, res);
-
-    res.endBlock('</bean>');
-
-    res.needEmptyLine = true;
-
-    return res;
-};
-
-// Generate cache type metadata configs.
-$generatorXml.cacheMetadatas = function(metadatas, res) {
-    if (!res)
-        res = $generatorCommon.builder();
-
-    if (metadatas && metadatas.length > 0) {
-        res.emptyLineIfNeeded();
-
-        res.startBlock('<property name="queryEntities">');
-        res.startBlock('<list>');
-
-        _.forEach(metadatas, function (meta) {
-            $generatorXml.cacheQueryMetadata(meta, res);
-        });
-
-        res.endBlock('</list>');
-        res.endBlock('</property>');
-    }
-
-    return res;
-};
-
-// Generate cache configs.
-$generatorXml.cache = function(cache, res) {
-    if (!res)
-        res = $generatorCommon.builder();
-
-    res.startBlock('<bean class="org.apache.ignite.configuration.CacheConfiguration">');
-
-    $generatorXml.cacheGeneral(cache, res);
-
-    $generatorXml.cacheMemory(cache, res);
-
-    $generatorXml.cacheQuery(cache, res);
-
-    $generatorXml.cacheStore(cache, res);
-
-    $generatorXml.cacheConcurrency(cache, res);
-
-    $generatorXml.cacheRebalance(cache, res);
-
-    $generatorXml.cacheServerNearCache(cache, res);
-
-    $generatorXml.cacheStatistics(cache, res);
-
-    $generatorXml.cacheMetadatas(cache.metadatas, res);
-
-    res.endBlock('</bean>');
-
-    return res;
-};
-
-// Generate caches configs.
-$generatorXml.clusterCaches = function(caches, igfss, res) {
-    if (!res)
-        res = $generatorCommon.builder();
-
-    if ((caches && caches.length > 0) || (igfss && igfss.length > 0)) {
-        res.emptyLineIfNeeded();
-
-        res.startBlock('<property name="cacheConfiguration">');
-        res.startBlock('<list>');
-
-        _.forEach(caches, function(cache) {
-            $generatorXml.cache(cache, res);
-
-            res.needEmptyLine = true;
-        });
-
-        _.forEach(igfss, function(igfs) {
-            $generatorXml.cache($generatorCommon.igfsDataCache(igfs), res);
-
-            res.needEmptyLine = true;
-
-            $generatorXml.cache($generatorCommon.igfsMetaCache(igfs), res);
-
-            res.needEmptyLine = true;
-        });
-
-        res.endBlock('</list>');
-        res.endBlock('</property>');
-
-        res.needEmptyLine = true;
-    }
-
-    return res;
-};
-
-// Generate IGFSs configs.
-$generatorXml.igfss = function(igfss, res) {
-    if (!res)
-        res = $generatorCommon.builder();
-
-    if ($commonUtils.isDefinedAndNotEmpty(igfss)) {
-        res.emptyLineIfNeeded();
-
-        res.startBlock('<property name="fileSystemConfiguration">');
-        res.startBlock('<list>');
-
-        _.forEach(igfss, function(igfs) {
-            res.startBlock('<bean class="org.apache.ignite.configuration.FileSystemConfiguration">');
-
-            $generatorXml.igfsGeneral(igfs, res);
-            $generatorXml.igfsIPC(igfs, res);
-            $generatorXml.igfsFragmentizer(igfs, res);
-            $generatorXml.igfsDualMode(igfs, res);
-            $generatorXml.igfsSecondFS(igfs, res);
-            $generatorXml.igfsMisc(igfs, res);
-
-            res.endBlock('</bean>');
-
-            res.needEmptyLine = true;
-        });
-
-        res.endBlock('</list>');
-        res.endBlock('</property>');
-
-        res.needEmptyLine = true;
-    }
-
-    return res;
-};
-
-// Generate IGFS IPC configuration.
-$generatorXml.igfsIPC = function(igfs, res) {
-    if (!res)
-        res = $generatorCommon.builder();
-
-    if (igfs.ipcEndpointEnabled) {
-        $generatorXml.beanProperty(res, igfs.ipcEndpointConfiguration, 'ipcEndpointConfiguration', $generatorCommon.IGFS_IPC_CONFIGURATION, true);
-
-        res.needEmptyLine = true;
-    }
-
-    return res;
-};
-
-// Generate IGFS fragmentizer configuration.
-$generatorXml.igfsFragmentizer = function(igfs, res) {
-    if (!res)
-        res = $generatorCommon.builder();
-
-    if (igfs.fragmentizerEnabled) {
-        $generatorXml.property(res, igfs, 'fragmentizerConcurrentFiles', undefined, 0);
-        $generatorXml.property(res, igfs, 'fragmentizerThrottlingBlockLength', undefined, 16777216);
-        $generatorXml.property(res, igfs, 'fragmentizerThrottlingDelay', undefined, 200);
-
-        res.needEmptyLine = true;
-    }
-    else
-        $generatorXml.property(res, igfs, 'fragmentizerEnabled');
-
-    return res;
-};
-
-// Generate IGFS dual mode configuration.
-$generatorXml.igfsDualMode = function(igfs, res) {
-    if (!res)
-        res = $generatorCommon.builder();
-
-    $generatorXml.property(res, igfs, 'dualModeMaxPendingPutsSize', undefined, 0);
-
-    if ($commonUtils.isDefinedAndNotEmpty(igfs.dualModePutExecutorService)) {
-        res.startBlock('<property name="dualModePutExecutorService">');
-        res.line('<bean class="' + igfs.dualModePutExecutorService + '"/>');
-        res.endBlock('</property>');
-    }
-
-    $generatorXml.property(res, igfs, 'dualModePutExecutorServiceShutdown', undefined, false);
-
-    res.needEmptyLine = true;
-
-    return res;
-};
-
-$generatorXml.igfsSecondFS = function(igfs, res) {
-    if (!res)
-        res = $generatorCommon.builder();
-
-    if (igfs.secondaryFileSystemEnabled) {
-        var secondFs = igfs.secondaryFileSystem || {};
-
-        res.startBlock('<property name="secondaryFileSystem">');
-
-        res.startBlock('<bean class="org.apache.ignite.hadoop.fs.IgniteHadoopIgfsSecondaryFileSystem">');
-
-        var nameDefined = $commonUtils.isDefinedAndNotEmpty(secondFs.userName);
-        var cfgDefined = $commonUtils.isDefinedAndNotEmpty(secondFs.cfgPath);
-
-        if ($commonUtils.isDefinedAndNotEmpty(secondFs.uri))
-            res.line('<constructor-arg index="0" value="' + secondFs.uri + '"/>');
-        else {
-            res.startBlock('<constructor-arg index="0">');
-            res.line('<null/>');
-            res.endBlock('</constructor-arg>');
-        }
-
-        if (cfgDefined || nameDefined) {
-            if (cfgDefined)
-                res.line('<constructor-arg index="1" value="' + secondFs.cfgPath + '"/>');
-            else {
-                res.startBlock('<constructor-arg index="1">');
-                res.line('<null/>');
-                res.endBlock('</constructor-arg>');
-            }
-        }
-
-        if ($commonUtils.isDefinedAndNotEmpty(secondFs.userName))
-            res.line('<constructor-arg index="2" value="' + secondFs.userName + '"/>');
-
-        res.endBlock('</bean>');
-        res.endBlock('</property>');
-
-        res.needEmptyLine = true;
-    }
-
-    return res;
-};
-
-// Generate IGFS general configuration.
-$generatorXml.igfsGeneral = function(igfs, res) {
-    if (!res)
-        res = $generatorCommon.builder();
-
-    if ($commonUtils.isDefinedAndNotEmpty(igfs.name)) {
-        igfs.dataCacheName = $generatorCommon.igfsDataCache(igfs).name;
-        igfs.metaCacheName = $generatorCommon.igfsMetaCache(igfs).name;
-
-        $generatorXml.property(res, igfs, 'name');
-        $generatorXml.property(res, igfs, 'dataCacheName');
-        $generatorXml.property(res, igfs, 'metaCacheName');
-
-        res.needEmptyLine = true;
-    }
-
-    return res;
-};
-
-// Generate IGFS misc configuration.
-$generatorXml.igfsMisc = function(igfs, res) {
-    if (!res)
-        res = $generatorCommon.builder();
-
-    $generatorXml.property(res, igfs, 'blockSize', undefined, 65536);
-    $generatorXml.property(res, igfs, 'streamBufferSize', undefined, 65536);
-    $generatorXml.property(res, igfs, 'defaultMode', undefined, "DUAL_ASYNC");
-    $generatorXml.property(res, igfs, 'maxSpaceSize', undefined, 0);
-    $generatorXml.property(res, igfs, 'maximumTaskRangeLength', undefined, 0);
-    $generatorXml.property(res, igfs, 'managementPort', undefined, 11400);
-
-    res.needEmptyLine = true;
-
-    if (igfs.pathModes && igfs.pathModes.length > 0) {
-        res.startBlock('<property name="pathModes">');
-        res.startBlock('<map>');
-
-        _.forEach(igfs.pathModes, function(pair) {
-            res.line('<entry key="' + pair.path + '" value="' + pair.mode + '"/>');
-        });
-
-        res.endBlock('</map>');
-        res.endBlock('</property>');
-
-        res.needEmptyLine = true;
-    }
-
-    $generatorXml.property(res, igfs, 'perNodeBatchSize', undefined, 100);
-    $generatorXml.property(res, igfs, 'perNodeParallelBatchCount', undefined, 8);
-    $generatorXml.property(res, igfs, 'prefetchBlocks', undefined, 0);
-    $generatorXml.property(res, igfs, 'sequentialReadsBeforePrefetch', undefined, 0);
-    $generatorXml.property(res, igfs, 'trashPurgeTimeout', undefined, 1000);
-
-    return res;
-};
-
-// Generate cluster config.
-$generatorXml.cluster = function (cluster, clientNearCfg) {
-    if (cluster) {
-        var res = $generatorCommon.builder();
-
-        res.deep = 1;
-
-        if (clientNearCfg) {
-            res.startBlock('<bean id="nearCacheBean" class="org.apache.ignite.configuration.NearCacheConfiguration">');
-
-            if (clientNearCfg.nearStartSize)
-                $generatorXml.property(res, clientNearCfg, 'nearStartSize');
-
-            if (clientNearCfg.nearEvictionPolicy && clientNearCfg.nearEvictionPolicy.kind)
-                $generatorXml.evictionPolicy(res, clientNearCfg.nearEvictionPolicy, 'nearEvictionPolicy');
-
-            res.endBlock('</bean>');
-
-            res.line();
-        }
-
-        // Generate Ignite Configuration.
-        res.startBlock('<bean class="org.apache.ignite.configuration.IgniteConfiguration">');
-
-        if (clientNearCfg) {
-            res.line('<property name="clientMode" value="true" />');
-
-            res.line();
-        }
-
-        $generatorXml.clusterGeneral(cluster, res);
-
-        $generatorXml.clusterAtomics(cluster, res);
-
-        $generatorXml.clusterCommunication(cluster, res);
-
-        $generatorXml.clusterConnector(cluster, res);
-
-        $generatorXml.clusterDeployment(cluster, res);
-
-        $generatorXml.clusterEvents(cluster, res);
-
-        $generatorXml.clusterMarshaller(cluster, res);
-
-        $generatorXml.clusterMetrics(cluster, res);
-
-        $generatorXml.clusterSwap(cluster, res);
-
-        $generatorXml.clusterTime(cluster, res);
-
-        $generatorXml.clusterPools(cluster, res);
-
-        $generatorXml.clusterTransactions(cluster, res);
-
-        $generatorXml.clusterCaches(cluster.caches, cluster.igfss, res);
-
-        $generatorXml.clusterSsl(cluster, res);
-
-        $generatorXml.igfss(cluster.igfss, res);
-
-        res.endBlock('</bean>');
-
-        // Build final XML:
-        // 1. Add header.
-        var xml = '<?xml version="1.0" encoding="UTF-8"?>\n\n';
-
-        xml += '<!-- ' + $generatorCommon.mainComment() + ' -->\n';
-        xml += '<beans xmlns="http://www.springframework.org/schema/beans"\n';
-        xml += '       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"\n';
-        xml += '       xmlns:util="http://www.springframework.org/schema/util"\n';
-        xml += '       xsi:schemaLocation="http://www.springframework.org/schema/beans\n';
-        xml += '                           http://www.springframework.org/schema/beans/spring-beans.xsd\n';
-        xml += '                           http://www.springframework.org/schema/util\n';
-        xml += '                           http://www.springframework.org/schema/util/spring-util.xsd">\n';
-
-        // 2. Add external property file
-        if (res.datasources.length > 0 || cluster.sslEnabled) {
-            xml += '    <!-- Load external properties file. -->\n';
-            xml += '    <bean id="placeholderConfig" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">\n';
-            xml += '        <property name="location" value="classpath:secret.properties"/>\n';
-            xml += '    </bean>\n\n';
-        }
-
-        // 3. Add data sources.
-        if (res.datasources.length > 0) {
-            xml += '    <!-- Data source beans will be initialized from external properties file. -->\n';
-
-            _.forEach(res.datasources, function (item) {
-                var beanId = item.dataSourceBean;
-
-                xml += '    <bean id="' + beanId + '" class="' + item.className + '">\n';
-                switch (item.dialect) {
-                    case 'DB2':
-                        xml += '        <property name="serverName" value="${' + beanId + '.jdbc.server_name}" />\n';
-                        xml += '        <property name="portNumber" value="${' + beanId + '.jdbc.port_number}" />\n';
-                        xml += '        <property name="databaseName" value="${' + beanId + '.jdbc.database_name}" />\n';
-                        xml += '        <property name="driverType" value="${' + beanId + '.jdbc.driver_type}" />\n';
-                        break;
-
-                    default:
-                        xml += '        <property name="URL" value="${' + beanId + '.jdbc.url}" />\n';
-                }
-
-                xml += '        <property name="user" value="${' + beanId + '.jdbc.username}" />\n';
-                xml += '        <property name="password" value="${' + beanId + '.jdbc.password}" />\n';
-                xml += '    </bean>\n\n';
-            });
-        }
-
-        // 3. Add main content.
-        xml += res.asString();
-
-        // 4. Add footer.
-        xml += '\n</beans>';
-
-        return xml;
-    }
-
-    return '';
-};
-
-// For server side we should export XML generation entry point.
-if (typeof window === 'undefined') {
-    module.exports = $generatorXml;
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/ce945056/modules/control-center-web/src/main/js/routes/metadata.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/routes/metadata.js b/modules/control-center-web/src/main/js/routes/metadata.js
index f714e12..09d67f4 100644
--- a/modules/control-center-web/src/main/js/routes/metadata.js
+++ b/modules/control-center-web/src/main/js/routes/metadata.js
@@ -16,6 +16,7 @@
  */
 
 var async = require('async');
+var _ = require('lodash');
 var router = require('express').Router();
 var db = require('../db');
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/ce945056/modules/control-center-web/src/main/js/routes/summary.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/routes/summary.js b/modules/control-center-web/src/main/js/routes/summary.js
index ee39181..0d8f4ce 100644
--- a/modules/control-center-web/src/main/js/routes/summary.js
+++ b/modules/control-center-web/src/main/js/routes/summary.js
@@ -14,18 +14,8 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-
-var db = require('../db');
-
 var router = require('express').Router();
 
-var $generatorXml = require('./generator/generator-xml');
-var $generatorJava = require('./generator/generator-java');
-var $generatorDocker = require('./generator/generator-docker');
-var $generatorProperties = require('./generator/generator-properties');
-var $generatorPom = require('./generator/generator-pom');
-var $generatorReadme = require('./generator/generator-readme');
-
 // GET template for summary tabs.
 router.get('/summary-tabs', function (req, res) {
     res.render('configuration/summary-tabs', {});
@@ -36,61 +26,4 @@ router.get('/', function (req, res) {
     res.render('configuration/summary');
 });
 
-router.post('/download', function (req, res) {
-    // Get cluster with all inner objects (caches, metadata).
-    db.Cluster.findById(req.body._id).deepPopulate('caches caches.metadatas igfss').exec(function (err, cluster) {
-        if (err)
-            return res.status(500).send(err.message);
-
-        if (!cluster)
-            return res.sendStatus(404);
-
-        var clientNearConfiguration = JSON.parse(req.body.clientNearConfiguration);
-
-        var JSZip = require('jszip');
-
-        var zip = new JSZip();
-
-        // Set the archive name.
-        res.attachment(cluster.name + '-configuration.zip');
-
-        var builder = $generatorProperties.sslProperties(cluster);
-
-        zip.file('Dockerfile', $generatorDocker.clusterDocker(cluster, req.body.os));
-
-        builder = $generatorProperties.dataSourcesProperties(cluster, builder);
-
-        if (builder)
-            zip.file('src/main/resources/secret.properties', builder.asString());
-
-        var srcPath = 'src/main/java/';
-
-        zip.file('config/' + cluster.name + '-server.xml', $generatorXml.cluster(cluster));
-        zip.file('config/' + cluster.name + '-client.xml', $generatorXml.cluster(cluster, clientNearConfiguration));
-        zip.file(srcPath + 'ServerConfigurationFactory.java', $generatorJava.cluster(cluster, 'ServerConfigurationFactory'));
-        zip.file(srcPath + 'ClientConfigurationFactory.java', $generatorJava.cluster(cluster, 'ClientConfigurationFactory', clientNearConfiguration));
-        zip.file('pom.xml', $generatorPom.pom(cluster.caches, '1.5.0').asString());
-
-        zip.file('README.txt', $generatorReadme.readme().asString());
-        zip.file('jdbc-drivers/README.txt', 'Copy proprietary JDBC drivers to this folder.');
-
-        $generatorJava.pojos(cluster.caches, req.body.useConstructor, req.body.includeKeyFields);
-
-        var metadatas = $generatorJava.metadatas;
-
-        for (var metaIx = 0; metaIx < metadatas.length; metaIx ++) {
-            var meta = metadatas[metaIx];
-
-            if (meta.keyClass)
-                zip.file(srcPath + meta.keyType.replace(/\./g, '/') + '.java', meta.keyClass);
-
-            zip.file(srcPath + meta.valueType.replace(/\./g, '/') + '.java', meta.valueClass);
-        }
-
-        var buffer = zip.generate({type:"nodebuffer"});
-
-        res.send(buffer);
-    });
-});
-
 module.exports = router;

http://git-wip-us.apache.org/repos/asf/ignite/blob/ce945056/modules/control-center-web/src/main/js/views/configuration/sidebar.jade
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/views/configuration/sidebar.jade b/modules/control-center-web/src/main/js/views/configuration/sidebar.jade
index 2208d89..a486f9f 100644
--- a/modules/control-center-web/src/main/js/views/configuration/sidebar.jade
+++ b/modules/control-center-web/src/main/js/views/configuration/sidebar.jade
@@ -21,9 +21,9 @@ append scripts
     script(src='//cdnjs.cloudflare.com/ajax/libs/ace/1.2.0/mode-java.js')
 
     script(src='/data-structures.js')
-    script(src='/generator-common.js')
-    script(src='/generator-xml.js')
-    script(src='/generator-java.js')
+    script(src='/generator/generator-common.js')
+    script(src='/generator/generator-xml.js')
+    script(src='/generator/generator-java.js')
 
 mixin sidebar-item(ref, num, txt)
     li

http://git-wip-us.apache.org/repos/asf/ignite/blob/ce945056/modules/control-center-web/src/main/js/views/configuration/summary.jade
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/views/configuration/summary.jade b/modules/control-center-web/src/main/js/views/configuration/summary.jade
index 51b7493..a812376 100644
--- a/modules/control-center-web/src/main/js/views/configuration/summary.jade
+++ b/modules/control-center-web/src/main/js/views/configuration/summary.jade
@@ -19,7 +19,14 @@ extends sidebar
 append scripts
     script(src='//cdnjs.cloudflare.com/ajax/libs/ace/1.2.0/mode-dockerfile.js')
 
-    script(src='/generator-docker.js')
+    script(src='/js/jszip.min.js')
+    script(src='/js/FileSaver.min.js')
+    script(src='/js/Blob.js')
+
+    script(src='/generator/generator-docker.js')
+    script(src='/generator/generator-properties.js')
+    script(src='/generator/generator-pom.js')
+    script(src='/generator/generator-readme.js')
     script(src='/summary-controller.js')
 
 include ../includes/controls
@@ -57,13 +64,7 @@ block content
             a(href='clusters') here.
         +main-table('Clusters:', 'clusters', 'clusterName', 'selectItem(row)', '{{$index + 1}}) {{row.name}}')
         .padding-top-dflt(bs-affix)
-            form.panel-tip-container(data-placement='bottom' bs-tooltip data-title='Download configuration' method='post' action='summary/download')
-                input(type='hidden' name='_id' value='{{selectedItem._id}}')
-                input(type='hidden' name='os' value='{{os}}')
-                input(type='hidden' name='clientNearConfiguration' value='{{backupItem.nearConfiguration}}')
-                input(type='hidden' name='useConstructor' value='{{configServer.useConstructor}}')
-                input(type='hidden' name='includeKeyFields' value='{{configServer.includeKeyFields}}')
-                button.btn.btn-primary(id='download' type='submit' ng-click='$event.stopPropagation()') Download
+            button.btn.btn-primary(id='download' ng-click='downloadConfiguration()' bs-tooltip data-title='Download configuration' data-placement='bottom') Download
             hr
         div(ng-show='selectedItem && tableVisibleRow(displayedRows, selectedItem)' role='tab')
             .panel-group(bs-collapse ng-init='panels.activePanels=[0,1]' ng-model='panels.activePanels' data-allow-multiple='true')


[5/7] ignite git commit: IGNITE-1857 Generate configuration zip on client side.

Posted by an...@apache.org.
http://git-wip-us.apache.org/repos/asf/ignite/blob/ce945056/modules/control-center-web/src/main/js/helpers/generator/generator-java.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/helpers/generator/generator-java.js b/modules/control-center-web/src/main/js/helpers/generator/generator-java.js
new file mode 100644
index 0000000..cda5db7
--- /dev/null
+++ b/modules/control-center-web/src/main/js/helpers/generator/generator-java.js
@@ -0,0 +1,1941 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// Java generation entry point.
+$generatorJava = {};
+
+/**
+ * Translate some value to valid java code.
+ *
+ * @param val Value to convert.
+ * @param type Value type.
+ * @returns {*} String with value that will be valid for java.
+ */
+$generatorJava.toJavaCode = function (val, type) {
+    if (val == null)
+        return 'null';
+
+    if (type == 'raw')
+        return val;
+
+    if (type == 'class')
+        return val + '.class';
+
+    if (type == 'float')
+        return val + 'f';
+
+    if (type == 'path')
+        return '"' + val.replace(/\\/g, '\\\\') + '"';
+
+    if (type)
+        return type + '.' + val;
+
+    if (typeof(val) == 'string')
+        return '"' + val.replace('"', '\\"') + '"';
+
+    if (typeof(val) == 'number' || typeof(val) == 'boolean')
+        return '' + val;
+
+    throw "Unknown type: " + typeof(val) + ' (' + val + ')';
+};
+
+/**
+ * @param propName Property name.
+ * @param setterName Optional concrete setter name.
+ * @returns Property setter with name by java conventions.
+ */
+$generatorJava.setterName = function (propName, setterName) {
+    return setterName ? setterName : $commonUtils.toJavaName('set', propName);
+};
+
+/**
+ * Add variable declaration.
+ *
+ * @param res Resulting output with generated code.
+ * @param varName Variable name.
+ * @param varFullType Variable full class name to be added to imports.
+ * @param varFullActualType Variable actual full class name to be added to imports.
+ * @param varFullGenericType1 Optional full class name of first generic.
+ * @param varFullGenericType2 Optional full class name of second generic.
+ */
+$generatorJava.declareVariable = function (res, varName, varFullType, varFullActualType, varFullGenericType1, varFullGenericType2) {
+    res.emptyLineIfNeeded();
+
+    var varType = res.importClass(varFullType);
+
+    var varNew = !res.vars[varName];
+
+    if (varNew)
+        res.vars[varName] = true;
+
+    if (varFullActualType && varFullGenericType1) {
+        var varActualType = res.importClass(varFullActualType);
+        var varGenericType1 = res.importClass(varFullGenericType1);
+
+        if (varFullGenericType2)
+            var varGenericType2 = res.importClass(varFullGenericType2);
+
+        res.line((varNew ? (varType + '<' + varGenericType1 + (varGenericType2 ? ', ' + varGenericType2 : '') + '> ') : '') + varName + ' = new ' + varActualType + '<>();');
+    }
+    else
+        res.line((varNew ? (varType + ' ') : '') + varName + ' = new ' + varType + '();');
+
+    res.needEmptyLine = true;
+};
+
+/**
+ * Add property via setter / property name.
+ *
+ * @param res Resulting output with generated code.
+ * @param varName Variable name.
+ * @param obj Source object with data.
+ * @param propName Property name to take from source object.
+ * @param dataType Optional info about property data type.
+ * @param setterName Optional special setter name.
+ * @param dflt Optional default value.
+ */
+$generatorJava.property = function (res, varName, obj, propName, dataType, setterName, dflt) {
+    var val = obj[propName];
+
+    if ($commonUtils.isDefinedAndNotEmpty(val)) {
+        var hasDflt = $commonUtils.isDefined(dflt);
+
+        // Add to result if no default provided or value not equals to default.
+        if (!hasDflt || (hasDflt && val != dflt)) {
+            res.emptyLineIfNeeded();
+
+            res.line(varName + '.' + $generatorJava.setterName(propName, setterName)
+                + '(' + $generatorJava.toJavaCode(val, dataType) + ');');
+
+            return true;
+        }
+    }
+
+    return false;
+};
+
+/**
+ * Add property via setter assuming that it is a 'Class'.
+ *
+ * @param res Resulting output with generated code.
+ * @param varName Variable name.
+ * @param obj Source object with data.
+ * @param propName Property name to take from source object.
+ */
+$generatorJava.classNameProperty = function (res, varName, obj, propName) {
+    var val = obj[propName];
+
+    if ($commonUtils.isDefined(val)) {
+        res.emptyLineIfNeeded();
+
+        res.line(varName + '.' + $generatorJava.setterName(propName) + '(' + res.importClass(val) + '.class);');
+    }
+};
+
+/**
+ * Add list property.
+ *
+ * @param res Resulting output with generated code.
+ * @param varName Variable name.
+ * @param obj Source object with data.
+ * @param propName Property name to take from source object.
+ * @param dataType Optional data type.
+ * @param setterName Optional setter name.
+ */
+$generatorJava.listProperty = function (res, varName, obj, propName, dataType, setterName) {
+    var val = obj[propName];
+
+    if (val && val.length > 0) {
+        res.emptyLineIfNeeded();
+
+        res.importClass('java.util.Arrays');
+
+        res.line(varName + '.' + $generatorJava.setterName(propName, setterName) +
+            '(Arrays.asList(' +
+                _.map(val, function (v) {
+                    return $generatorJava.toJavaCode(v, dataType)
+                }).join(', ') +
+            '));');
+
+        res.needEmptyLine = true;
+    }
+};
+
+/**
+ * Add array property.
+ *
+ * @param res Resulting output with generated code.
+ * @param varName Variable name.
+ * @param obj Source object with data.
+ * @param propName Property name to take from source object.
+ * @param setterName Optional setter name.
+ */
+$generatorJava.arrayProperty = function (res, varName, obj, propName, setterName) {
+    var val = obj[propName];
+
+    if (val && val.length > 0) {
+        res.emptyLineIfNeeded();
+
+        res.line(varName + '.' + $generatorJava.setterName(propName, setterName) + '({ ' +
+            _.map(val, function (v) {
+                return 'new ' + res.importClass(v) + '()'
+            }).join(', ') +
+        ' });');
+
+        res.needEmptyLine = true;
+    }
+};
+
+/**
+ * Add multi-param property (setter with several arguments).
+ *
+ * @param res Resulting output with generated code.
+ * @param varName Variable name.
+ * @param obj Source object with data.
+ * @param propName Property name to take from source object.
+ * @param dataType Optional data type.
+ * @param setterName Optional setter name.
+ */
+$generatorJava.multiparamProperty = function (res, varName, obj, propName, dataType, setterName) {
+    var val = obj[propName];
+
+    if (val && val.length > 0) {
+        res.emptyLineIfNeeded();
+
+        res.append(varName + '.' + $generatorJava.setterName(propName, setterName) + '(');
+
+        _.forEach(val, function(v, ix) {
+            if (ix > 0)
+                res.append(', ');
+
+            res.append($generatorJava.toJavaCode(v, dataType));
+        });
+
+        res.line(');');
+    }
+};
+
+/**
+ * Add complex bean.
+ * @param res Resulting output with generated code.
+ * @param varName Variable name.
+ * @param bean
+ * @param beanPropName
+ * @param beanVarName
+ * @param beanClass
+ * @param props
+ * @param createBeanAlthoughNoProps If 'true' then create empty bean.
+ */
+$generatorJava.beanProperty = function (res, varName, bean, beanPropName, beanVarName, beanClass, props, createBeanAlthoughNoProps) {
+    if (bean && $commonUtils.hasProperty(bean, props)) {
+        res.emptyLineIfNeeded();
+
+        $generatorJava.declareVariable(res, beanVarName, beanClass);
+
+        _.forIn(props, function(descr, propName) {
+            if (props.hasOwnProperty(propName)) {
+                if (descr) {
+                    switch (descr.type) {
+                        case 'list':
+                            $generatorJava.listProperty(res, beanVarName, bean, propName, descr.elementsType, descr.setterName);
+                            break;
+
+                        case 'array':
+                            $generatorJava.arrayProperty(res, beanVarName, bean, propName, descr.setterName);
+                            break;
+
+                        case 'enum':
+                            $generatorJava.property(res, beanVarName, bean, propName, res.importClass(descr.enumClass), descr.setterName);
+                            break;
+
+                        case 'float':
+                            $generatorJava.property(res, beanVarName, bean, propName, 'float', descr.setterName);
+                            break;
+
+                        case 'path':
+                            $generatorJava.property(res, beanVarName, bean, propName, 'path', descr.setterName);
+                            break;
+
+                        case 'raw':
+                            $generatorJava.property(res, beanVarName, bean, propName, 'raw', descr.setterName);
+                            break;
+
+                        case 'propertiesAsList':
+                            var val = bean[propName];
+
+                            if (val && val.length > 0) {
+                                res.line('Properties ' + descr.propVarName + ' = new Properties();');
+
+                                _.forEach(val, function(nameAndValue) {
+                                    var eqIndex = nameAndValue.indexOf('=');
+
+                                    if (eqIndex >= 0) {
+                                        res.line(descr.propVarName + '.setProperty('
+                                            + nameAndValue.substring(0, eqIndex) + ', '
+                                            + nameAndValue.substr(eqIndex + 1) + ');');
+                                    }
+                                });
+
+                                res.line(beanVarName + '.' + $generatorJava.setterName(propName) + '(' + descr.propVarName + ');');
+                            }
+                            break;
+
+                        case 'bean':
+                            if ($commonUtils.isDefinedAndNotEmpty(bean[propName]))
+                                res.line(beanVarName + '.' + $generatorJava.setterName(propName) + '(new ' + res.importClass(bean[propName]) + '());');
+
+                            break;
+
+                        default:
+                            $generatorJava.property(res, beanVarName, bean, propName, null, descr.setterName, descr.dflt);
+                    }
+                }
+                else {
+                    $generatorJava.property(res, beanVarName, bean, propName);
+                }
+            }
+        });
+
+        res.needEmptyLine = true;
+
+        res.line(varName + '.' + $generatorJava.setterName(beanPropName) + '(' + beanVarName + ');');
+
+        res.needEmptyLine = true;
+    }
+    else if (createBeanAlthoughNoProps) {
+        res.emptyLineIfNeeded();
+        res.line(varName + '.' + $generatorJava.setterName(beanPropName) + '(new ' + res.importClass(beanClass) + '());');
+
+        res.needEmptyLine = true;
+    }
+};
+
+/**
+ * Add eviction policy.
+ *
+ * @param res Resulting output with generated code.
+ * @param varName Current using variable name.
+ * @param evtPlc Data to add.
+ * @param propName Name in source data.
+ */
+$generatorJava.evictionPolicy = function (res, varName, evtPlc, propName) {
+    if (evtPlc && evtPlc.kind) {
+        var evictionPolicyDesc = $generatorCommon.EVICTION_POLICIES[evtPlc.kind];
+
+        var obj = evtPlc[evtPlc.kind.toUpperCase()];
+
+        $generatorJava.beanProperty(res, varName, obj, propName, propName,
+            evictionPolicyDesc.className, evictionPolicyDesc.fields, true);
+    }
+};
+
+// Generate cluster general group.
+$generatorJava.clusterGeneral = function (cluster, clientNearCfg, res) {
+    if (!res)
+        res = $generatorCommon.builder();
+
+    $generatorJava.declareVariable(res, 'cfg', 'org.apache.ignite.configuration.IgniteConfiguration');
+
+    $generatorJava.property(res, 'cfg', cluster, 'name', null, 'setGridName');
+    res.needEmptyLine = true;
+
+    if (clientNearCfg) {
+        res.line('cfg.setClientMode(true);');
+
+        res.needEmptyLine = true;
+    }
+
+    if (cluster.discovery) {
+        var d = cluster.discovery;
+
+        $generatorJava.declareVariable(res, 'discovery', 'org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi');
+
+        switch (d.kind) {
+            case 'Multicast':
+                $generatorJava.beanProperty(res, 'discovery', d.Multicast, 'ipFinder', 'ipFinder',
+                    'org.apache.ignite.spi.discovery.tcp.ipfinder.multicast.TcpDiscoveryMulticastIpFinder',
+                    {
+                        multicastGroup: null,
+                        multicastPort: null,
+                        responseWaitTime: null,
+                        addressRequestAttempts: null,
+                        localAddress: null,
+                        addresses: {type: 'list'}
+                    }, true);
+
+                break;
+
+            case 'Vm':
+                $generatorJava.beanProperty(res, 'discovery', d.Vm, 'ipFinder', 'ipFinder',
+                    'org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder',
+                    {addresses: {type: 'list'}}, true);
+
+                break;
+
+            case 'S3':
+                $generatorJava.beanProperty(res, 'discovery', d.S3, 'ipFinder', 'ipFinder',
+                    'org.apache.ignite.spi.discovery.tcp.ipfinder.s3.TcpDiscoveryS3IpFinder', {bucketName: null}, true);
+
+                break;
+
+            case 'Cloud':
+                $generatorJava.beanProperty(res, 'discovery', d.Cloud, 'ipFinder', 'ipFinder',
+                    'org.apache.ignite.spi.discovery.tcp.ipfinder.cloud.TcpDiscoveryCloudIpFinder',
+                    {
+                        credential: null,
+                        credentialPath: null,
+                        identity: null,
+                        provider: null,
+                        regions: {type: 'list'},
+                        zones: {type: 'list'}
+                    }, true);
+
+                break;
+
+            case 'GoogleStorage':
+                $generatorJava.beanProperty(res, 'discovery', d.GoogleStorage, 'ipFinder', 'ipFinder',
+                    'org.apache.ignite.spi.discovery.tcp.ipfinder.gce.TcpDiscoveryGoogleStorageIpFinder',
+                    {
+                        projectName: null,
+                        bucketName: null,
+                        serviceAccountP12FilePath: null,
+                        serviceAccountId: null
+                    }, true);
+
+                break;
+
+            case 'Jdbc':
+                $generatorJava.beanProperty(res, 'discovery', d.Jdbc, 'ipFinder', 'ipFinder',
+                    'org.apache.ignite.spi.discovery.tcp.ipfinder.jdbc.TcpDiscoveryJdbcIpFinder', {initSchema: null}, true);
+
+                break;
+
+            case 'SharedFs':
+                $generatorJava.beanProperty(res, 'discovery', d.SharedFs, 'ipFinder', 'ipFinder',
+                    'org.apache.ignite.spi.discovery.tcp.ipfinder.sharedfs.TcpDiscoverySharedFsIpFinder', {path: null}, true);
+
+                break;
+
+            default:
+                res.line('Unknown discovery kind: ' + d.kind);
+        }
+
+        res.needEmptyLine = false;
+
+        $generatorJava.clusterDiscovery(d, res);
+
+        res.emptyLineIfNeeded();
+
+        res.line('cfg.setDiscoverySpi(discovery);');
+
+        res.needEmptyLine = true;
+    }
+
+    return res;
+};
+
+// Generate atomics group.
+$generatorJava.clusterAtomics = function (cluster, res) {
+    if (!res)
+        res = $generatorCommon.builder();
+
+    var atomics = cluster.atomicConfiguration;
+
+    if ($commonUtils.hasAtLeastOneProperty(atomics, ['cacheMode', 'atomicSequenceReserveSize', 'backups'])) {
+        res.startSafeBlock();
+
+        $generatorJava.declareVariable(res, 'atomicCfg', 'org.apache.ignite.configuration.AtomicConfiguration');
+
+        $generatorJava.property(res, 'atomicCfg', atomics, 'cacheMode');
+
+        var cacheMode = atomics.cacheMode ? atomics.cacheMode : 'PARTITIONED';
+
+        var hasData = cacheMode != 'PARTITIONED';
+
+        hasData = $generatorJava.property(res, 'atomicCfg', atomics, 'atomicSequenceReserveSize') || hasData;
+
+        if (cacheMode == 'PARTITIONED')
+            hasData = $generatorJava.property(res, 'atomicCfg', atomics, 'backups') || hasData;
+
+        res.needEmptyLine = true;
+
+        res.line('cfg.setAtomicConfiguration(atomicCfg);');
+
+        res.needEmptyLine = true;
+
+        if (!hasData)
+            res.rollbackSafeBlock();
+    }
+
+    return res;
+};
+
+// Generate communication group.
+$generatorJava.clusterCommunication = function (cluster, res) {
+    if (!res)
+        res = $generatorCommon.builder();
+
+    var cfg = $generatorCommon.COMMUNICATION_CONFIGURATION;
+
+    $generatorJava.beanProperty(res, 'cfg', cluster.communication, 'communicationSpi', 'commSpi', cfg.className, cfg.fields);
+
+    res.needEmptyLine = false;
+
+    $generatorJava.property(res, 'cfg', cluster, 'networkTimeout', null, null, 5000);
+    $generatorJava.property(res, 'cfg', cluster, 'networkSendRetryDelay', null, null, 1000);
+    $generatorJava.property(res, 'cfg', cluster, 'networkSendRetryCount', null, null, 3);
+    $generatorJava.property(res, 'cfg', cluster, 'segmentCheckFrequency');
+    $generatorJava.property(res, 'cfg', cluster, 'waitForSegmentOnStart', null, null, false);
+    $generatorJava.property(res, 'cfg', cluster, 'discoveryStartupDelay', null, null, 600000);
+
+    res.needEmptyLine = true;
+
+    return res;
+};
+
+// Generate REST access group.
+$generatorJava.clusterConnector = function (cluster, res) {
+    if (!res)
+        res = $generatorCommon.builder();
+
+    if ($commonUtils.isDefined(cluster.connector) && cluster.connector.enabled) {
+        var cfg = _.cloneDeep($generatorCommon.CONNECTOR_CONFIGURATION);
+
+        if (cluster.connector.sslEnabled) {
+            cfg.fields.sslClientAuth = {dflt: false};
+            cfg.fields.sslFactory = {type: 'bean'};
+        }
+
+        $generatorJava.beanProperty(res, 'cfg', cluster.connector, 'connectorConfiguration', 'clientCfg',
+            cfg.className, cfg.fields, true);
+
+        res.needEmptyLine = true;
+    }
+
+    return res;
+};
+
+// Generate deployment group.
+$generatorJava.clusterDeployment = function (cluster, res) {
+    if (!res)
+        res = $generatorCommon.builder();
+
+    $generatorJava.property(res, 'cfg', cluster, 'deploymentMode', null, null, 'SHARED');
+
+    res.needEmptyLine = true;
+
+    var p2pEnabled = cluster.peerClassLoadingEnabled;
+
+    if ($commonUtils.isDefined(p2pEnabled)) {
+        $generatorJava.property(res, 'cfg', cluster, 'peerClassLoadingEnabled', null, null, false);
+
+        if (p2pEnabled) {
+            $generatorJava.property(res, 'cfg', cluster, 'peerClassLoadingMissedResourcesCacheSize');
+            $generatorJava.property(res, 'cfg', cluster, 'peerClassLoadingThreadPoolSize');
+            $generatorJava.multiparamProperty(res, 'cfg', cluster, 'peerClassLoadingLocalClassPathExclude');
+        }
+
+        res.needEmptyLine = true;
+    }
+
+    return res;
+};
+
+// Generate discovery group.
+$generatorJava.clusterDiscovery = function (disco, res) {
+    if (!res)
+        res = $generatorCommon.builder();
+
+    $generatorJava.property(res, 'discovery', disco, 'localAddress');
+    $generatorJava.property(res, 'discovery', disco, 'localPort', null, null, 47500);
+    $generatorJava.property(res, 'discovery', disco, 'localPortRange', null, null, 100);
+
+    if ($commonUtils.isDefinedAndNotEmpty(disco.addressResolver)) {
+        $generatorJava.beanProperty(res, 'discovery', disco, 'addressResolver', 'addressResolver', disco.addressResolver, {}, true);
+        res.needEmptyLine = false;
+    }
+
+    $generatorJava.property(res, 'discovery', disco, 'socketTimeout', null, null, 5000);
+    $generatorJava.property(res, 'discovery', disco, 'ackTimeout', null, null, 5000);
+    $generatorJava.property(res, 'discovery', disco, 'maxAckTimeout', null, null, 600000);
+    $generatorJava.property(res, 'discovery', disco, 'networkTimeout', null, null, 5000);
+    $generatorJava.property(res, 'discovery', disco, 'joinTimeout', null, null, 0);
+    $generatorJava.property(res, 'discovery', disco, 'threadPriority', null, null, 10);
+    $generatorJava.property(res, 'discovery', disco, 'heartbeatFrequency', null, null, 2000);
+    $generatorJava.property(res, 'discovery', disco, 'maxMissedHeartbeats', null, null, 1);
+    $generatorJava.property(res, 'discovery', disco, 'maxMissedClientHeartbeats', null, null, 5);
+    $generatorJava.property(res, 'discovery', disco, 'topHistorySize', null, null, 100);
+
+    if ($commonUtils.isDefinedAndNotEmpty(disco.listener)) {
+        $generatorJava.beanProperty(res, 'discovery', disco, 'listener', 'listener', disco.listener, {}, true);
+        res.needEmptyLine = false;
+    }
+
+    if ($commonUtils.isDefinedAndNotEmpty(disco.dataExchange)) {
+        $generatorJava.beanProperty(res, 'discovery', disco, 'dataExchange', 'dataExchange', disco.dataExchange, {}, true);
+        res.needEmptyLine = false;
+    }
+
+    if ($commonUtils.isDefinedAndNotEmpty(disco.metricsProvider)) {
+        $generatorJava.beanProperty(res, 'discovery', disco, 'metricsProvider', 'metricsProvider', disco.metricsProvider, {}, true);
+        res.needEmptyLine = false;
+    }
+
+    $generatorJava.property(res, 'discovery', disco, 'reconnectCount', null, null, 10);
+    $generatorJava.property(res, 'discovery', disco, 'statisticsPrintFrequency', null, null, 0);
+    $generatorJava.property(res, 'discovery', disco, 'ipFinderCleanFrequency', null, null, 60000);
+
+    if ($commonUtils.isDefinedAndNotEmpty(disco.authenticator)) {
+        $generatorJava.beanProperty(res, 'discovery', disco, 'authenticator', 'authenticator', disco.authenticator, {}, true);
+        res.needEmptyLine = false;
+    }
+
+    $generatorJava.property(res, 'discovery', disco, 'forceServerMode', null, null, false);
+    $generatorJava.property(res, 'discovery', disco, 'clientReconnectDisabled', null, null, false);
+
+    res.needEmptyLine = true;
+
+    return res;
+};
+
+// Generate events group.
+$generatorJava.clusterEvents = function (cluster, res) {
+    if (!res)
+        res = $generatorCommon.builder();
+
+    if (cluster.includeEventTypes && cluster.includeEventTypes.length > 0) {
+        res.emptyLineIfNeeded();
+
+        if (cluster.includeEventTypes.length == 1) {
+            res.importClass('org.apache.ignite.events.EventType');
+
+            res.line('cfg.setIncludeEventTypes(EventType.' + cluster.includeEventTypes[0] + ');');
+        }
+        else {
+            res.append('int[] events = new int[EventType.' + cluster.includeEventTypes[0] + '.length');
+
+            _.forEach(cluster.includeEventTypes, function(e, ix) {
+                if (ix > 0) {
+                    res.needEmptyLine = true;
+
+                    res.append('    + EventType.' + e + '.length');
+                }
+            });
+
+            res.line('];');
+
+            res.needEmptyLine = true;
+
+            res.line('int k = 0;');
+
+            _.forEach(cluster.includeEventTypes, function(e) {
+                res.needEmptyLine = true;
+
+                res.line('System.arraycopy(EventType.' + e + ', 0, events, k, EventType.' + e + '.length);');
+                res.line('k += EventType.' + e + '.length;');
+            });
+
+            res.needEmptyLine = true;
+
+            res.line('cfg.setIncludeEventTypes(events);');
+        }
+
+        res.needEmptyLine = true;
+    }
+
+    res.needEmptyLine = true;
+
+    return res;
+};
+
+// Generate marshaller group.
+$generatorJava.clusterMarshaller = function (cluster, res) {
+    if (!res)
+        res = $generatorCommon.builder();
+
+    var marshaller = cluster.marshaller;
+
+    if (marshaller && marshaller.kind) {
+        var marshallerDesc = $generatorCommon.MARSHALLERS[marshaller.kind];
+
+        $generatorJava.beanProperty(res, 'cfg', marshaller[marshaller.kind], 'marshaller', 'marshaller',
+            marshallerDesc.className, marshallerDesc.fields, true);
+
+        $generatorJava.beanProperty(res, 'marshaller', marshaller[marshaller.kind], marshallerDesc.className, marshallerDesc.fields, true);
+    }
+
+    $generatorJava.property(res, 'cfg', cluster, 'marshalLocalJobs', null, null, false);
+    $generatorJava.property(res, 'cfg', cluster, 'marshallerCacheKeepAliveTime');
+    $generatorJava.property(res, 'cfg', cluster, 'marshallerCacheThreadPoolSize');
+
+    res.needEmptyLine = true;
+
+    return res;
+};
+
+// Generate metrics group.
+$generatorJava.clusterMetrics = function (cluster, res) {
+    if (!res)
+        res = $generatorCommon.builder();
+
+    $generatorJava.property(res, 'cfg', cluster, 'metricsExpireTime');
+    $generatorJava.property(res, 'cfg', cluster, 'metricsHistorySize');
+    $generatorJava.property(res, 'cfg', cluster, 'metricsLogFrequency');
+    $generatorJava.property(res, 'cfg', cluster, 'metricsUpdateFrequency');
+
+    res.needEmptyLine = true;
+
+    return res;
+};
+
+// Generate swap group.
+$generatorJava.clusterSwap = function (cluster, res) {
+    if (!res)
+        res = $generatorCommon.builder();
+
+    if (cluster.swapSpaceSpi && cluster.swapSpaceSpi.kind == 'FileSwapSpaceSpi') {
+        $generatorJava.beanProperty(res, 'cfg', cluster.swapSpaceSpi.FileSwapSpaceSpi, 'swapSpaceSpi', 'swapSpi',
+            $generatorCommon.SWAP_SPACE_SPI.className, $generatorCommon.SWAP_SPACE_SPI.fields, true);
+
+        res.needEmptyLine = true;
+    }
+
+    return res;
+};
+
+// Generate time group.
+$generatorJava.clusterTime = function (cluster, res) {
+    if (!res)
+        res = $generatorCommon.builder();
+
+    $generatorJava.property(res, 'cfg', cluster, 'clockSyncSamples');
+    $generatorJava.property(res, 'cfg', cluster, 'clockSyncFrequency');
+    $generatorJava.property(res, 'cfg', cluster, 'timeServerPortBase');
+    $generatorJava.property(res, 'cfg', cluster, 'timeServerPortRange');
+
+    res.needEmptyLine = true;
+
+    return res;
+};
+
+// Generate thread pools group.
+$generatorJava.clusterPools = function (cluster, res) {
+    if (!res)
+        res = $generatorCommon.builder();
+
+    $generatorJava.property(res, 'cfg', cluster, 'publicThreadPoolSize');
+    $generatorJava.property(res, 'cfg', cluster, 'systemThreadPoolSize');
+    $generatorJava.property(res, 'cfg', cluster, 'managementThreadPoolSize');
+    $generatorJava.property(res, 'cfg', cluster, 'igfsThreadPoolSize');
+
+    res.needEmptyLine = true;
+
+    return res;
+};
+
+// Generate transactions group.
+$generatorJava.clusterTransactions = function (cluster, res) {
+    if (!res)
+        res = $generatorCommon.builder();
+
+    $generatorJava.beanProperty(res, 'cfg', cluster.transactionConfiguration, 'transactionConfiguration',
+        'transactionConfiguration', $generatorCommon.TRANSACTION_CONFIGURATION.className,
+        $generatorCommon.TRANSACTION_CONFIGURATION.fields);
+
+    return res;
+};
+
+// Generate cache general group.
+$generatorJava.cacheGeneral = function (cache, varName, res) {
+    if (!res)
+        res = $generatorCommon.builder();
+
+    $generatorJava.property(res, varName, cache, 'name');
+
+    res.importClass('org.apache.ignite.cache.CacheAtomicityMode');
+    res.importClass('org.apache.ignite.cache.CacheMode');
+
+    $generatorJava.property(res, varName, cache, 'cacheMode', 'CacheMode');
+    $generatorJava.property(res, varName, cache, 'atomicityMode', 'CacheAtomicityMode');
+
+    if (cache.cacheMode == 'PARTITIONED')
+        $generatorJava.property(res, varName, cache, 'backups');
+
+    $generatorJava.property(res, varName, cache, 'readFromBackup');
+    $generatorJava.property(res, varName, cache, 'copyOnRead');
+    $generatorJava.property(res, varName, cache, 'invalidate');
+
+    res.needEmptyLine = true;
+
+    return res;
+};
+
+// Generate cache memory group.
+$generatorJava.cacheMemory = function (cache, varName, res) {
+    if (!res)
+        res = $generatorCommon.builder();
+
+    $generatorJava.property(res, varName, cache, 'memoryMode', 'CacheMemoryMode');
+    $generatorJava.property(res, varName, cache, 'offHeapMaxMemory');
+
+    res.needEmptyLine = true;
+
+    $generatorJava.evictionPolicy(res, varName, cache.evictionPolicy, 'evictionPolicy');
+
+    $generatorJava.property(res, varName, cache, 'swapEnabled');
+    $generatorJava.property(res, varName, cache, 'startSize');
+
+    res.needEmptyLine = true;
+
+    return res;
+};
+
+// Generate cache query & indexing group.
+$generatorJava.cacheQuery = function (cache, varName, res) {
+    if (!res)
+        res = $generatorCommon.builder();
+
+    $generatorJava.property(res, varName, cache, 'sqlOnheapRowCacheSize');
+    $generatorJava.property(res, varName, cache, 'longQueryWarningTimeout');
+
+    if (cache.indexedTypes && cache.indexedTypes.length > 0) {
+        res.emptyLineIfNeeded();
+
+        res.startBlock(varName + '.setIndexedTypes(');
+
+        var len = cache.indexedTypes.length - 1;
+
+        _.forEach(cache.indexedTypes, function(pair, ix) {
+            res.line($generatorJava.toJavaCode(res.importClass(pair.keyClass), 'class') + ', ' +
+                $generatorJava.toJavaCode(res.importClass(pair.valueClass), 'class') + (ix < len ? ',' : ''));
+        });
+
+        res.endBlock(');');
+    }
+
+    $generatorJava.multiparamProperty(res, varName, cache, 'sqlFunctionClasses', 'class');
+
+    $generatorJava.property(res, varName, cache, 'sqlEscapeAll');
+
+    res.needEmptyLine = true;
+
+    return res;
+};
+
+/**
+ * Generate cache store group.
+ *
+ * @param cache Cache descriptor.
+ * @param cacheVarName Cache variable name.
+ * @param res Resulting output with generated code.
+ * @returns {*} Java code for cache store configuration.
+ */
+$generatorJava.cacheStore = function (cache, cacheVarName, res) {
+    if (!res)
+        res = $generatorCommon.builder();
+
+    if (cache.cacheStoreFactory && cache.cacheStoreFactory.kind) {
+        var factoryKind = cache.cacheStoreFactory.kind;
+
+        var storeFactory = cache.cacheStoreFactory[factoryKind];
+
+        if (storeFactory) {
+            var storeFactoryDesc = $generatorCommon.STORE_FACTORIES[factoryKind];
+
+            var dataSourceFound = false;
+
+            if (storeFactory.dialect) {
+                var dataSourceBean = storeFactory.dataSourceBean;
+
+                dataSourceFound = true;
+
+                if (!_.contains(res.datasources, dataSourceBean)) {
+                    res.datasources.push(dataSourceBean);
+
+                    var dsClsName = $generatorCommon.dataSourceClassName(storeFactory.dialect);
+
+                    res.needEmptyLine = true;
+
+                    $generatorJava.declareVariable(res, 'dataSource', dsClsName);
+
+                    switch (storeFactory.dialect) {
+                        case 'DB2':
+                            res.line('dataSource.setServerName(props.getProperty("' + dataSourceBean + '.jdbc.server_name"));');
+                            res.line('dataSource.setPortNumber(Integer.valueOf(props.getProperty("' + dataSourceBean + '.jdbc.port_number")));');
+                            res.line('dataSource.setDatabaseName(props.getProperty("' + dataSourceBean + '.jdbc.database_name"));');
+                            res.line('dataSource.setDriverType(Integer.valueOf(props.getProperty("' + dataSourceBean + '.jdbc.driver_type")));');
+                            break;
+
+                        default:
+                            res.line('dataSource.setURL(props.getProperty("' + dataSourceBean + '.jdbc.url"));');
+                    }
+
+                    res.line('dataSource.setUser(props.getProperty("' + dataSourceBean + '.jdbc.username"));');
+                    res.line('dataSource.setPassword(props.getProperty("' + dataSourceBean + '.jdbc.password"));');
+                }
+            }
+
+            if (factoryKind == 'CacheJdbcPojoStoreFactory') {
+                // Generate POJO store factory.
+                $generatorJava.declareVariable(res, 'storeFactory', 'org.apache.ignite.cache.store.jdbc.CacheJdbcPojoStoreFactory');
+
+                $generatorJava.declareVariable(res, 'storeFactoryCfg', 'org.apache.ignite.cache.store.jdbc.CacheJdbcPojoStoreConfiguration');
+
+                if (dataSourceFound)
+                    res.line('storeFactoryCfg.setDataSource(dataSource);');
+
+                res.line('storeFactoryCfg.setDialect(new ' +
+                    res.importClass($generatorCommon.jdbcDialectClassName(storeFactory.dialect)) + '());');
+
+                res.needEmptyLine = true;
+
+                if (cache.metadatas && cache.metadatas.length > 0) {
+                    $generatorJava.declareVariable(res, 'jdbcTypes', 'java.util.Collection', 'java.util.ArrayList', 'org.apache.ignite.cache.store.jdbc.JdbcType');
+
+                    res.needEmptyLine = true;
+
+                    _.forEach(cache.metadatas, function (meta) {
+                        $generatorJava.declareVariable(res, 'jdbcType', 'org.apache.ignite.cache.store.jdbc.JdbcType');
+
+                        res.needEmptyLine = true;
+
+                        $generatorJava.metadataStore(meta, true, res);
+
+                        res.needEmptyLine = true;
+
+                        res.line('jdbcTypes.add(jdbcType);');
+
+                        res.needEmptyLine = true;
+                    });
+
+                    res.line('storeFactoryCfg.setTypes(jdbcTypes);');
+
+                    res.needEmptyLine = true;
+                }
+
+                res.line('storeFactory.setConfiguration(storeFactoryCfg);');
+            }
+            else {
+                $generatorJava.beanProperty(res, cacheVarName, storeFactory, 'cacheStoreFactory', 'storeFactory',
+                    storeFactoryDesc.className, storeFactoryDesc.fields, true);
+
+                if (dataSourceFound)
+                    res.line('storeFactory.setDataSource(dataSource);');
+            }
+
+            res.needEmptyLine = true;
+        }
+
+        res.line(cacheVarName + '.setStoreFactory(storeFactory);');
+
+        res.needEmptyLine = true;
+    }
+
+    $generatorJava.property(res, cacheVarName, cache, 'loadPreviousValue');
+    $generatorJava.property(res, cacheVarName, cache, 'readThrough');
+    $generatorJava.property(res, cacheVarName, cache, 'writeThrough');
+
+    res.needEmptyLine = true;
+
+    $generatorJava.property(res, cacheVarName, cache, 'writeBehindEnabled');
+    $generatorJava.property(res, cacheVarName, cache, 'writeBehindBatchSize');
+    $generatorJava.property(res, cacheVarName, cache, 'writeBehindFlushSize');
+    $generatorJava.property(res, cacheVarName, cache, 'writeBehindFlushFrequency');
+    $generatorJava.property(res, cacheVarName, cache, 'writeBehindFlushThreadCount');
+
+    res.needEmptyLine = true;
+
+    return res;
+};
+
+// Generate cache concurrency group.
+$generatorJava.cacheConcurrency = function (cache, varName, res) {
+    if (!res)
+        res = $generatorCommon.builder();
+
+    $generatorJava.property(res, varName, cache, 'maxConcurrentAsyncOperations');
+    $generatorJava.property(res, varName, cache, 'defaultLockTimeout');
+    $generatorJava.property(res, varName, cache, 'atomicWriteOrderMode', res.importClass('org.apache.ignite.cache.CacheAtomicWriteOrderMode'));
+    $generatorJava.property(res, varName, cache, 'writeSynchronizationMode', res.importClass('org.apache.ignite.cache.CacheWriteSynchronizationMode'));
+
+    res.needEmptyLine = true;
+
+    return res;
+};
+
+// Generate cache rebalance group.
+$generatorJava.cacheRebalance = function (cache, varName, res) {
+    if (!res)
+        res = $generatorCommon.builder();
+
+    if (cache.cacheMode != 'LOCAL') {
+        $generatorJava.property(res, varName, cache, 'rebalanceMode', 'CacheRebalanceMode');
+        $generatorJava.property(res, varName, cache, 'rebalanceThreadPoolSize');
+        $generatorJava.property(res, varName, cache, 'rebalanceBatchSize');
+        $generatorJava.property(res, varName, cache, 'rebalanceOrder');
+        $generatorJava.property(res, varName, cache, 'rebalanceDelay');
+        $generatorJava.property(res, varName, cache, 'rebalanceTimeout');
+        $generatorJava.property(res, varName, cache, 'rebalanceThrottle');
+
+        res.needEmptyLine = true;
+    }
+
+    if (cache.igfsAffinnityGroupSize) {
+        res.line(varName + '.setAffinityMapper(new ' + res.importClass('org.apache.ignite.igfs.IgfsGroupDataBlocksKeyMapper') + '(' + cache.igfsAffinnityGroupSize + '));');
+
+        res.needEmptyLine = true;
+    }
+
+    return res;
+};
+
+// Generate cache server near cache group.
+$generatorJava.cacheServerNearCache = function (cache, varName, res) {
+    if (!res)
+        res = $generatorCommon.builder();
+
+    if (cache.cacheMode == 'PARTITIONED' && cache.nearCacheEnabled) {
+        res.needEmptyLine = true;
+
+        res.importClass('org.apache.ignite.configuration.NearCacheConfiguration');
+
+        $generatorJava.beanProperty(res, varName, cache.nearConfiguration, 'nearConfiguration', 'nearConfiguration',
+            'NearCacheConfiguration', {nearStartSize: null}, true);
+
+        if (cache.nearConfiguration && cache.nearConfiguration.nearEvictionPolicy && cache.nearConfiguration.nearEvictionPolicy.kind) {
+            $generatorJava.evictionPolicy(res, 'nearConfiguration', cache.nearConfiguration.nearEvictionPolicy, 'nearEvictionPolicy');
+        }
+
+        res.needEmptyLine = true;
+    }
+
+    return res;
+};
+
+// Generate cache statistics group.
+$generatorJava.cacheStatistics = function (cache, varName, res) {
+    if (!res)
+        res = $generatorCommon.builder();
+
+    $generatorJava.property(res, varName, cache, 'statisticsEnabled');
+    $generatorJava.property(res, varName, cache, 'managementEnabled');
+
+    res.needEmptyLine = true;
+
+    return res;
+};
+
+// Generate metadata query fields.
+$generatorJava.metadataQueryFields = function (res, meta) {
+    var fields = meta.fields;
+
+    if (fields && fields.length > 0) {
+        $generatorJava.declareVariable(res, 'fields', 'java.util.LinkedHashMap', 'java.util.LinkedHashMap', 'java.lang.String', 'java.lang.String');
+
+        _.forEach(fields, function (field) {
+            res.line('fields.put("' + field.name + '", "' + $dataStructures.fullClassName(field.className) + '");');
+        });
+
+        res.needEmptyLine = true;
+
+        res.line('queryMeta.setFields(fields);');
+
+        res.needEmptyLine = true;
+    }
+};
+
+// Generate metadata query aliases.
+$generatorJava.metadataQueryAliases = function (res, meta) {
+    var aliases = meta.aliases;
+
+    if (aliases && aliases.length > 0) {
+        $generatorJava.declareVariable(res, 'aliases', 'java.util.Map', 'java.util.HashMap', 'java.lang.String', 'java.lang.String');
+
+        _.forEach(aliases, function (alias) {
+            res.line('aliases.put("' + alias.field + '", "' + alias.alias + '");');
+        });
+
+        res.needEmptyLine = true;
+
+        res.line('queryMeta.setAliases(aliases);');
+
+        res.needEmptyLine = true;
+    }
+};
+
+// Generate metadata indexes.
+$generatorJava.metadataQueryIndexes = function (res, meta) {
+    var indexes = meta.indexes;
+
+    if (indexes && indexes.length > 0) {
+        res.needEmptyLine = true;
+
+        $generatorJava.declareVariable(res, 'indexes', 'java.util.Map', 'java.util.LinkedHashMap', 'String', 'org.apache.ignite.cache.store.QueryEntityIndex');
+
+        _.forEach(indexes, function (index) {
+            res.needEmptyLine = true;
+
+            $generatorJava.declareVariable(res, 'index', 'org.apache.ignite.cache.store.QueryEntityIndex');
+
+            $generatorJava.property(res, 'index', index, 'name');
+            $generatorJava.property(res, 'index', index, 'type', 'org.apache.ignite.cache.store.QueryEntityIndex.Type');
+
+            var fields = index.fields;
+
+            if (fields && fields.length > 0) {
+                $generatorJava.declareVariable(res, 'indFlds', 'java.util.LinkedHashMap', 'java.util.LinkedHashMap', 'String', 'Boolean');
+
+                _.forEach(fields, function(field) {
+                    res.line('indFlds.put("' + field.name + '", ' + field.direction + ');');
+                });
+
+                res.needEmptyLine = true;
+
+                res.line('index.setFields(indFlds);');
+
+                res.needEmptyLine = true;
+            }
+
+            res.line('indexes.add(index);');
+        });
+
+        res.needEmptyLine = true;
+
+        res.line('queryMeta.setIndexes(indexes);');
+
+        res.needEmptyLine = true;
+    }
+};
+
+// Generate metadata db fields.
+$generatorJava.metadataDatabaseFields = function (res, meta, fieldProperty) {
+    var dbFields = meta[fieldProperty];
+
+    if (dbFields && dbFields.length > 0) {
+        res.needEmptyLine = true;
+
+        res.importClass('java.sql.Types');
+
+        res.startBlock('jdbcType.' + $commonUtils.toJavaName('set', fieldProperty) + '(');
+
+        var lastIx = dbFields.length - 1;
+
+        _.forEach(dbFields, function (field, ix) {
+            res.line('new JdbcTypeField(' +
+                'Types.' + field.databaseType + ', ' + '"' + field.databaseName + '", ' +
+                res.importClass(field.javaType) + '.class, ' + '"' + field.javaName + '"'+ ')' + (ix < lastIx ? ',' : ''));
+        });
+
+        res.endBlock(');');
+
+        res.needEmptyLine = true;
+    }
+};
+
+// Generate metadata general group.
+$generatorJava.metadataGeneral = function (meta, res) {
+    if (!res)
+        res = $generatorCommon.builder();
+
+    $generatorJava.classNameProperty(res, 'typeMeta', meta, 'keyType');
+    $generatorJava.classNameProperty(res, 'typeMeta', meta, 'valueType');
+
+    res.needEmptyLine = true;
+
+    return res;
+};
+
+// Generate metadata for query group.
+$generatorJava.metadataQuery = function (meta, res) {
+    if (!res)
+        res = $generatorCommon.builder();
+
+    $generatorJava.metadataQueryFields(res, meta);
+
+    $generatorJava.metadataQueryAliases(res, meta);
+
+    $generatorJava.metadataQueryIndexes(res, meta);
+
+    res.needEmptyLine = true;
+
+    return res;
+};
+
+// Generate metadata for store group.
+$generatorJava.metadataStore = function (meta, withTypes, res) {
+    if (!res)
+        res = $generatorCommon.builder();
+
+    $generatorJava.property(res, 'jdbcType', meta, 'databaseSchema');
+    $generatorJava.property(res, 'jdbcType', meta, 'databaseTable');
+    $generatorJava.property(res, 'jdbcType', meta, 'keepSerialized', null, null, false);
+
+    if (withTypes) {
+        $generatorJava.property(res, 'jdbcType', meta, 'keyType');
+        $generatorJava.property(res, 'jdbcType', meta, 'valueType');
+    }
+
+    $generatorJava.metadataDatabaseFields(res, meta, 'keyFields');
+
+    $generatorJava.metadataDatabaseFields(res, meta, 'valueFields');
+
+    res.needEmptyLine = true;
+
+    return res;
+};
+
+// Generate cache type metadata config.
+$generatorJava.cacheMetadata = function(meta, res) {
+    $generatorJava.declareVariable(res, 'typeMeta', 'org.apache.ignite.cache.CacheTypeMetadata');
+
+    $generatorJava.metadataGeneral(meta, res);
+
+    res.emptyLineIfNeeded();
+    res.line('types.add(typeMeta);');
+
+    res.needEmptyLine = true;
+};
+
+// Generate cache type metadata config.
+$generatorJava.cacheQueryMetadata = function(meta, res) {
+    $generatorJava.declareVariable(res, 'queryMeta', 'org.apache.ignite.cache.store.QueryEntity');
+
+    $generatorJava.classNameProperty(res, 'queryMeta', meta, 'keyType');
+    $generatorJava.classNameProperty(res, 'queryMeta', meta, 'valueType');
+
+    res.needEmptyLine = true;
+
+    $generatorJava.metadataQuery(meta, res);
+
+    res.emptyLineIfNeeded();
+    res.line('queryEntities.add(queryMeta);');
+
+    res.needEmptyLine = true;
+};
+
+// Generate cache type metadata configs.
+$generatorJava.cacheMetadatas = function (metadatas, varName, res) {
+    if (!res)
+        res = $generatorCommon.builder();
+
+    // Generate cache type metadata configs.
+    if (metadatas && metadatas.length > 0) {
+        $generatorJava.declareVariable(res, 'types', 'java.util.Collection', 'java.util.ArrayList', 'org.apache.ignite.cache.CacheTypeMetadata');
+
+        _.forEach(metadatas, function (meta) {
+            $generatorJava.cacheMetadata(meta, res);
+        });
+
+        res.line(varName + '.setTypeMetadata(types);');
+
+        res.needEmptyLine = true;
+
+        $generatorJava.declareVariable(res, 'queryEntities', 'java.util.Collection', 'java.util.ArrayList', 'org.apache.ignite.cache.store.QueryEntity');
+
+        _.forEach(metadatas, function (meta) {
+            $generatorJava.cacheQueryMetadata(meta, res);
+        });
+
+        res.line(varName + '.setQueryEntities(queryEntities);');
+
+        res.needEmptyLine = true;
+    }
+
+    return res;
+};
+
+// Generate cache configs.
+$generatorJava.cache = function(cache, varName, res) {
+    if (!res)
+        res = $generatorCommon.builder();
+
+    $generatorJava.cacheGeneral(cache, varName, res);
+
+    $generatorJava.cacheMemory(cache, varName, res);
+
+    $generatorJava.cacheQuery(cache, varName, res);
+
+    $generatorJava.cacheStore(cache, varName, res);
+
+    $generatorJava.cacheConcurrency(cache, varName, res);
+
+    $generatorJava.cacheRebalance(cache, varName, res);
+
+    $generatorJava.cacheServerNearCache(cache, varName, res);
+
+    $generatorJava.cacheStatistics(cache, varName, res);
+
+    $generatorJava.cacheMetadatas(cache.metadatas, varName, res);
+};
+
+// Generate cluster caches.
+$generatorJava.clusterCaches = function (caches, igfss, res) {
+    function clusterCache(res, cache, names) {
+        res.emptyLineIfNeeded();
+
+        var cacheName = $commonUtils.toJavaName('cache', cache.name);
+
+        $generatorJava.declareVariable(res, cacheName, 'org.apache.ignite.configuration.CacheConfiguration');
+
+        $generatorJava.cache(cache, cacheName, res);
+
+        names.push(cacheName);
+
+        res.needEmptyLine = true;
+    }
+
+    if (!res)
+        res = $generatorCommon.builder();
+
+    var names = [];
+
+    if (caches && caches.length > 0) {
+        res.emptyLineIfNeeded();
+
+        _.forEach(caches, function (cache) {
+            clusterCache(res, cache, names);
+        });
+
+        res.needEmptyLine = true;
+    }
+
+    if (igfss && igfss.length > 0) {
+        res.emptyLineIfNeeded();
+
+        _.forEach(igfss, function (igfs) {
+            clusterCache(res, $generatorCommon.igfsDataCache(igfs), names);
+            clusterCache(res, $generatorCommon.igfsMetaCache(igfs), names);
+        });
+
+        res.needEmptyLine = true;
+    }
+
+    if (names.length > 0) {
+        res.line('cfg.setCacheConfiguration(' + names.join(', ') + ');');
+
+        res.needEmptyLine = true;
+    }
+
+    return res;
+};
+
+/**
+ * Generate java class code.
+ *
+ * @param meta Metadata object.
+ * @param key If 'true' then key class should be generated.
+ * @param pkg Package name.
+ * @param useConstructor If 'true' then empty and full constructors should be generated.
+ * @param includeKeyFields If 'true' then include key fields into value POJO.
+ * @param res Resulting output with generated code.
+ */
+$generatorJava.javaClassCode = function (meta, key, pkg, useConstructor, includeKeyFields, res) {
+    if (!res)
+        res = $generatorCommon.builder();
+
+    var type = (key ? meta.keyType : meta.valueType);
+    type = type.substring(type.lastIndexOf('.') + 1);
+
+    // Class comment.
+    res.line('/**');
+    res.line(' * ' + type + ' definition.');
+    res.line(' *');
+    res.line(' * ' + $generatorCommon.mainComment());
+    res.line(' */');
+
+    res.startBlock('public class ' + type + ' implements ' + res.importClass('java.io.Serializable') + ' {');
+
+    res.line('/** */');
+    res.line('private static final long serialVersionUID = 0L;');
+    res.needEmptyLine = true;
+
+    var allFields = (key || includeKeyFields) ? meta.keyFields.slice() : [];
+
+    if (!key)
+        _.forEach(meta.valueFields, function (valFld) {
+            if (_.findIndex(allFields, function(fld) {
+                return fld.javaName == valFld.javaName;
+            }) < 0)
+                allFields.push(valFld);
+        });
+
+    // Generate allFields declaration.
+    _.forEach(allFields, function (field) {
+        var fldName = field.javaName;
+
+        res.line('/** Value for ' + fldName + '. */');
+
+        res.line('private ' + res.importClass(field.javaType) + ' ' + fldName + ';');
+
+        res.needEmptyLine = true;
+    });
+
+    // Generate constructors.
+    if (useConstructor) {
+        res.line('/**');
+        res.line(' * Empty constructor.');
+        res.line(' */');
+        res.startBlock('public ' + type + '() {');
+        res.line('// No-op.');
+        res.endBlock('}');
+
+        res.needEmptyLine = true;
+
+        res.line('/**');
+        res.line(' * Full constructor.');
+        res.line(' */');
+        res.startBlock('public ' + type + '(');
+
+        _.forEach(allFields, function(field) {
+            res.line(res.importClass(field.javaType) + ' ' + field.javaName + (fldIx < allFields.length - 1 ? ',' : ''))
+        });
+
+        res.endBlock(') {');
+
+        res.startBlock();
+
+        _.forEach(allFields, function (field) {
+            res.line('this.' + field.javaName +' = ' + field.javaName + ';');
+        });
+
+        res.endBlock('}');
+
+        res.needEmptyLine = true;
+    }
+
+    // Generate getters and setters methods.
+    _.forEach(allFields, function (field) {
+        var fldName = field.javaName;
+
+        var fldType = res.importClass(field.javaType);
+
+        res.line('/**');
+        res.line(' * Gets ' + fldName + '.');
+        res.line(' *');
+        res.line(' * @return Value for ' + fldName + '.');
+        res.line(' */');
+        res.startBlock('public ' + fldType + ' ' + $commonUtils.toJavaName('get', fldName) + '() {');
+        res.line('return ' + fldName + ';');
+        res.endBlock('}');
+
+        res.needEmptyLine = true;
+
+        res.line('/**');
+        res.line(' * Sets ' + fldName + '.');
+        res.line(' *');
+        res.line(' * @param ' + fldName + ' New value for ' + fldName + '.');
+        res.line(' */');
+        res.startBlock('public void ' + $commonUtils.toJavaName('set', fldName) + '(' + fldType + ' ' + fldName + ') {');
+        res.line('this.' + fldName + ' = ' + fldName + ';');
+        res.endBlock('}');
+
+        res.needEmptyLine = true;
+    });
+
+    // Generate equals() method.
+    res.line('/** {@inheritDoc} */');
+    res.startBlock('@Override public boolean equals(Object o) {');
+    res.startBlock('if (this == o)');
+    res.line('return true;');
+    res.endBlock();
+    res.append('');
+
+    res.startBlock('if (!(o instanceof ' + type + '))');
+    res.line('return false;');
+    res.endBlock();
+
+    res.needEmptyLine = true;
+
+    res.line(type + ' that = (' + type + ')o;');
+
+    _.forEach(allFields, function (field) {
+        res.needEmptyLine = true;
+
+        var javaName = field.javaName;
+
+        res.startBlock('if (' + javaName + ' != null ? !' + javaName + '.equals(that.' + javaName + ') : that.' + javaName + ' != null)');
+
+        res.line('return false;');
+        res.endBlock()
+    });
+
+    res.needEmptyLine = true;
+
+    res.line('return true;');
+    res.endBlock('}');
+
+    res.needEmptyLine = true;
+
+    // Generate hashCode() method.
+    res.line('/** {@inheritDoc} */');
+    res.startBlock('@Override public int hashCode() {');
+
+    var first = true;
+
+    _.forEach(allFields, function (field) {
+        var javaName = field.javaName;
+
+        if (!first)
+            res.needEmptyLine = true;
+
+        res.line(first ? 'int res = ' + javaName + ' != null ? ' + javaName + '.hashCode() : 0;'
+            : 'res = 31 * res + (' + javaName + ' != null ? ' + javaName + '.hashCode() : 0);');
+
+        first = false;
+    });
+
+    res.needEmptyLine = true;
+    res.line('return res;');
+    res.endBlock('}');
+    res.needEmptyLine = true;
+
+    // Generate toString() method.
+    res.line('/** {@inheritDoc} */');
+    res.startBlock('@Override public String toString() {');
+
+    if (allFields.length > 0) {
+        field = allFields[0];
+
+        res.startBlock('return \"' + type + ' [' + field.javaName + '=\" + ' + field.javaName + ' +', type);
+
+        for (fldIx = 1; fldIx < allFields.length; fldIx ++) {
+            field = allFields[fldIx];
+
+            var javaName = field.javaName;
+
+            res.line('\", ' + javaName + '=\" + ' + field.javaName + ' +');
+        }
+    }
+
+    res.line('\']\';');
+    res.endBlock();
+    res.endBlock('}');
+
+    res.endBlock('}');
+
+    return 'package ' + pkg + ';' + '\n\n' + res.generateImports() + '\n\n' + res.asString();
+};
+
+/**
+ * Generate source code for type by its metadata.
+ *
+ * @param caches List of caches to generate POJOs for.
+ * @param useConstructor If 'true' then generate constructors.
+ * @param includeKeyFields If 'true' then include key fields into value POJO.
+ */
+$generatorJava.pojos = function (caches, useConstructor, includeKeyFields) {
+    var metadataNames = [];
+
+    var metadatas = [];
+
+    _.forEach(caches, function(cache) {
+        _.forEach(cache.metadatas, function(meta) {
+            // Skip already generated classes.
+            if (!_.find(metadatas, {valueType: meta.valueType}) &&
+                // Skip metadata without value fields.
+                $commonUtils.isDefined(meta.valueFields) && meta.valueFields.length > 0) {
+                var metadata = {};
+
+                // Key class generation only if key is not build in java class.
+                if ($commonUtils.isDefined(meta.keyFields) && meta.keyFields.length > 0) {
+                    metadata.keyType = meta.keyType;
+                    metadata.keyClass = $generatorJava.javaClassCode(meta, true,
+                        meta.keyType.substring(0, meta.keyType.lastIndexOf('.')), useConstructor, includeKeyFields);
+                }
+
+                metadata.valueType = meta.valueType;
+                metadata.valueClass = $generatorJava.javaClassCode(meta, false,
+                    meta.valueType.substring(0, meta.valueType.lastIndexOf('.')), useConstructor, includeKeyFields);
+
+                metadatas.push(metadata);
+            }
+        });
+    });
+
+    return metadatas;
+};
+
+/**
+ * @param type Full type name.
+ * @return Field java type name.
+ */
+$generatorJava.javaTypeName = function(type) {
+    var ix = $generatorJava.javaBuildInClasses.indexOf(type);
+
+    var resType = ix >= 0 ? $generatorJava.javaBuildInFullNameClasses[ix] : type;
+
+    return resType.indexOf("java.lang.") >= 0 ? resType.substring(10) : resType;
+};
+
+/**
+ * Java code generator for cluster's SSL configuration.
+ *
+ * @param cluster Cluster to get SSL configuration.
+ * @param res Optional configuration presentation builder object.
+ * @returns Configuration presentation builder object
+ */
+$generatorJava.clusterSsl = function(cluster, res) {
+    if (!res)
+        res = $generatorCommon.builder();
+
+    if (cluster.sslEnabled && $commonUtils.isDefined(cluster.sslContextFactory)) {
+
+        cluster.sslContextFactory.keyStorePassword = $commonUtils.isDefinedAndNotEmpty(cluster.sslContextFactory.keyStoreFilePath) ?
+            'props.getProperty("ssl.key.storage.password").toCharArray()' : undefined;
+
+        cluster.sslContextFactory.trustStorePassword = $commonUtils.isDefinedAndNotEmpty(cluster.sslContextFactory.trustStoreFilePath) ?
+            'props.getProperty("ssl.trust.storage.password").toCharArray()' : undefined;
+
+        var propsDesc = $commonUtils.isDefinedAndNotEmpty(cluster.sslContextFactory.trustManagers) ?
+            $generatorCommon.SSL_CONFIGURATION_TRUST_MANAGER_FACTORY.fields :
+            $generatorCommon.SSL_CONFIGURATION_TRUST_FILE_FACTORY.fields;
+
+        $generatorJava.beanProperty(res, 'cfg', cluster.sslContextFactory, 'sslContextFactory', 'sslContextFactory',
+            'org.apache.ignite.ssl.SslContextFactory', propsDesc, true);
+
+        res.needEmptyLine = true;
+    }
+
+    return res;
+};
+
+/**
+ * Java code generator for cluster's IGFS configurations.
+ *
+ * @param igfss List of configured IGFS.
+ * @param varName Name of IGFS configuration variable.
+ * @param res Optional configuration presentation builder object.
+ * @returns Configuration presentation builder object.
+ */
+$generatorJava.igfss = function(igfss, varName, res) {
+    if (!res)
+        res = $generatorCommon.builder();
+
+    if ($commonUtils.isDefinedAndNotEmpty(igfss)) {
+        res.emptyLineIfNeeded();
+
+        var arrayName = 'fileSystems';
+        var igfsInst = 'igfs';
+
+        res.line(res.importClass('org.apache.ignite.configuration.FileSystemConfiguration') + '[] ' + arrayName + ' = new FileSystemConfiguration[' + igfss.length + '];');
+
+        _.forEach(igfss, function(igfs, ix) {
+            $generatorJava.declareVariable(res, igfsInst, 'org.apache.ignite.configuration.FileSystemConfiguration');
+
+            $generatorJava.igfsGeneral(igfs, igfsInst, res);
+            $generatorJava.igfsIPC(igfs, igfsInst, res);
+            $generatorJava.igfsFragmentizer(igfs, igfsInst, res);
+            $generatorJava.igfsDualMode(igfs, igfsInst, res);
+            $generatorJava.igfsSecondFS(igfs, igfsInst, res);
+            $generatorJava.igfsMisc(igfs, igfsInst, res);
+
+            res.line(arrayName + '[' + ix + '] = ' + igfsInst + ';');
+
+            res.needEmptyLine = true;
+        });
+
+        res.line(varName + '.' + 'setFileSystemConfiguration(' + arrayName + ');');
+
+        res.needEmptyLine = true;
+    }
+
+    return res;
+};
+
+/**
+ * Java code generator for IGFS IPC configuration.
+ *
+ * @param igfs Configured IGFS.
+ * @param varName Name of IGFS configuration variable.
+ * @param res Optional configuration presentation builder object.
+ * @returns Configuration presentation builder object.
+ */
+$generatorJava.igfsIPC = function(igfs, varName, res) {
+    if (!res)
+        res = $generatorCommon.builder();
+
+    if (igfs.ipcEndpointEnabled) {
+        var desc = $generatorCommon.IGFS_IPC_CONFIGURATION;
+
+        $generatorJava.beanProperty(res, varName, igfs.ipcEndpointConfiguration, 'ipcEndpointConfiguration', 'ipcEndpointCfg',
+            desc.className, desc.fields, true);
+
+        res.needEmptyLine = true;
+    }
+
+    return res;
+};
+
+/**
+ * Java code generator for IGFS fragmentizer configuration.
+ *
+ * @param igfs Configured IGFS.
+ * @param varName Name of IGFS configuration variable.
+ * @param res Optional configuration presentation builder object.
+ * @returns Configuration presentation builder object.
+ */
+$generatorJava.igfsFragmentizer = function(igfs, varName, res) {
+    if (!res)
+        res = $generatorCommon.builder();
+
+    if (igfs.fragmentizerEnabled) {
+        $generatorJava.property(res, varName, igfs, 'fragmentizerConcurrentFiles', null, null, 0);
+        $generatorJava.property(res, varName, igfs, 'fragmentizerThrottlingBlockLength', null, null, 16777216);
+        $generatorJava.property(res, varName, igfs, 'fragmentizerThrottlingDelay', null, null, 200);
+
+        res.needEmptyLine = true;
+    }
+    else
+        $generatorJava.property(res, varName, igfs, 'fragmentizerEnabled');
+
+    return res;
+};
+
+/**
+ * Java code generator for IGFS dual mode configuration.
+ *
+ * @param igfs Configured IGFS.
+ * @param varName Name of IGFS configuration variable.
+ * @param res Optional configuration presentation builder object.
+ * @returns Configuration presentation builder object.
+ */
+$generatorJava.igfsDualMode = function(igfs, varName, res) {
+    if (!res)
+        res = $generatorCommon.builder();
+
+    $generatorJava.property(res, varName, igfs, 'dualModeMaxPendingPutsSize', null, null, 0);
+
+    if ($commonUtils.isDefinedAndNotEmpty(igfs.dualModePutExecutorService))
+        res.line(varName + '.' + $generatorJava.setterName('dualModePutExecutorService') + '(new ' + res.importClass(igfs.dualModePutExecutorService) + '());');
+
+    $generatorJava.property(res, varName, igfs, 'dualModePutExecutorServiceShutdown', null, null, false);
+
+    res.needEmptyLine = true;
+
+    return res;
+};
+
+$generatorJava.igfsSecondFS = function(igfs, varName, res) {
+    if (!res)
+        res = $generatorCommon.builder();
+
+    if (igfs.secondaryFileSystemEnabled) {
+        var secondFs = igfs.secondaryFileSystem || {};
+
+        var uriDefined = $commonUtils.isDefinedAndNotEmpty(secondFs.uri);
+        var nameDefined = $commonUtils.isDefinedAndNotEmpty(secondFs.userName);
+        var cfgDefined = $commonUtils.isDefinedAndNotEmpty(secondFs.cfgPath);
+
+        res.line(varName + '.setSecondaryFileSystem(new ' +
+            res.importClass('org.apache.ignite.hadoop.fs.IgniteHadoopIgfsSecondaryFileSystem') + '(' +
+                (uriDefined ? '"' + secondFs.uri + '"' : 'null') +
+                (cfgDefined || nameDefined ? (cfgDefined ? ', "' + secondFs.cfgPath + '"' : ', null') : '') +
+                (nameDefined ? ', "' + secondFs.userName + '"' : '') +
+            '));');
+
+        res.needEmptyLine = true;
+    }
+
+    return res;
+};
+
+/**
+ * Java code generator for IGFS general configuration.
+ *
+ * @param igfs Configured IGFS.
+ * @param varName Name of IGFS configuration variable.
+ * @param res Optional configuration presentation builder object.
+ * @returns Configuration presentation builder object.
+ */
+$generatorJava.igfsGeneral = function(igfs, varName, res) {
+    if (!res)
+        res = $generatorCommon.builder();
+
+    if ($commonUtils.isDefinedAndNotEmpty(igfs.name)) {
+        igfs.dataCacheName = $generatorCommon.igfsDataCache(igfs).name;
+        igfs.metaCacheName = $generatorCommon.igfsMetaCache(igfs).name;
+
+        $generatorJava.property(res, varName, igfs, 'name');
+        $generatorJava.property(res, varName, igfs, 'dataCacheName');
+        $generatorJava.property(res, varName, igfs, 'metaCacheName');
+
+        res.needEmptyLine = true;
+    }
+
+    return res;
+};
+
+/**
+ * Java code generator for IGFS misc configuration.
+ *
+ * @param igfs Configured IGFS.
+ * @param varName Name of IGFS configuration variable.
+ * @param res Optional configuration presentation builder object.
+ * @returns Configuration presentation builder object.
+ */
+$generatorJava.igfsMisc = function(igfs, varName, res) {
+    if (!res)
+        res = $generatorCommon.builder();
+
+    $generatorJava.property(res, varName, igfs, 'blockSize', null, null, 65536);
+    $generatorJava.property(res, varName, igfs, 'streamBufferSize', null, null, 65536);
+    $generatorJava.property(res, varName, igfs, 'defaultMode', res.importClass('org.apache.ignite.igfs.IgfsMode'), undefined, "DUAL_ASYNC");
+    $generatorJava.property(res, varName, igfs, 'maxSpaceSize', null, null, 0);
+    $generatorJava.property(res, varName, igfs, 'maximumTaskRangeLength', null, null, 0);
+    $generatorJava.property(res, varName, igfs, 'managementPort', null, null, 11400);
+
+    if (igfs.pathModes && igfs.pathModes.length > 0) {
+        res.needEmptyLine = true;
+
+        $generatorJava.declareVariable(res, 'pathModes', 'java.util.Map', 'java.util.HashMap', 'String', 'org.apache.ignite.igfs.IgfsMode');
+
+        _.forEach(igfs.pathModes, function (pair) {
+            res.line('pathModes.put("' + pair.path + '", IgfsMode.' + pair.mode +');');
+        });
+
+        res.needEmptyLine = true;
+
+        res.line(varName + '.setPathModes(pathModes);');
+    }
+
+    $generatorJava.property(res, varName, igfs, 'perNodeBatchSize', null, null, 100);
+    $generatorJava.property(res, varName, igfs, 'perNodeParallelBatchCount', null, null, 8);
+    $generatorJava.property(res, varName, igfs, 'prefetchBlocks', null, null, 0);
+    $generatorJava.property(res, varName, igfs, 'sequentialReadsBeforePrefetch', null, null, 0);
+    $generatorJava.property(res, varName, igfs, 'trashPurgeTimeout', null, null, 1000);
+
+    res.needEmptyLine = true;
+
+    return res;
+};
+
+/**
+ * Function to generate java code for cluster configuration.
+ *
+ * @param cluster Cluster to process.
+ * @param javaClass Class name for generate factory class otherwise generate code snippet.
+ * @param clientNearCfg Near cache configuration for client node.
+ */
+$generatorJava.cluster = function (cluster, javaClass, clientNearCfg) {
+    var res = $generatorCommon.builder();
+
+    if (cluster) {
+        if (javaClass) {
+            res.line('/**');
+            res.line(' * ' + $generatorCommon.mainComment());
+            res.line(' */');
+            res.startBlock('public class ' + javaClass + ' {');
+            res.line('/**');
+            res.line(' * Configure grid.');
+            res.line(' *');
+            res.line(' * @return Ignite configuration.');
+            res.line(' * @throws Exception If failed to construct Ignite configuration instance.');
+            res.line(' */');
+            res.startBlock('public static IgniteConfiguration createConfiguration() throws Exception {');
+        }
+
+        var haveDS = _.findIndex(cluster.caches, function(cache) {
+            if (cache.cacheStoreFactory && cache.cacheStoreFactory.kind) {
+                var factory = cache.cacheStoreFactory[cache.cacheStoreFactory.kind];
+
+                if (factory && factory.dialect)
+                    return true;
+            }
+
+            return false;
+        }) >= 0;
+
+        if (haveDS || cluster.sslEnabled) {
+            res.line(res.importClass('java.net.URL') + ' res = IgniteConfiguration.class.getResource("/secret.properties");');
+
+            res.needEmptyLine = true;
+
+            res.line(res.importClass('java.io.File') + ' propsFile = new File(res.toURI());');
+
+            res.needEmptyLine = true;
+
+            res.line(res.importClass('java.util.Properties') + ' props = new Properties();');
+
+            res.needEmptyLine = true;
+
+            res.startBlock('try (' + res.importClass('java.io.InputStream') + ' in = new ' + res.importClass('java.io.FileInputStream') + '(propsFile)) {');
+            res.line('props.load(in);');
+            res.endBlock('}');
+
+            res.needEmptyLine = true;
+        }
+
+        $generatorJava.clusterGeneral(cluster, clientNearCfg, res);
+
+        $generatorJava.clusterAtomics(cluster, res);
+
+        $generatorJava.clusterCommunication(cluster, res);
+
+        $generatorJava.clusterConnector(cluster, res);
+
+        $generatorJava.clusterDeployment(cluster, res);
+
+        $generatorJava.clusterEvents(cluster, res);
+
+        $generatorJava.clusterMarshaller(cluster, res);
+
+        $generatorJava.clusterMetrics(cluster, res);
+
+        $generatorJava.clusterSwap(cluster, res);
+
+        $generatorJava.clusterTime(cluster, res);
+
+        $generatorJava.clusterPools(cluster, res);
+
+        $generatorJava.clusterTransactions(cluster, res);
+
+        $generatorJava.clusterCaches(cluster.caches, cluster.igfss, res);
+
+        $generatorJava.clusterSsl(cluster, res);
+
+        $generatorJava.igfss(cluster.igfss, 'cfg', res);
+
+        if (javaClass) {
+            res.importClass('org.apache.ignite.Ignite');
+            res.importClass('org.apache.ignite.Ignition');
+
+            res.line('return cfg;');
+            res.endBlock('}');
+
+            res.needEmptyLine = true;
+
+            res.line('/**');
+            res.line(' * Sample usage of ' + javaClass + '.');
+            res.line(' *');
+            res.line(' * @param args Command line arguments, none required.');
+            res.line(' * @throws Exception If sample execution failed.');
+            res.line(' */');
+
+            res.startBlock('public static void main(String[] args) throws Exception {');
+            res.startBlock('try (Ignite ignite = Ignition.start(' + javaClass + '.createConfiguration())) {');
+            res.line('System.out.println("Write some code here...");');
+            res.endBlock('}');
+            res.endBlock('}');
+
+            res.endBlock('}');
+
+            return res.generateImports() + '\n\n' + res.asString();
+        }
+    }
+
+    return res.asString();
+};

http://git-wip-us.apache.org/repos/asf/ignite/blob/ce945056/modules/control-center-web/src/main/js/helpers/generator/generator-pom.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/helpers/generator/generator-pom.js b/modules/control-center-web/src/main/js/helpers/generator/generator-pom.js
new file mode 100644
index 0000000..20ed535
--- /dev/null
+++ b/modules/control-center-web/src/main/js/helpers/generator/generator-pom.js
@@ -0,0 +1,145 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// pom.xml generation entry point.
+$generatorPom = {};
+
+/**
+ * Generate pom.xml.
+ *
+ * @param caches Collection of caches to take info about used JDBC dialects.
+ * @param igniteVersion Ignite version for Ignite dependencies.
+ * @param res Resulting output with generated pom.
+ * @returns {string} Generated content.
+ */
+$generatorPom.pom = function (caches, igniteVersion, res) {
+    if (!res)
+        res = $generatorCommon.builder();
+
+    var dialect = {};
+
+    _.forEach(caches, function (cache) {
+        if (cache.cacheStoreFactory && cache.cacheStoreFactory.kind == 'CacheJdbcPojoStoreFactory') {
+            if (cache.cacheStoreFactory.CacheJdbcPojoStoreFactory) {
+                dialect[cache.cacheStoreFactory.CacheJdbcPojoStoreFactory.dialect] = true;
+            }
+        }
+    });
+
+    function addProperty(tag, val) {
+        res.line('<' + tag + '>' + val + '</' + tag + '>');
+    }
+
+    function addDependency(groupId, artifactId, version, jar) {
+        res.startBlock('<dependency>');
+        addProperty('groupId', groupId);
+        addProperty('artifactId', artifactId);
+        addProperty('version', version);
+
+        if (jar) {
+            addProperty('scope', 'system');
+            addProperty('systemPath', '${project.basedir}/jdbc-drivers/' + jar);
+        }
+
+        res.endBlock('</dependency>');
+    }
+
+    function addResource(dir, exclude) {
+        res.startBlock('<resource>');
+        if (dir)
+            addProperty('directory', dir);
+
+        if (exclude) {
+            res.startBlock('<excludes>');
+            addProperty('exclude', exclude);
+            res.endBlock('</excludes>');
+        }
+
+        res.endBlock('</resource>');
+    }
+
+    res.line('<?xml version="1.0" encoding="UTF-8"?>');
+
+    res.needEmptyLine = true;
+
+    res.line('<!-- ' + $generatorCommon.mainComment() + ' -->');
+
+    res.needEmptyLine = true;
+
+    res.startBlock('<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">');
+
+    res.line('<modelVersion>4.0.0</modelVersion>');
+
+    res.needEmptyLine = true;
+
+    addProperty('groupId', 'org.apache.ignite');
+    addProperty('artifactId', 'ignite-generated-model');
+    addProperty('version', igniteVersion);
+
+    res.needEmptyLine = true;
+
+    res.startBlock('<dependencies>');
+
+    addDependency('org.apache.ignite', 'ignite-core', igniteVersion);
+    addDependency('org.apache.ignite', 'ignite-spring', igniteVersion);
+    addDependency('org.apache.ignite', 'ignite-indexing', igniteVersion);
+    addDependency('org.apache.ignite', 'ignite-rest-http', igniteVersion);
+
+    if (dialect.MySQL)
+        addDependency('mysql', 'mysql-connector-java', '5.1.37');
+
+    if (dialect.PosgreSQL)
+        addDependency('org.postgresql', 'postgresql', '9.4-1204-jdbc42');
+
+    if (dialect.H2)
+        addDependency('com.h2database', 'h2', '1.3.175');
+
+    if (dialect.Oracle)
+        addDependency('oracle', 'jdbc', '11.2', 'ojdbc6.jar');
+
+    if (dialect.DB2)
+        addDependency('ibm', 'jdbc', '4.19.26', 'db2jcc4.jar');
+
+    if (dialect.SQLServer)
+        addDependency('microsoft', 'jdbc', '4.1', 'sqljdbc41.jar');
+
+    res.endBlock('</dependencies>');
+
+    res.needEmptyLine = true;
+
+    res.startBlock('<build>');
+    res.startBlock('<resources>');
+    addResource('src/main/java', '**/*.java');
+    addResource('src/main/resources');
+    res.endBlock('</resources>');
+
+    res.startBlock('<plugins>');
+    res.startBlock('<plugin>');
+    addProperty('artifactId', 'maven-compiler-plugin');
+    addProperty('version', '3.1');
+    res.startBlock('<configuration>');
+    addProperty('source', '1.7');
+    addProperty('target', '1.7');
+    res.endBlock('</configuration>');
+    res.endBlock('</plugin>');
+    res.endBlock('</plugins>');
+    res.endBlock('</build>');
+
+    res.endBlock('</project>');
+
+    return res;
+};

http://git-wip-us.apache.org/repos/asf/ignite/blob/ce945056/modules/control-center-web/src/main/js/helpers/generator/generator-properties.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/helpers/generator/generator-properties.js b/modules/control-center-web/src/main/js/helpers/generator/generator-properties.js
new file mode 100644
index 0000000..06328c6
--- /dev/null
+++ b/modules/control-center-web/src/main/js/helpers/generator/generator-properties.js
@@ -0,0 +1,99 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// Properties generation entry point.
+$generatorProperties = {};
+
+/**
+ * Generate properties file with properties stubs for stores data sources.
+ *
+ * @param cluster Configuration to process.
+ * @param res Resulting output with generated properties.
+ * @returns {string} Generated content.
+ */
+$generatorProperties.dataSourcesProperties = function (cluster, res) {
+    var datasources = [];
+
+    if (cluster.caches && cluster.caches.length > 0) {
+        _.forEach(cluster.caches, function (cache) {
+            if (cache.cacheStoreFactory && cache.cacheStoreFactory.kind) {
+                var storeFactory = cache.cacheStoreFactory[cache.cacheStoreFactory.kind];
+
+                if (storeFactory.dialect) {
+                    var beanId = storeFactory.dataSourceBean;
+
+                    if (!_.contains(datasources, beanId)) {
+                        datasources.push(beanId);
+
+                        if (!res) {
+                            res = $generatorCommon.builder();
+
+                            res.line('# ' + $generatorCommon.mainComment());
+                        }
+
+                        res.needEmptyLine = true;
+
+                        switch (storeFactory.dialect) {
+                            case 'DB2':
+                                res.line(beanId + '.jdbc.server_name=YOUR_JDBC_SERVER_NAME');
+                                res.line(beanId + '.jdbc.port_number=YOUR_JDBC_PORT_NUMBER');
+                                res.line(beanId + '.jdbc.database_name=YOUR_JDBC_DATABASE_TYPE');
+                                res.line(beanId + '.jdbc.driver_type=YOUR_JDBC_DRIVER_TYPE');
+                                break;
+
+                            default:
+                                res.line(beanId + '.jdbc.url=YOUR_JDBC_URL');
+                        }
+
+                        res.line(beanId + '.jdbc.username=YOUR_USER_NAME');
+                        res.line(beanId + '.jdbc.password=YOUR_PASSWORD');
+                        res.line();
+                    }
+                }
+            }
+        });
+    }
+
+    return res;
+};
+
+/**
+ * Generate properties file with properties stubs for cluster SSL configuration.
+ *
+ * @param cluster Cluster to get SSL configuration.
+ * @param res Optional configuration presentation builder object.
+ * @returns Configuration presentation builder object
+ */
+$generatorProperties.sslProperties = function (cluster, res) {
+    if (cluster.sslEnabled && cluster.sslContextFactory) {
+        if (!res) {
+            res = $generatorCommon.builder();
+
+            res.line('# ' + $generatorCommon.mainComment());
+        }
+
+        res.needEmptyLine = true;
+
+        if ($commonUtils.isDefinedAndNotEmpty(cluster.sslContextFactory.keyStoreFilePath))
+            res.line('ssl.key.storage.password=YOUR_SSL_KEY_STORAGE_PASSWORD');
+
+        if ($commonUtils.isDefinedAndNotEmpty(cluster.sslContextFactory.trustStoreFilePath))
+            res.line('ssl.trust.storage.password=YOUR_SSL_TRUST_STORAGE_PASSWORD');
+    }
+
+    return res;
+};

http://git-wip-us.apache.org/repos/asf/ignite/blob/ce945056/modules/control-center-web/src/main/js/helpers/generator/generator-readme.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/helpers/generator/generator-readme.js b/modules/control-center-web/src/main/js/helpers/generator/generator-readme.js
new file mode 100644
index 0000000..434b639
--- /dev/null
+++ b/modules/control-center-web/src/main/js/helpers/generator/generator-readme.js
@@ -0,0 +1,65 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// README.txt generation entry point.
+$generatorReadme = {};
+
+/**
+ * Generate README.txt.
+ *
+ * @param res Resulting output with generated readme.
+ * @returns {string} Generated content.
+ */
+$generatorReadme.readme = function (res) {
+    if (!res)
+        res = $generatorCommon.builder();
+
+    res.line('Content of this folder was generated by Apache Ignite Web Console');
+    res.line('=================================================================');
+
+    res.needEmptyLine = true;
+
+    res.line('Ignite ships with CacheJdbcPojoStore, which is out-of-the-box JDBC');
+    res.line('implementation of the IgniteCacheStore interface, and automatically');
+    res.line('handles all the write-through and read-through logic.');
+
+    res.needEmptyLine = true;
+
+    res.line('You can use generated configuration and POJO classes as part of your application.');
+
+    res.needEmptyLine = true;
+
+    res.line('Note, in case of using proprietary JDBC drivers (Oracle, IBM DB2, Microsoft SQL Server)');
+    res.line('you should download them and copy into ./jdbc-drivers folder.');
+
+    return res;
+};
+
+/**
+ * Generate README.txt for jdbc folder.
+ *
+ * @param res Resulting output with generated readme.
+ * @returns {string} Generated content.
+ */
+$generatorReadme.readmeJdbc = function (res) {
+    if (!res)
+        res = $generatorCommon.builder();
+
+    res.line('Copy proprietary JDBC drivers to this folder.');
+
+    return res;
+};


[4/7] ignite git commit: IGNITE-1857 Generate configuration zip on client side.

Posted by an...@apache.org.
http://git-wip-us.apache.org/repos/asf/ignite/blob/ce945056/modules/control-center-web/src/main/js/helpers/generator/generator-xml.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/helpers/generator/generator-xml.js b/modules/control-center-web/src/main/js/helpers/generator/generator-xml.js
new file mode 100644
index 0000000..9f7683a
--- /dev/null
+++ b/modules/control-center-web/src/main/js/helpers/generator/generator-xml.js
@@ -0,0 +1,1479 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// XML generation entry point.
+$generatorXml = {};
+
+// Do XML escape.
+$generatorXml.escape = function (s) {
+    if (typeof(s) != 'string')
+        return s;
+
+    return s.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/"/g, '&quot;');
+};
+
+// Add XML element.
+$generatorXml.element = function (res, tag, attr1, val1, attr2, val2) {
+    var elem = '<' + tag;
+
+    if (attr1)
+        elem += ' ' + attr1 + '="' + val1 + '"';
+
+    if (attr2)
+        elem += ' ' + attr2 + '="' + val2 + '"';
+
+    elem += '/>';
+
+    res.emptyLineIfNeeded();
+    res.line(elem);
+};
+
+// Add property.
+$generatorXml.property = function (res, obj, propName, setterName, dflt) {
+    if ($commonUtils.isDefined(obj)) {
+        var val = obj[propName];
+
+        if ($commonUtils.isDefinedAndNotEmpty(val)) {
+            var hasDflt = $commonUtils.isDefined(dflt);
+
+            // Add to result if no default provided or value not equals to default.
+            if (!hasDflt || (hasDflt && val != dflt)) {
+                $generatorXml.element(res, 'property', 'name', setterName ? setterName : propName, 'value', $generatorXml.escape(val));
+
+                return true;
+            }
+        }
+    }
+
+    return false;
+};
+
+// Add property for class name.
+$generatorXml.classNameProperty = function (res, obj, propName) {
+    var val = obj[propName];
+
+    if ($commonUtils.isDefined(val))
+        $generatorXml.element(res, 'property', 'name', propName, 'value', $dataStructures.fullClassName(val));
+};
+
+// Add list property.
+$generatorXml.listProperty = function (res, obj, propName, listType, rowFactory) {
+    var val = obj[propName];
+
+    if (val && val.length > 0) {
+        res.emptyLineIfNeeded();
+
+        if (!listType)
+            listType = 'list';
+
+        if (!rowFactory)
+            rowFactory = function (val) {
+                return '<value>' + $generatorXml.escape(val) + '</value>'
+            };
+
+        res.startBlock('<property name="' + propName + '">');
+        res.startBlock('<' + listType + '>');
+
+        _.forEach(val, function(v) {
+            res.line(rowFactory(v));
+        });
+
+        res.endBlock('</' + listType + '>');
+        res.endBlock('</property>');
+
+        res.needEmptyLine = true;
+    }
+};
+
+// Add array property
+$generatorXml.arrayProperty = function (res, obj, propName, descr, rowFactory) {
+    var val = obj[propName];
+
+    if (val && val.length > 0) {
+        res.emptyLineIfNeeded();
+
+        if (!rowFactory)
+            rowFactory = function (val) {
+                return '<bean class="' + val + '"/>';
+            };
+
+        res.startBlock('<property name="' + propName + '">');
+        res.startBlock('<list>');
+
+        _.forEach(val, function (v) {
+            res.append(rowFactory(v))
+        });
+
+        res.endBlock('</list>');
+        res.endBlock('</property>');
+    }
+};
+
+// Add bean property.
+$generatorXml.beanProperty = function (res, bean, beanPropName, desc, createBeanAlthoughNoProps) {
+    var props = desc.fields;
+
+    if (bean && $commonUtils.hasProperty(bean, props)) {
+        res.startSafeBlock();
+
+        res.emptyLineIfNeeded();
+        res.startBlock('<property name="' + beanPropName + '">');
+        res.startBlock('<bean class="' + desc.className + '">');
+
+        var hasData = false;
+
+        _.forIn(props, function(descr, propName) {
+            if (props.hasOwnProperty(propName)) {
+                if (descr) {
+                    switch (descr.type) {
+                        case 'list':
+                            $generatorXml.listProperty(res, bean, propName, descr.setterName);
+
+                            break;
+
+                        case 'array':
+                            $generatorXml.arrayProperty(res, bean, propName, descr);
+
+                            break;
+
+                        case 'propertiesAsList':
+                            var val = bean[propName];
+
+                            if (val && val.length > 0) {
+                                res.startBlock('<property name="' + propName + '">');
+                                res.startBlock('<props>');
+
+                                _.forEach(val, function(nameAndValue) {
+                                    var eqIndex = nameAndValue.indexOf('=');
+                                    if (eqIndex >= 0) {
+                                        res.line('<prop key="' + $generatorXml.escape(nameAndValue.substring(0, eqIndex)) + '">' +
+                                            $generatorXml.escape(nameAndValue.substr(eqIndex + 1)) + '</prop>');
+                                    }
+                                });
+
+                                res.endBlock('</props>');
+                                res.endBlock('</property>');
+
+                                hasData = true;
+                            }
+
+                            break;
+
+                        case 'bean':
+                            if ($commonUtils.isDefinedAndNotEmpty(bean[propName])) {
+                                res.startBlock('<property name="' + propName + '">');
+                                res.line('<bean class="' + bean[propName] + '"/>');
+                                res.endBlock('</property>');
+
+                                hasData = true;
+                            }
+
+                            break;
+
+                        default:
+                            if ($generatorXml.property(res, bean, propName, descr.setterName, descr.dflt))
+                                hasData = true;
+                    }
+                }
+                else
+                    if ($generatorXml.property(res, bean, propName))
+                        hasData = true;
+            }
+        });
+
+        res.endBlock('</bean>');
+        res.endBlock('</property>');
+
+        if (!hasData)
+            res.rollbackSafeBlock();
+    }
+    else if (createBeanAlthoughNoProps) {
+        res.emptyLineIfNeeded();
+        res.line('<property name="' + beanPropName + '">');
+        res.line('    <bean class="' + desc.className + '"/>');
+        res.line('</property>');
+    }
+};
+
+// Generate eviction policy.
+$generatorXml.evictionPolicy = function (res, evtPlc, propName) {
+    if (evtPlc && evtPlc.kind) {
+        $generatorXml.beanProperty(res, evtPlc[evtPlc.kind.toUpperCase()], propName,
+            $generatorCommon.EVICTION_POLICIES[evtPlc.kind], true);
+    }
+};
+
+// Generate discovery.
+$generatorXml.clusterGeneral = function (cluster, res) {
+    if (!res)
+        res = $generatorCommon.builder();
+
+    $generatorXml.property(res, cluster, 'name', 'gridName');
+
+    if (cluster.discovery) {
+        res.startBlock('<property name="discoverySpi">');
+        res.startBlock('<bean class="org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi">');
+        res.startBlock('<property name="ipFinder">');
+
+        var d = cluster.discovery;
+
+        switch (d.kind) {
+            case 'Multicast':
+                res.startBlock('<bean class="org.apache.ignite.spi.discovery.tcp.ipfinder.multicast.TcpDiscoveryMulticastIpFinder">');
+
+                if (d.Multicast) {
+                    $generatorXml.property(res, d.Multicast, 'multicastGroup');
+                    $generatorXml.property(res, d.Multicast, 'multicastPort');
+                    $generatorXml.property(res, d.Multicast, 'responseWaitTime');
+                    $generatorXml.property(res, d.Multicast, 'addressRequestAttempts');
+                    $generatorXml.property(res, d.Multicast, 'localAddress');
+                    $generatorXml.listProperty(res, d.Multicast, 'addresses');
+                }
+
+                res.endBlock('</bean>');
+
+                break;
+
+            case 'Vm':
+                res.startBlock('<bean class="org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder">');
+
+                if (d.Vm) {
+                    $generatorXml.listProperty(res, d.Vm, 'addresses');
+                }
+
+                res.endBlock('</bean>');
+
+                break;
+
+            case 'S3':
+                res.startBlock('<bean class="org.apache.ignite.spi.discovery.tcp.ipfinder.s3.TcpDiscoveryS3IpFinder">');
+
+                if (d.S3) {
+                    if (d.S3.bucketName)
+                        res.line('<property name="bucketName" value="' + $generatorXml.escape(d.S3.bucketName) + '" />');
+                }
+
+                res.endBlock('</bean>');
+
+                break;
+
+            case 'Cloud':
+                res.startBlock('<bean class="org.apache.ignite.spi.discovery.tcp.ipfinder.cloud.TcpDiscoveryCloudIpFinder">');
+
+                if (d.Cloud) {
+                    $generatorXml.property(res, d.Cloud, 'credential');
+                    $generatorXml.property(res, d.Cloud, 'credentialPath');
+                    $generatorXml.property(res, d.Cloud, 'identity');
+                    $generatorXml.property(res, d.Cloud, 'provider');
+                    $generatorXml.listProperty(res, d.Cloud, 'regions');
+                    $generatorXml.listProperty(res, d.Cloud, 'zones');
+                }
+
+                res.endBlock('</bean>');
+
+                break;
+
+            case 'GoogleStorage':
+                res.startBlock('<bean class="org.apache.ignite.spi.discovery.tcp.ipfinder.gce.TcpDiscoveryGoogleStorageIpFinder">');
+
+                if (d.GoogleStorage) {
+                    $generatorXml.property(res, d.GoogleStorage, 'projectName');
+                    $generatorXml.property(res, d.GoogleStorage, 'bucketName');
+                    $generatorXml.property(res, d.GoogleStorage, 'serviceAccountP12FilePath');
+                    $generatorXml.property(res, d.GoogleStorage, 'serviceAccountId');
+                }
+
+                res.endBlock('</bean>');
+
+                break;
+
+            case 'Jdbc':
+                res.startBlock('<bean class="org.apache.ignite.spi.discovery.tcp.ipfinder.jdbc.TcpDiscoveryJdbcIpFinder">');
+
+                if (d.Jdbc) {
+                    res.line('<property name="initSchema" value="' + ($commonUtils.isDefined(d.Jdbc.initSchema) && d.Jdbc.initSchema) + '"/>');
+                }
+
+                res.endBlock('</bean>');
+
+                break;
+
+            case 'SharedFs':
+                res.startBlock('<bean class="org.apache.ignite.spi.discovery.tcp.ipfinder.sharedfs.TcpDiscoverySharedFsIpFinder">');
+
+                if (d.SharedFs) {
+                    $generatorXml.property(res, d.SharedFs, 'path');
+                }
+
+                res.endBlock('</bean>');
+
+                break;
+
+            default:
+                throw "Unknown discovery kind: " + d.kind;
+        }
+
+        res.endBlock('</property>');
+
+        $generatorXml.clusterDiscovery(d, res);
+
+        res.endBlock('</bean>');
+        res.endBlock('</property>');
+
+        res.needEmptyLine = true;
+    }
+
+    return res;
+};
+
+// Generate atomics group.
+$generatorXml.clusterAtomics = function (cluster, res) {
+    if (!res)
+        res = $generatorCommon.builder();
+
+    var atomics = cluster.atomicConfiguration;
+
+    if ($commonUtils.hasAtLeastOneProperty(atomics, ['cacheMode', 'atomicSequenceReserveSize', 'backups'])) {
+        res.startSafeBlock();
+
+        res.emptyLineIfNeeded();
+
+        res.startBlock('<property name="atomicConfiguration">');
+        res.startBlock('<bean class="org.apache.ignite.configuration.AtomicConfiguration">');
+
+        var cacheMode = atomics.cacheMode ? atomics.cacheMode : 'PARTITIONED';
+
+        var hasData = cacheMode != 'PARTITIONED';
+
+        $generatorXml.property(res, atomics, 'cacheMode');
+
+        hasData = $generatorXml.property(res, atomics, 'atomicSequenceReserveSize') || hasData;
+
+        if (cacheMode == 'PARTITIONED')
+            hasData = $generatorXml.property(res, atomics, 'backups') || hasData;
+
+        res.endBlock('</bean>');
+        res.endBlock('</property>');
+
+        res.needEmptyLine = true;
+
+        if (!hasData)
+            res.rollbackSafeBlock();
+    }
+
+    return res;
+};
+
+// Generate communication group.
+$generatorXml.clusterCommunication = function (cluster, res) {
+    if (!res)
+        res = $generatorCommon.builder();
+
+    $generatorXml.beanProperty(res, cluster.communication, 'communicationSpi', $generatorCommon.COMMUNICATION_CONFIGURATION);
+
+    $generatorXml.property(res, cluster, 'networkTimeout', undefined, 5000);
+    $generatorXml.property(res, cluster, 'networkSendRetryDelay', undefined, 1000);
+    $generatorXml.property(res, cluster, 'networkSendRetryCount', undefined, 3);
+    $generatorXml.property(res, cluster, 'segmentCheckFrequency');
+    $generatorXml.property(res, cluster, 'waitForSegmentOnStart', null, false);
+    $generatorXml.property(res, cluster, 'discoveryStartupDelay', undefined, 600000);
+
+    res.needEmptyLine = true;
+
+    return res;
+};
+
+/**
+ * XML generator for cluster's REST access configuration.
+ *
+ * @param cluster Cluster to get REST configuration.
+ * @param res Optional configuration presentation builder object.
+ * @returns Configuration presentation builder object
+ */
+$generatorXml.clusterConnector = function(cluster, res) {
+    if (!res)
+        res = $generatorCommon.builder();
+
+    if ($commonUtils.isDefined(cluster.connector) && cluster.connector.enabled) {
+        var cfg = _.cloneDeep($generatorCommon.CONNECTOR_CONFIGURATION);
+
+        if (cluster.connector.sslEnabled) {
+            cfg.fields.sslClientAuth = {dflt: false};
+            cfg.fields.sslFactory = {type: 'bean'};
+        }
+
+        $generatorXml.beanProperty(res, cluster.connector, 'connectorConfiguration', cfg, true);
+
+        res.needEmptyLine = true;
+    }
+
+    return res;
+};
+
+// Generate deployment group.
+$generatorXml.clusterDeployment = function (cluster, res) {
+    if (!res)
+        res = $generatorCommon.builder();
+
+    if ($generatorXml.property(res, cluster, 'deploymentMode', null, 'SHARED'))
+        res.needEmptyLine = true;
+
+    var p2pEnabled = cluster.peerClassLoadingEnabled;
+
+    if ($commonUtils.isDefined(p2pEnabled)) {
+        $generatorXml.property(res, cluster, 'peerClassLoadingEnabled', null, false);
+
+        if (p2pEnabled) {
+            $generatorXml.property(res, cluster, 'peerClassLoadingMissedResourcesCacheSize');
+            $generatorXml.property(res, cluster, 'peerClassLoadingThreadPoolSize');
+            $generatorXml.listProperty(res, cluster, 'peerClassLoadingLocalClassPathExclude');
+        }
+
+        res.needEmptyLine = true;
+    }
+
+    return res;
+};
+
+// Generate discovery group.
+$generatorXml.clusterDiscovery = function (disco, res) {
+    if (!res)
+        res = $generatorCommon.builder();
+
+    $generatorXml.property(res, disco, 'localAddress');
+    $generatorXml.property(res, disco, 'localPort', undefined, 47500);
+    $generatorXml.property(res, disco, 'localPortRange', undefined, 100);
+    if ($commonUtils.isDefinedAndNotEmpty(disco.addressResolver))
+        $generatorXml.beanProperty(res, disco, 'addressResolver', {className: disco.addressResolver}, true);
+    $generatorXml.property(res, disco, 'socketTimeout', undefined, 5000);
+    $generatorXml.property(res, disco, 'ackTimeout', undefined, 5000);
+    $generatorXml.property(res, disco, 'maxAckTimeout', undefined, 600000);
+    $generatorXml.property(res, disco, 'discoNetworkTimeout', 'setNetworkTimeout', 5000);
+    $generatorXml.property(res, disco, 'joinTimeout', undefined, 0);
+    $generatorXml.property(res, disco, 'threadPriority', undefined, 10);
+    $generatorXml.property(res, disco, 'heartbeatFrequency', undefined, 2000);
+    $generatorXml.property(res, disco, 'maxMissedHeartbeats', undefined, 1);
+    $generatorXml.property(res, disco, 'maxMissedClientHeartbeats', undefined, 5);
+    $generatorXml.property(res, disco, 'topHistorySize', undefined, 100);
+    if ($commonUtils.isDefinedAndNotEmpty(disco.listener))
+        $generatorXml.beanProperty(res, disco, 'listener', {className: disco.listener}, true);
+    if ($commonUtils.isDefinedAndNotEmpty(disco.dataExchange))
+        $generatorXml.beanProperty(res, disco, 'dataExchange', {className: disco.dataExchange}, true);
+    if ($commonUtils.isDefinedAndNotEmpty(disco.metricsProvider))
+        $generatorXml.beanProperty(res, disco, 'metricsProvider', {className: disco.metricsProvider}, true);
+    $generatorXml.property(res, disco, 'reconnectCount', undefined, 10);
+    $generatorXml.property(res, disco, 'statisticsPrintFrequency', undefined, 0);
+    $generatorXml.property(res, disco, 'ipFinderCleanFrequency', undefined, 60000);
+    if ($commonUtils.isDefinedAndNotEmpty(disco.authenticator))
+        $generatorXml.beanProperty(res, disco, 'authenticator', {className: disco.authenticator}, true);
+    $generatorXml.property(res, disco, 'forceServerMode', undefined, false);
+    $generatorXml.property(res, disco, 'clientReconnectDisabled', undefined, false);
+
+    res.needEmptyLine = true;
+
+    return res;
+};
+
+// Generate events group.
+$generatorXml.clusterEvents = function (cluster, res) {
+    if (!res)
+        res = $generatorCommon.builder();
+
+    if (cluster.includeEventTypes && cluster.includeEventTypes.length > 0) {
+        res.emptyLineIfNeeded();
+
+        res.startBlock('<property name="includeEventTypes">');
+
+        if (cluster.includeEventTypes.length == 1)
+            res.line('<util:constant static-field="org.apache.ignite.events.EventType.' + cluster.includeEventTypes[0] + '"/>');
+        else {
+            res.startBlock('<list>');
+
+            _.forEach(cluster.includeEventTypes, function(eventGroup, ix) {
+                if (ix > 0)
+                    res.line();
+
+                res.line('<!-- EventType.' + eventGroup + ' -->');
+
+                var eventList = $dataStructures.EVENT_GROUPS[eventGroup];
+
+                _.forEach(eventList, function(event) {
+                    res.line('<util:constant static-field="org.apache.ignite.events.EventType.' + event + '"/>')
+                });
+            });
+
+            res.endBlock('</list>');
+        }
+
+        res.endBlock('</property>');
+
+        res.needEmptyLine = true;
+    }
+
+    return res;
+};
+
+// Generate marshaller group.
+$generatorXml.clusterMarshaller = function (cluster, res) {
+    if (!res)
+        res = $generatorCommon.builder();
+
+    var marshaller = cluster.marshaller;
+
+    if (marshaller && marshaller.kind) {
+        $generatorXml.beanProperty(res, marshaller[marshaller.kind], 'marshaller', $generatorCommon.MARSHALLERS[marshaller.kind], true);
+
+        res.needEmptyLine = true;
+    }
+
+    $generatorXml.property(res, cluster, 'marshalLocalJobs', null, false);
+    $generatorXml.property(res, cluster, 'marshallerCacheKeepAliveTime');
+    $generatorXml.property(res, cluster, 'marshallerCacheThreadPoolSize');
+
+    res.needEmptyLine = true;
+
+    return res;
+};
+
+// Generate metrics group.
+$generatorXml.clusterMetrics = function (cluster, res) {
+    if (!res)
+        res = $generatorCommon.builder();
+
+    $generatorXml.property(res, cluster, 'metricsExpireTime');
+    $generatorXml.property(res, cluster, 'metricsHistorySize');
+    $generatorXml.property(res, cluster, 'metricsLogFrequency');
+    $generatorXml.property(res, cluster, 'metricsUpdateFrequency');
+
+    res.needEmptyLine = true;
+
+    return res;
+};
+
+// Generate swap group.
+$generatorXml.clusterSwap = function (cluster, res) {
+    if (!res)
+        res = $generatorCommon.builder();
+
+    if (cluster.swapSpaceSpi && cluster.swapSpaceSpi.kind == 'FileSwapSpaceSpi') {
+        $generatorXml.beanProperty(res, cluster.swapSpaceSpi.FileSwapSpaceSpi, 'swapSpaceSpi',
+            $generatorCommon.SWAP_SPACE_SPI, true);
+
+        res.needEmptyLine = true;
+    }
+
+    return res;
+};
+
+// Generate time group.
+$generatorXml.clusterTime = function (cluster, res) {
+    if (!res)
+        res = $generatorCommon.builder();
+
+    $generatorXml.property(res, cluster, 'clockSyncSamples');
+    $generatorXml.property(res, cluster, 'clockSyncFrequency');
+    $generatorXml.property(res, cluster, 'timeServerPortBase');
+    $generatorXml.property(res, cluster, 'timeServerPortRange');
+
+    res.needEmptyLine = true;
+
+    return res;
+};
+
+// Generate thread pools group.
+$generatorXml.clusterPools = function (cluster, res) {
+    if (!res)
+        res = $generatorCommon.builder();
+
+    $generatorXml.property(res, cluster, 'publicThreadPoolSize');
+    $generatorXml.property(res, cluster, 'systemThreadPoolSize');
+    $generatorXml.property(res, cluster, 'managementThreadPoolSize');
+    $generatorXml.property(res, cluster, 'igfsThreadPoolSize');
+
+    res.needEmptyLine = true;
+
+    return res;
+};
+
+// Generate transactions group.
+$generatorXml.clusterTransactions = function (cluster, res) {
+    if (!res)
+        res = $generatorCommon.builder();
+
+    $generatorXml.beanProperty(res, cluster.transactionConfiguration, 'transactionConfiguration', $generatorCommon.TRANSACTION_CONFIGURATION);
+
+    res.needEmptyLine = true;
+
+    return res;
+};
+
+/**
+ * XML generator for cluster's SSL configuration.
+ *
+ * @param cluster Cluster to get SSL configuration.
+ * @param res Optional configuration presentation builder object.
+ * @returns Configuration presentation builder object
+ */
+$generatorXml.clusterSsl = function(cluster, res) {
+    if (!res)
+        res = $generatorCommon.builder();
+
+    if (cluster.sslEnabled && $commonUtils.isDefined(cluster.sslContextFactory)) {
+        cluster.sslContextFactory.keyStorePassword =
+            $commonUtils.isDefinedAndNotEmpty(cluster.sslContextFactory.keyStoreFilePath) ? '${ssl.key.storage.password}' : undefined;
+
+        cluster.sslContextFactory.trustStorePassword =
+            $commonUtils.isDefinedAndNotEmpty(cluster.sslContextFactory.trustStoreFilePath) ? '${ssl.trust.storage.password}' : undefined;
+
+        var propsDesc = $commonUtils.isDefinedAndNotEmpty(cluster.sslContextFactory.trustManagers) ?
+            $generatorCommon.SSL_CONFIGURATION_TRUST_MANAGER_FACTORY :
+            $generatorCommon.SSL_CONFIGURATION_TRUST_FILE_FACTORY;
+
+        $generatorXml.beanProperty(res, cluster.sslContextFactory, 'sslContextFactory', propsDesc, true);
+
+        res.needEmptyLine = true;
+    }
+
+    return res;
+};
+
+// Generate cache general group.
+$generatorXml.cacheGeneral = function(cache, res) {
+    if (!res)
+        res = $generatorCommon.builder();
+
+    $generatorXml.property(res, cache, 'name');
+
+    $generatorXml.property(res, cache, 'cacheMode');
+    $generatorXml.property(res, cache, 'atomicityMode');
+
+    if (cache.cacheMode == 'PARTITIONED')
+        $generatorXml.property(res, cache, 'backups');
+
+    $generatorXml.property(res, cache, 'readFromBackup');
+    $generatorXml.property(res, cache, 'copyOnRead');
+    $generatorXml.property(res, cache, 'invalidate');
+
+    res.needEmptyLine = true;
+
+    return res;
+};
+
+// Generate cache memory group.
+$generatorXml.cacheMemory = function(cache, res) {
+    if (!res)
+        res = $generatorCommon.builder();
+
+    $generatorXml.property(res, cache, 'memoryMode');
+    $generatorXml.property(res, cache, 'offHeapMaxMemory');
+
+    res.needEmptyLine = true;
+
+    $generatorXml.evictionPolicy(res, cache.evictionPolicy, 'evictionPolicy');
+
+    res.needEmptyLine = true;
+
+    $generatorXml.property(res, cache, 'swapEnabled');
+    $generatorXml.property(res, cache, 'startSize');
+
+    res.needEmptyLine = true;
+
+    return res;
+};
+
+// Generate cache query & indexing group.
+$generatorXml.cacheQuery = function(cache, res) {
+    if (!res)
+        res = $generatorCommon.builder();
+
+    $generatorXml.property(res, cache, 'sqlOnheapRowCacheSize');
+    $generatorXml.property(res, cache, 'longQueryWarningTimeout');
+
+    if (cache.indexedTypes && cache.indexedTypes.length > 0) {
+        res.startBlock('<property name="indexedTypes">');
+        res.startBlock('<list>');
+
+        _.forEach(cache.indexedTypes, function(pair) {
+            res.line('<value>' + $dataStructures.fullClassName(pair.keyClass) + '</value>');
+            res.line('<value>' + $dataStructures.fullClassName(pair.valueClass) + '</value>');
+        });
+
+        res.endBlock('</list>');
+        res.endBlock('</property>');
+
+        res.needEmptyLine = true;
+    }
+
+    $generatorXml.listProperty(res, cache, 'sqlFunctionClasses');
+
+    $generatorXml.property(res, cache, 'sqlEscapeAll');
+
+    res.needEmptyLine = true;
+
+    return res;
+};
+
+// Generate cache store group.
+$generatorXml.cacheStore = function(cache, res) {
+    if (!res)
+        res = $generatorCommon.builder();
+
+    if (cache.cacheStoreFactory && cache.cacheStoreFactory.kind) {
+        var factoryKind = cache.cacheStoreFactory.kind;
+
+        var storeFactory = cache.cacheStoreFactory[factoryKind];
+
+        if (storeFactory) {
+            if (factoryKind == 'CacheJdbcPojoStoreFactory') {
+                res.startBlock('<property name="cacheStoreFactory">');
+                res.startBlock('<bean class="org.apache.ignite.cache.store.jdbc.CacheJdbcPojoStoreFactory">');
+                res.startBlock('<property name="configuration">');
+                res.startBlock('<bean class="org.apache.ignite.cache.store.jdbc.CacheJdbcPojoStoreConfiguration">');
+
+                $generatorXml.property(res, storeFactory, 'dataSourceBean');
+
+                res.startBlock('<property name="dialect">');
+                res.line('<bean class="' + $generatorCommon.jdbcDialectClassName(storeFactory.dialect) + '"/>');
+                res.endBlock('</property>');
+
+                var metadatas = cache.metadatas;
+
+                if (metadatas && metadatas.length > 0) {
+                    res.startBlock('<property name="types">');
+                    res.startBlock('<list>');
+
+                    _.forEach(metadatas, function (meta) {
+                        res.startBlock('<bean class="org.apache.ignite.cache.store.jdbc.JdbcType">');
+
+                        $generatorXml.classNameProperty(res, meta, 'keyType');
+                        $generatorXml.property(res, meta, 'valueType');
+                        $generatorXml.property(res, meta, 'keepSerialized', null, null, false);
+
+                        res.endBlock('</bean>');
+                    });
+
+                    res.endBlock('</list>');
+                    res.endBlock('</property>');
+                }
+
+                res.endBlock('</bean>');
+                res.endBlock("</property>");
+                res.endBlock('</bean>');
+                res.endBlock("</property>")
+            }
+            else {
+                $generatorXml.beanProperty(res, storeFactory, 'cacheStoreFactory', $generatorCommon.STORE_FACTORIES[factoryKind], true);
+
+                if (storeFactory.dialect) {
+                    if (_.findIndex(res.datasources, function (ds) {
+                            return ds.dataSourceBean == storeFactory.dataSourceBean;
+                        }) < 0) {
+                        res.datasources.push({
+                            dataSourceBean: storeFactory.dataSourceBean,
+                            className: $generatorCommon.DATA_SOURCES[storeFactory.dialect],
+                            dialect: storeFactory.dialect
+                        });
+                    }
+                }
+            }
+
+            res.needEmptyLine = true;
+        }
+    }
+
+    $generatorXml.property(res, cache, 'loadPreviousValue');
+    $generatorXml.property(res, cache, 'readThrough');
+    $generatorXml.property(res, cache, 'writeThrough');
+
+    res.needEmptyLine = true;
+
+    $generatorXml.property(res, cache, 'writeBehindEnabled');
+    $generatorXml.property(res, cache, 'writeBehindBatchSize');
+    $generatorXml.property(res, cache, 'writeBehindFlushSize');
+    $generatorXml.property(res, cache, 'writeBehindFlushFrequency');
+    $generatorXml.property(res, cache, 'writeBehindFlushThreadCount');
+
+    res.needEmptyLine = true;
+
+    return res;
+};
+
+// Generate cache concurrency group.
+$generatorXml.cacheConcurrency = function(cache, res) {
+    if (!res)
+        res = $generatorCommon.builder();
+
+    $generatorXml.property(res, cache, 'maxConcurrentAsyncOperations');
+    $generatorXml.property(res, cache, 'defaultLockTimeout');
+    $generatorXml.property(res, cache, 'atomicWriteOrderMode');
+    $generatorXml.property(res, cache, 'writeSynchronizationMode');
+
+    res.needEmptyLine = true;
+
+    return res;
+};
+
+// Generate cache rebalance group.
+$generatorXml.cacheRebalance = function(cache, res) {
+    if (!res)
+        res = $generatorCommon.builder();
+
+    if (cache.cacheMode != 'LOCAL') {
+        $generatorXml.property(res, cache, 'rebalanceMode');
+        $generatorXml.property(res, cache, 'rebalanceThreadPoolSize');
+        $generatorXml.property(res, cache, 'rebalanceBatchSize');
+        $generatorXml.property(res, cache, 'rebalanceOrder');
+        $generatorXml.property(res, cache, 'rebalanceDelay');
+        $generatorXml.property(res, cache, 'rebalanceTimeout');
+        $generatorXml.property(res, cache, 'rebalanceThrottle');
+
+        res.needEmptyLine = true;
+    }
+
+    if (cache.igfsAffinnityGroupSize) {
+        res.startBlock('<property name="affinityMapper">');
+        res.startBlock('<bean class="org.apache.ignite.igfs.IgfsGroupDataBlocksKeyMapper">');
+        res.line('<constructor-arg value="' + cache.igfsAffinnityGroupSize + '"/>');
+        res.endBlock('</bean>');
+        res.endBlock('</property>');
+    }
+
+    return res;
+};
+
+// Generate cache server near cache group.
+$generatorXml.cacheServerNearCache = function(cache, res) {
+    if (!res)
+        res = $generatorCommon.builder();
+
+    if (cache.cacheMode == 'PARTITIONED' && cache.nearCacheEnabled) {
+        res.emptyLineIfNeeded();
+
+        res.startBlock('<property name="nearConfiguration">');
+        res.startBlock('<bean class="org.apache.ignite.configuration.NearCacheConfiguration">');
+
+        if (cache.nearConfiguration) {
+            if (cache.nearConfiguration.nearStartSize)
+                $generatorXml.property(res, cache.nearConfiguration, 'nearStartSize');
+
+
+            $generatorXml.evictionPolicy(res, cache.nearConfiguration.nearEvictionPolicy, 'nearEvictionPolicy');
+        }
+
+
+
+        res.endBlock('</bean>');
+        res.endBlock('</property>');
+    }
+
+    res.needEmptyLine = true;
+
+    return res;
+};
+
+// Generate cache statistics group.
+$generatorXml.cacheStatistics = function(cache, res) {
+    if (!res)
+        res = $generatorCommon.builder();
+
+    $generatorXml.property(res, cache, 'statisticsEnabled');
+    $generatorXml.property(res, cache, 'managementEnabled');
+
+    res.needEmptyLine = true;
+
+    return res;
+};
+
+// Generate metadata query fields.
+$generatorXml.metadataQueryFields = function (res, meta) {
+    var fields = meta.fields;
+
+    if (fields && fields.length > 0) {
+        res.emptyLineIfNeeded();
+
+        res.startBlock('<property name="fields">');
+        res.startBlock('<map>');
+
+        _.forEach(fields, function (field) {
+            $generatorXml.element(res, 'entry', 'key', field.name.toUpperCase(), 'value', $dataStructures.fullClassName(field.className));
+        });
+
+        res.endBlock('</map>');
+        res.endBlock('</property>');
+
+        res.needEmptyLine = true;
+    }
+};
+
+// Generate metadata query fields.
+$generatorXml.metadataQueryAliases = function (res, meta) {
+    var aliases = meta.aliases;
+
+    if (aliases && aliases.length > 0) {
+        res.emptyLineIfNeeded();
+
+        res.startBlock('<property name="aliases">');
+        res.startBlock('<map>');
+
+        _.forEach(aliases, function (alias) {
+            $generatorXml.element(res, 'entry', 'key', alias.field, 'value', alias.alias);
+        });
+
+        res.endBlock('</map>');
+        res.endBlock('</property>');
+
+        res.needEmptyLine = true;
+    }
+};
+
+// Generate metadata indexes.
+$generatorXml.metadataQueryIndexes = function (res, meta) {
+    var indexes = meta.indexes;
+
+    if (indexes && indexes.length > 0) {
+        res.emptyLineIfNeeded();
+
+        res.startBlock('<property name="indexes">');
+        res.startBlock('<list>');
+
+        _.forEach(indexes, function (index) {
+            res.startBlock('<bean class="org.apache.ignite.cache.store.QueryEntityIndex">');
+
+            $generatorXml.property(res, index, 'name');
+            $generatorXml.property(res, index, 'type');
+
+            var fields = index.fields;
+
+            if (fields && fields.length > 0) {
+                res.startBlock('<property name="fields">');
+                res.startBlock('<map>');
+
+                _.forEach(fields, function (field) {
+                    $generatorXml.element(res, 'entry', 'key', field.name, 'value', field.direction);
+                });
+
+                res.endBlock('</map>');
+                res.endBlock('</property>');
+            }
+
+            res.endBlock('</bean>');
+        });
+
+        res.endBlock('</list>');
+        res.endBlock('</property>');
+
+        res.needEmptyLine = true;
+    }
+};
+
+// Generate metadata db fields.
+$generatorXml.metadataDatabaseFields = function (res, meta, fieldProp) {
+    var fields = meta[fieldProp];
+
+    if (fields && fields.length > 0) {
+        res.emptyLineIfNeeded();
+
+        res.startBlock('<property name="' + fieldProp + '">');
+
+        res.startBlock('<list>');
+
+        _.forEach(fields, function (field) {
+            res.startBlock('<bean class="org.apache.ignite.cache.store.jdbc.JdbcTypeField">');
+
+            $generatorXml.property(res, field, 'databaseName');
+
+            res.startBlock('<property name="databaseType">');
+            res.line('<util:constant static-field="java.sql.Types.' + field.databaseType + '"/>');
+            res.endBlock('</property>');
+
+            $generatorXml.property(res, field, 'javaName');
+
+            $generatorXml.classNameProperty(res, field, 'javaType');
+
+            res.endBlock('</bean>');
+        });
+
+        res.endBlock('</list>');
+        res.endBlock('</property>');
+
+        res.needEmptyLine = true;
+    }
+};
+
+// Generate metadata general group.
+$generatorXml.metadataGeneral = function(meta, res) {
+    if (!res)
+        res = $generatorCommon.builder();
+
+    $generatorXml.classNameProperty(res, meta, 'keyType');
+    $generatorXml.property(res, meta, 'valueType');
+
+    res.needEmptyLine = true;
+
+    return res;
+};
+
+// Generate metadata for query group.
+$generatorXml.metadataQuery = function(meta, res) {
+    if (!res)
+        res = $generatorCommon.builder();
+
+    $generatorXml.metadataQueryFields(res, meta);
+
+    $generatorXml.metadataQueryAliases(res, meta);
+
+    $generatorXml.metadataQueryIndexes(res, meta);
+
+    res.needEmptyLine = true;
+
+    return res;
+};
+
+// Generate metadata for store group.
+$generatorXml.metadataStore = function(meta, res) {
+    if (!res)
+        res = $generatorCommon.builder();
+
+    $generatorXml.property(res, meta, 'databaseSchema');
+    $generatorXml.property(res, meta, 'databaseTable');
+    $generatorXml.property(res, meta, 'keepSerialized');
+
+    res.needEmptyLine = true;
+
+    if (!$dataStructures.isJavaBuildInClass(meta.keyType))
+        $generatorXml.metadataDatabaseFields(res, meta, 'keyFields');
+
+    $generatorXml.metadataDatabaseFields(res, meta, 'valueFields');
+
+    res.needEmptyLine = true;
+
+    return res;
+};
+
+$generatorXml.cacheQueryMetadata = function(meta, res) {
+    if (!res)
+        res = $generatorCommon.builder();
+
+    res.startBlock('<bean class="org.apache.ignite.cache.store.QueryEntity">');
+
+    $generatorXml.classNameProperty(res, meta, 'keyType');
+    $generatorXml.property(res, meta, 'valueType');
+
+    $generatorXml.metadataQuery(meta, res);
+
+    res.endBlock('</bean>');
+
+    res.needEmptyLine = true;
+
+    return res;
+};
+
+// Generate cache type metadata configs.
+$generatorXml.cacheMetadatas = function(metadatas, res) {
+    if (!res)
+        res = $generatorCommon.builder();
+
+    if (metadatas && metadatas.length > 0) {
+        res.emptyLineIfNeeded();
+
+        res.startBlock('<property name="queryEntities">');
+        res.startBlock('<list>');
+
+        _.forEach(metadatas, function (meta) {
+            $generatorXml.cacheQueryMetadata(meta, res);
+        });
+
+        res.endBlock('</list>');
+        res.endBlock('</property>');
+    }
+
+    return res;
+};
+
+// Generate cache configs.
+$generatorXml.cache = function(cache, res) {
+    if (!res)
+        res = $generatorCommon.builder();
+
+    res.startBlock('<bean class="org.apache.ignite.configuration.CacheConfiguration">');
+
+    $generatorXml.cacheGeneral(cache, res);
+
+    $generatorXml.cacheMemory(cache, res);
+
+    $generatorXml.cacheQuery(cache, res);
+
+    $generatorXml.cacheStore(cache, res);
+
+    $generatorXml.cacheConcurrency(cache, res);
+
+    $generatorXml.cacheRebalance(cache, res);
+
+    $generatorXml.cacheServerNearCache(cache, res);
+
+    $generatorXml.cacheStatistics(cache, res);
+
+    $generatorXml.cacheMetadatas(cache.metadatas, res);
+
+    res.endBlock('</bean>');
+
+    return res;
+};
+
+// Generate caches configs.
+$generatorXml.clusterCaches = function(caches, igfss, res) {
+    if (!res)
+        res = $generatorCommon.builder();
+
+    if ((caches && caches.length > 0) || (igfss && igfss.length > 0)) {
+        res.emptyLineIfNeeded();
+
+        res.startBlock('<property name="cacheConfiguration">');
+        res.startBlock('<list>');
+
+        _.forEach(caches, function(cache) {
+            $generatorXml.cache(cache, res);
+
+            res.needEmptyLine = true;
+        });
+
+        _.forEach(igfss, function(igfs) {
+            $generatorXml.cache($generatorCommon.igfsDataCache(igfs), res);
+
+            res.needEmptyLine = true;
+
+            $generatorXml.cache($generatorCommon.igfsMetaCache(igfs), res);
+
+            res.needEmptyLine = true;
+        });
+
+        res.endBlock('</list>');
+        res.endBlock('</property>');
+
+        res.needEmptyLine = true;
+    }
+
+    return res;
+};
+
+// Generate IGFSs configs.
+$generatorXml.igfss = function(igfss, res) {
+    if (!res)
+        res = $generatorCommon.builder();
+
+    if ($commonUtils.isDefinedAndNotEmpty(igfss)) {
+        res.emptyLineIfNeeded();
+
+        res.startBlock('<property name="fileSystemConfiguration">');
+        res.startBlock('<list>');
+
+        _.forEach(igfss, function(igfs) {
+            res.startBlock('<bean class="org.apache.ignite.configuration.FileSystemConfiguration">');
+
+            $generatorXml.igfsGeneral(igfs, res);
+            $generatorXml.igfsIPC(igfs, res);
+            $generatorXml.igfsFragmentizer(igfs, res);
+            $generatorXml.igfsDualMode(igfs, res);
+            $generatorXml.igfsSecondFS(igfs, res);
+            $generatorXml.igfsMisc(igfs, res);
+
+            res.endBlock('</bean>');
+
+            res.needEmptyLine = true;
+        });
+
+        res.endBlock('</list>');
+        res.endBlock('</property>');
+
+        res.needEmptyLine = true;
+    }
+
+    return res;
+};
+
+// Generate IGFS IPC configuration.
+$generatorXml.igfsIPC = function(igfs, res) {
+    if (!res)
+        res = $generatorCommon.builder();
+
+    if (igfs.ipcEndpointEnabled) {
+        $generatorXml.beanProperty(res, igfs.ipcEndpointConfiguration, 'ipcEndpointConfiguration', $generatorCommon.IGFS_IPC_CONFIGURATION, true);
+
+        res.needEmptyLine = true;
+    }
+
+    return res;
+};
+
+// Generate IGFS fragmentizer configuration.
+$generatorXml.igfsFragmentizer = function(igfs, res) {
+    if (!res)
+        res = $generatorCommon.builder();
+
+    if (igfs.fragmentizerEnabled) {
+        $generatorXml.property(res, igfs, 'fragmentizerConcurrentFiles', undefined, 0);
+        $generatorXml.property(res, igfs, 'fragmentizerThrottlingBlockLength', undefined, 16777216);
+        $generatorXml.property(res, igfs, 'fragmentizerThrottlingDelay', undefined, 200);
+
+        res.needEmptyLine = true;
+    }
+    else
+        $generatorXml.property(res, igfs, 'fragmentizerEnabled');
+
+    return res;
+};
+
+// Generate IGFS dual mode configuration.
+$generatorXml.igfsDualMode = function(igfs, res) {
+    if (!res)
+        res = $generatorCommon.builder();
+
+    $generatorXml.property(res, igfs, 'dualModeMaxPendingPutsSize', undefined, 0);
+
+    if ($commonUtils.isDefinedAndNotEmpty(igfs.dualModePutExecutorService)) {
+        res.startBlock('<property name="dualModePutExecutorService">');
+        res.line('<bean class="' + igfs.dualModePutExecutorService + '"/>');
+        res.endBlock('</property>');
+    }
+
+    $generatorXml.property(res, igfs, 'dualModePutExecutorServiceShutdown', undefined, false);
+
+    res.needEmptyLine = true;
+
+    return res;
+};
+
+$generatorXml.igfsSecondFS = function(igfs, res) {
+    if (!res)
+        res = $generatorCommon.builder();
+
+    if (igfs.secondaryFileSystemEnabled) {
+        var secondFs = igfs.secondaryFileSystem || {};
+
+        res.startBlock('<property name="secondaryFileSystem">');
+
+        res.startBlock('<bean class="org.apache.ignite.hadoop.fs.IgniteHadoopIgfsSecondaryFileSystem">');
+
+        var nameDefined = $commonUtils.isDefinedAndNotEmpty(secondFs.userName);
+        var cfgDefined = $commonUtils.isDefinedAndNotEmpty(secondFs.cfgPath);
+
+        if ($commonUtils.isDefinedAndNotEmpty(secondFs.uri))
+            res.line('<constructor-arg index="0" value="' + secondFs.uri + '"/>');
+        else {
+            res.startBlock('<constructor-arg index="0">');
+            res.line('<null/>');
+            res.endBlock('</constructor-arg>');
+        }
+
+        if (cfgDefined || nameDefined) {
+            if (cfgDefined)
+                res.line('<constructor-arg index="1" value="' + secondFs.cfgPath + '"/>');
+            else {
+                res.startBlock('<constructor-arg index="1">');
+                res.line('<null/>');
+                res.endBlock('</constructor-arg>');
+            }
+        }
+
+        if ($commonUtils.isDefinedAndNotEmpty(secondFs.userName))
+            res.line('<constructor-arg index="2" value="' + secondFs.userName + '"/>');
+
+        res.endBlock('</bean>');
+        res.endBlock('</property>');
+
+        res.needEmptyLine = true;
+    }
+
+    return res;
+};
+
+// Generate IGFS general configuration.
+$generatorXml.igfsGeneral = function(igfs, res) {
+    if (!res)
+        res = $generatorCommon.builder();
+
+    if ($commonUtils.isDefinedAndNotEmpty(igfs.name)) {
+        igfs.dataCacheName = $generatorCommon.igfsDataCache(igfs).name;
+        igfs.metaCacheName = $generatorCommon.igfsMetaCache(igfs).name;
+
+        $generatorXml.property(res, igfs, 'name');
+        $generatorXml.property(res, igfs, 'dataCacheName');
+        $generatorXml.property(res, igfs, 'metaCacheName');
+
+        res.needEmptyLine = true;
+    }
+
+    return res;
+};
+
+// Generate IGFS misc configuration.
+$generatorXml.igfsMisc = function(igfs, res) {
+    if (!res)
+        res = $generatorCommon.builder();
+
+    $generatorXml.property(res, igfs, 'blockSize', undefined, 65536);
+    $generatorXml.property(res, igfs, 'streamBufferSize', undefined, 65536);
+    $generatorXml.property(res, igfs, 'defaultMode', undefined, "DUAL_ASYNC");
+    $generatorXml.property(res, igfs, 'maxSpaceSize', undefined, 0);
+    $generatorXml.property(res, igfs, 'maximumTaskRangeLength', undefined, 0);
+    $generatorXml.property(res, igfs, 'managementPort', undefined, 11400);
+
+    res.needEmptyLine = true;
+
+    if (igfs.pathModes && igfs.pathModes.length > 0) {
+        res.startBlock('<property name="pathModes">');
+        res.startBlock('<map>');
+
+        _.forEach(igfs.pathModes, function(pair) {
+            res.line('<entry key="' + pair.path + '" value="' + pair.mode + '"/>');
+        });
+
+        res.endBlock('</map>');
+        res.endBlock('</property>');
+
+        res.needEmptyLine = true;
+    }
+
+    $generatorXml.property(res, igfs, 'perNodeBatchSize', undefined, 100);
+    $generatorXml.property(res, igfs, 'perNodeParallelBatchCount', undefined, 8);
+    $generatorXml.property(res, igfs, 'prefetchBlocks', undefined, 0);
+    $generatorXml.property(res, igfs, 'sequentialReadsBeforePrefetch', undefined, 0);
+    $generatorXml.property(res, igfs, 'trashPurgeTimeout', undefined, 1000);
+
+    return res;
+};
+
+// Generate cluster config.
+$generatorXml.cluster = function (cluster, clientNearCfg) {
+    if (cluster) {
+        var res = $generatorCommon.builder();
+
+        res.deep = 1;
+
+        if (clientNearCfg) {
+            res.startBlock('<bean id="nearCacheBean" class="org.apache.ignite.configuration.NearCacheConfiguration">');
+
+            if (clientNearCfg.nearStartSize)
+                $generatorXml.property(res, clientNearCfg, 'nearStartSize');
+
+            if (clientNearCfg.nearEvictionPolicy && clientNearCfg.nearEvictionPolicy.kind)
+                $generatorXml.evictionPolicy(res, clientNearCfg.nearEvictionPolicy, 'nearEvictionPolicy');
+
+            res.endBlock('</bean>');
+
+            res.line();
+        }
+
+        // Generate Ignite Configuration.
+        res.startBlock('<bean class="org.apache.ignite.configuration.IgniteConfiguration">');
+
+        if (clientNearCfg) {
+            res.line('<property name="clientMode" value="true" />');
+
+            res.line();
+        }
+
+        $generatorXml.clusterGeneral(cluster, res);
+
+        $generatorXml.clusterAtomics(cluster, res);
+
+        $generatorXml.clusterCommunication(cluster, res);
+
+        $generatorXml.clusterConnector(cluster, res);
+
+        $generatorXml.clusterDeployment(cluster, res);
+
+        $generatorXml.clusterEvents(cluster, res);
+
+        $generatorXml.clusterMarshaller(cluster, res);
+
+        $generatorXml.clusterMetrics(cluster, res);
+
+        $generatorXml.clusterSwap(cluster, res);
+
+        $generatorXml.clusterTime(cluster, res);
+
+        $generatorXml.clusterPools(cluster, res);
+
+        $generatorXml.clusterTransactions(cluster, res);
+
+        $generatorXml.clusterCaches(cluster.caches, cluster.igfss, res);
+
+        $generatorXml.clusterSsl(cluster, res);
+
+        $generatorXml.igfss(cluster.igfss, res);
+
+        res.endBlock('</bean>');
+
+        // Build final XML:
+        // 1. Add header.
+        var xml = '<?xml version="1.0" encoding="UTF-8"?>\n\n';
+
+        xml += '<!-- ' + $generatorCommon.mainComment() + ' -->\n';
+        xml += '<beans xmlns="http://www.springframework.org/schema/beans"\n';
+        xml += '       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"\n';
+        xml += '       xmlns:util="http://www.springframework.org/schema/util"\n';
+        xml += '       xsi:schemaLocation="http://www.springframework.org/schema/beans\n';
+        xml += '                           http://www.springframework.org/schema/beans/spring-beans.xsd\n';
+        xml += '                           http://www.springframework.org/schema/util\n';
+        xml += '                           http://www.springframework.org/schema/util/spring-util.xsd">\n';
+
+        // 2. Add external property file
+        if (res.datasources.length > 0 || cluster.sslEnabled) {
+            xml += '    <!-- Load external properties file. -->\n';
+            xml += '    <bean id="placeholderConfig" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">\n';
+            xml += '        <property name="location" value="classpath:secret.properties"/>\n';
+            xml += '    </bean>\n\n';
+        }
+
+        // 3. Add data sources.
+        if (res.datasources.length > 0) {
+            xml += '    <!-- Data source beans will be initialized from external properties file. -->\n';
+
+            _.forEach(res.datasources, function (item) {
+                var beanId = item.dataSourceBean;
+
+                xml += '    <bean id="' + beanId + '" class="' + item.className + '">\n';
+                switch (item.dialect) {
+                    case 'DB2':
+                        xml += '        <property name="serverName" value="${' + beanId + '.jdbc.server_name}" />\n';
+                        xml += '        <property name="portNumber" value="${' + beanId + '.jdbc.port_number}" />\n';
+                        xml += '        <property name="databaseName" value="${' + beanId + '.jdbc.database_name}" />\n';
+                        xml += '        <property name="driverType" value="${' + beanId + '.jdbc.driver_type}" />\n';
+                        break;
+
+                    default:
+                        xml += '        <property name="URL" value="${' + beanId + '.jdbc.url}" />\n';
+                }
+
+                xml += '        <property name="user" value="${' + beanId + '.jdbc.username}" />\n';
+                xml += '        <property name="password" value="${' + beanId + '.jdbc.password}" />\n';
+                xml += '    </bean>\n\n';
+            });
+        }
+
+        // 3. Add main content.
+        xml += res.asString();
+
+        // 4. Add footer.
+        xml += '\n</beans>';
+
+        return xml;
+    }
+
+    return '';
+};

http://git-wip-us.apache.org/repos/asf/ignite/blob/ce945056/modules/control-center-web/src/main/js/public/js/Blob.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/public/js/Blob.js b/modules/control-center-web/src/main/js/public/js/Blob.js
new file mode 100644
index 0000000..bd41a44
--- /dev/null
+++ b/modules/control-center-web/src/main/js/public/js/Blob.js
@@ -0,0 +1,211 @@
+/* Blob.js
+ * A Blob implementation.
+ * 2014-07-24
+ *
+ * By Eli Grey, http://eligrey.com
+ * By Devin Samarin, https://github.com/dsamarin
+ * License: MIT
+ *   See https://github.com/eligrey/Blob.js/blob/master/LICENSE.md
+ */
+
+/*global self, unescape */
+/*jslint bitwise: true, regexp: true, confusion: true, es5: true, vars: true, white: true,
+ plusplus: true */
+
+/*! @source http://purl.eligrey.com/github/Blob.js/blob/master/Blob.js */
+
+(function (view) {
+    "use strict";
+
+    view.URL = view.URL || view.webkitURL;
+
+    if (view.Blob && view.URL) {
+        try {
+            new Blob;
+            return;
+        } catch (e) {}
+    }
+
+    // Internally we use a BlobBuilder implementation to base Blob off of
+    // in order to support older browsers that only have BlobBuilder
+    var BlobBuilder = view.BlobBuilder || view.WebKitBlobBuilder || view.MozBlobBuilder || (function(view) {
+            var
+                get_class = function(object) {
+                    return Object.prototype.toString.call(object).match(/^\[object\s(.*)\]$/)[1];
+                }
+                , FakeBlobBuilder = function BlobBuilder() {
+                    this.data = [];
+                }
+                , FakeBlob = function Blob(data, type, encoding) {
+                    this.data = data;
+                    this.size = data.length;
+                    this.type = type;
+                    this.encoding = encoding;
+                }
+                , FBB_proto = FakeBlobBuilder.prototype
+                , FB_proto = FakeBlob.prototype
+                , FileReaderSync = view.FileReaderSync
+                , FileException = function(type) {
+                    this.code = this[this.name = type];
+                }
+                , file_ex_codes = (
+                    "NOT_FOUND_ERR SECURITY_ERR ABORT_ERR NOT_READABLE_ERR ENCODING_ERR "
+                    + "NO_MODIFICATION_ALLOWED_ERR INVALID_STATE_ERR SYNTAX_ERR"
+                ).split(" ")
+                , file_ex_code = file_ex_codes.length
+                , real_URL = view.URL || view.webkitURL || view
+                , real_create_object_URL = real_URL.createObjectURL
+                , real_revoke_object_URL = real_URL.revokeObjectURL
+                , URL = real_URL
+                , btoa = view.btoa
+                , atob = view.atob
+
+                , ArrayBuffer = view.ArrayBuffer
+                , Uint8Array = view.Uint8Array
+
+                , origin = /^[\w-]+:\/*\[?[\w\.:-]+\]?(?::[0-9]+)?/
+                ;
+            FakeBlob.fake = FB_proto.fake = true;
+            while (file_ex_code--) {
+                FileException.prototype[file_ex_codes[file_ex_code]] = file_ex_code + 1;
+            }
+            // Polyfill URL
+            if (!real_URL.createObjectURL) {
+                URL = view.URL = function(uri) {
+                    var
+                        uri_info = document.createElementNS("http://www.w3.org/1999/xhtml", "a")
+                        , uri_origin
+                        ;
+                    uri_info.href = uri;
+                    if (!("origin" in uri_info)) {
+                        if (uri_info.protocol.toLowerCase() === "data:") {
+                            uri_info.origin = null;
+                        } else {
+                            uri_origin = uri.match(origin);
+                            uri_info.origin = uri_origin && uri_origin[1];
+                        }
+                    }
+                    return uri_info;
+                };
+            }
+            URL.createObjectURL = function(blob) {
+                var
+                    type = blob.type
+                    , data_URI_header
+                    ;
+                if (type === null) {
+                    type = "application/octet-stream";
+                }
+                if (blob instanceof FakeBlob) {
+                    data_URI_header = "data:" + type;
+                    if (blob.encoding === "base64") {
+                        return data_URI_header + ";base64," + blob.data;
+                    } else if (blob.encoding === "URI") {
+                        return data_URI_header + "," + decodeURIComponent(blob.data);
+                    } if (btoa) {
+                        return data_URI_header + ";base64," + btoa(blob.data);
+                    } else {
+                        return data_URI_header + "," + encodeURIComponent(blob.data);
+                    }
+                } else if (real_create_object_URL) {
+                    return real_create_object_URL.call(real_URL, blob);
+                }
+            };
+            URL.revokeObjectURL = function(object_URL) {
+                if (object_URL.substring(0, 5) !== "data:" && real_revoke_object_URL) {
+                    real_revoke_object_URL.call(real_URL, object_URL);
+                }
+            };
+            FBB_proto.append = function(data/*, endings*/) {
+                var bb = this.data;
+                // decode data to a binary string
+                if (Uint8Array && (data instanceof ArrayBuffer || data instanceof Uint8Array)) {
+                    var
+                        str = ""
+                        , buf = new Uint8Array(data)
+                        , i = 0
+                        , buf_len = buf.length
+                        ;
+                    for (; i < buf_len; i++) {
+                        str += String.fromCharCode(buf[i]);
+                    }
+                    bb.push(str);
+                } else if (get_class(data) === "Blob" || get_class(data) === "File") {
+                    if (FileReaderSync) {
+                        var fr = new FileReaderSync;
+                        bb.push(fr.readAsBinaryString(data));
+                    } else {
+                        // async FileReader won't work as BlobBuilder is sync
+                        throw new FileException("NOT_READABLE_ERR");
+                    }
+                } else if (data instanceof FakeBlob) {
+                    if (data.encoding === "base64" && atob) {
+                        bb.push(atob(data.data));
+                    } else if (data.encoding === "URI") {
+                        bb.push(decodeURIComponent(data.data));
+                    } else if (data.encoding === "raw") {
+                        bb.push(data.data);
+                    }
+                } else {
+                    if (typeof data !== "string") {
+                        data += ""; // convert unsupported types to strings
+                    }
+                    // decode UTF-16 to binary string
+                    bb.push(unescape(encodeURIComponent(data)));
+                }
+            };
+            FBB_proto.getBlob = function(type) {
+                if (!arguments.length) {
+                    type = null;
+                }
+                return new FakeBlob(this.data.join(""), type, "raw");
+            };
+            FBB_proto.toString = function() {
+                return "[object BlobBuilder]";
+            };
+            FB_proto.slice = function(start, end, type) {
+                var args = arguments.length;
+                if (args < 3) {
+                    type = null;
+                }
+                return new FakeBlob(
+                    this.data.slice(start, args > 1 ? end : this.data.length)
+                    , type
+                    , this.encoding
+                );
+            };
+            FB_proto.toString = function() {
+                return "[object Blob]";
+            };
+            FB_proto.close = function() {
+                this.size = 0;
+                delete this.data;
+            };
+            return FakeBlobBuilder;
+        }(view));
+
+    view.Blob = function(blobParts, options) {
+        var type = options ? (options.type || "") : "";
+        var builder = new BlobBuilder();
+        if (blobParts) {
+            for (var i = 0, len = blobParts.length; i < len; i++) {
+                if (Uint8Array && blobParts[i] instanceof Uint8Array) {
+                    builder.append(blobParts[i].buffer);
+                }
+                else {
+                    builder.append(blobParts[i]);
+                }
+            }
+        }
+        var blob = builder.getBlob(type);
+        if (!blob.slice && blob.webkitSlice) {
+            blob.slice = blob.webkitSlice;
+        }
+        return blob;
+    };
+
+    var getPrototypeOf = Object.getPrototypeOf || function(object) {
+            return object.__proto__;
+        };
+    view.Blob.prototype = getPrototypeOf(new view.Blob());
+}(typeof self !== "undefined" && self || typeof window !== "undefined" && window || this.content || this));

http://git-wip-us.apache.org/repos/asf/ignite/blob/ce945056/modules/control-center-web/src/main/js/public/js/FileSaver.min.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/public/js/FileSaver.min.js b/modules/control-center-web/src/main/js/public/js/FileSaver.min.js
new file mode 100644
index 0000000..9b1280c
--- /dev/null
+++ b/modules/control-center-web/src/main/js/public/js/FileSaver.min.js
@@ -0,0 +1,2 @@
+/*! @source http://purl.eligrey.com/github/FileSaver.js/blob/master/FileSaver.js */
+var saveAs=saveAs||function(e){"use strict";if(typeof navigator!=="undefined"&&/MSIE [1-9]\./.test(navigator.userAgent)){return}var t=e.document,n=function(){return e.URL||e.webkitURL||e},r=t.createElementNS("http://www.w3.org/1999/xhtml","a"),i="download"in r,o=function(e){var t=new MouseEvent("click");e.dispatchEvent(t)},a=/Version\/[\d\.]+.*Safari/.test(navigator.userAgent),f=e.webkitRequestFileSystem,u=e.requestFileSystem||f||e.mozRequestFileSystem,s=function(t){(e.setImmediate||e.setTimeout)(function(){throw t},0)},c="application/octet-stream",d=0,l=500,w=function(t){var r=function(){if(typeof t==="string"){n().revokeObjectURL(t)}else{t.remove()}};if(e.chrome){r()}else{setTimeout(r,l)}},p=function(e,t,n){t=[].concat(t);var r=t.length;while(r--){var i=e["on"+t[r]];if(typeof i==="function"){try{i.call(e,n||e)}catch(o){s(o)}}}},v=function(e){if(/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)){return new Blob(["\ufeff",e],{type:e.type})}ret
 urn e},y=function(t,s,l){if(!l){t=v(t)}var y=this,m=t.type,S=false,h,R,O=function(){p(y,"writestart progress write writeend".split(" "))},g=function(){if(R&&a&&typeof FileReader!=="undefined"){var r=new FileReader;r.onloadend=function(){var e=r.result;R.location.href="data:attachment/file"+e.slice(e.search(/[,;]/));y.readyState=y.DONE;O()};r.readAsDataURL(t);y.readyState=y.INIT;return}if(S||!h){h=n().createObjectURL(t)}if(R){R.location.href=h}else{var i=e.open(h,"_blank");if(i==undefined&&a){e.location.href=h}}y.readyState=y.DONE;O();w(h)},b=function(e){return function(){if(y.readyState!==y.DONE){return e.apply(this,arguments)}}},E={create:true,exclusive:false},N;y.readyState=y.INIT;if(!s){s="download"}if(i){h=n().createObjectURL(t);r.href=h;r.download=s;setTimeout(function(){o(r);O();w(h);y.readyState=y.DONE});return}if(e.chrome&&m&&m!==c){N=t.slice||t.webkitSlice;t=N.call(t,0,t.size,c);S=true}if(f&&s!=="download"){s+=".download"}if(m===c||f){R=e}if(!u){g();return}d+=t.size;u(e.TEM
 PORARY,d,b(function(e){e.root.getDirectory("saved",E,b(function(e){var n=function(){e.getFile(s,E,b(function(e){e.createWriter(b(function(n){n.onwriteend=function(t){R.location.href=e.toURL();y.readyState=y.DONE;p(y,"writeend",t);w(e)};n.onerror=function(){var e=n.error;if(e.code!==e.ABORT_ERR){g()}};"writestart progress write abort".split(" ").forEach(function(e){n["on"+e]=y["on"+e]});n.write(t);y.abort=function(){n.abort();y.readyState=y.DONE};y.readyState=y.WRITING}),g)}),g)};e.getFile(s,{create:false},b(function(e){e.remove();n()}),b(function(e){if(e.code===e.NOT_FOUND_ERR){n()}else{g()}}))}),g)}),g)},m=y.prototype,S=function(e,t,n){return new y(e,t,n)};if(typeof navigator!=="undefined"&&navigator.msSaveOrOpenBlob){return function(e,t,n){if(!n){e=v(e)}return navigator.msSaveOrOpenBlob(e,t||"download")}}m.abort=function(){var e=this;e.readyState=e.DONE;p(e,"abort")};m.readyState=m.INIT=0;m.WRITING=1;m.DONE=2;m.error=m.onwritestart=m.onprogress=m.onwrite=m.onabort=m.onerror=m.onwr
 iteend=null;return S}(typeof self!=="undefined"&&self||typeof window!=="undefined"&&window||this.content);if(typeof module!=="undefined"&&module.exports){module.exports.saveAs=saveAs}else if(typeof define!=="undefined"&&define!==null&&define.amd!=null){define([],function(){return saveAs})}


[6/7] ignite git commit: IGNITE-1857 Generate configuration zip on client side.

Posted by an...@apache.org.
IGNITE-1857 Generate configuration zip on client side.


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/ce945056
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/ce945056
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/ce945056

Branch: refs/heads/ignite-843-rc1
Commit: ce9450565e93c197e81d0993c3aec3b20a8263a4
Parents: 0a76801
Author: Andrey <an...@gridgain.com>
Authored: Tue Nov 10 13:52:00 2015 +0700
Committer: Andrey <an...@gridgain.com>
Committed: Tue Nov 10 13:52:00 2015 +0700

----------------------------------------------------------------------
 .../main/js/controllers/summary-controller.js   |   55 +-
 .../src/main/js/helpers/data-structures.js      |   10 -
 .../js/helpers/generator/generator-common.js    |  423 ++++
 .../js/helpers/generator/generator-docker.js    |   53 +
 .../main/js/helpers/generator/generator-java.js | 1941 +++++++++++++++++
 .../main/js/helpers/generator/generator-pom.js  |  145 ++
 .../helpers/generator/generator-properties.js   |   99 +
 .../js/helpers/generator/generator-readme.js    |   65 +
 .../main/js/helpers/generator/generator-xml.js  | 1479 +++++++++++++
 .../src/main/js/public/js/Blob.js               |  211 ++
 .../src/main/js/public/js/FileSaver.min.js      |    2 +
 .../src/main/js/public/js/jszip.min.js          |   14 +
 .../js/routes/generator/generator-common.js     |  436 ----
 .../js/routes/generator/generator-docker.js     |   58 -
 .../main/js/routes/generator/generator-java.js  | 1956 ------------------
 .../main/js/routes/generator/generator-pom.js   |  157 --
 .../js/routes/generator/generator-properties.js |  111 -
 .../js/routes/generator/generator-readme.js     |   60 -
 .../main/js/routes/generator/generator-xml.js   | 1493 -------------
 .../src/main/js/routes/metadata.js              |    1 +
 .../src/main/js/routes/summary.js               |   67 -
 .../main/js/views/configuration/sidebar.jade    |    6 +-
 .../main/js/views/configuration/summary.jade    |   17 +-
 23 files changed, 4494 insertions(+), 4365 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/ce945056/modules/control-center-web/src/main/js/controllers/summary-controller.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/controllers/summary-controller.js b/modules/control-center-web/src/main/js/controllers/summary-controller.js
index ee3b44a..f443ac0 100644
--- a/modules/control-center-web/src/main/js/controllers/summary-controller.js
+++ b/modules/control-center-web/src/main/js/controllers/summary-controller.js
@@ -116,17 +116,17 @@ consoleModule.controller('summaryController', [
             var curServCls = $scope.configServer.pojoClass;
             var curCliCls = $scope.configClient.pojoClass;
 
-            $generatorJava.pojos($scope.selectedItem.caches, $scope.configServer.useConstructor, $scope.configServer.includeKeyFields);
+            var metadatas = $generatorJava.pojos($scope.selectedItem.caches, $scope.configServer.useConstructor, $scope.configServer.includeKeyFields);
 
             function restoreSelected(selected, config, tabs) {
-                if (!$common.isDefined(selected) || _.findIndex($generatorJava.metadatas, function (meta) {
+                if (!$common.isDefined(selected) || _.findIndex(metadatas, function (meta) {
                         return meta.keyType == selected || meta.valueType == selected;
                     }) < 0) {
-                    if ($generatorJava.metadatas.length > 0) {
-                        if ($common.isDefined($generatorJava.metadatas[0].keyType))
-                            config.pojoClass = $generatorJava.metadatas[0].keyType;
+                    if (metadatas.length > 0) {
+                        if ($common.isDefined(metadatas[0].keyType))
+                            config.pojoClass = metadatas[0].keyType;
                         else
-                            config.pojoClass = $generatorJava.metadatas[0].valueType;
+                            config.pojoClass = metadatas[0].valueType;
                     }
                     else {
                         config.pojoClass = undefined;
@@ -193,6 +193,49 @@ consoleModule.controller('summaryController', [
         return $common.isDefined($generatorJava.metadatas) && $generatorJava.metadatas.length > 0;
     };
 
+    $scope.downloadConfiguration = function () {
+        var cluster = $scope.selectedItem;
+        var clientNearConfiguration = $scope.backupItem.nearConfiguration;
+
+        var zip = new JSZip();
+
+        zip.file('Dockerfile', $scope.dockerServer);
+
+        var builder = $generatorProperties.sslProperties(cluster);
+
+        builder = $generatorProperties.dataSourcesProperties(cluster, builder);
+
+        if (builder)
+            zip.file('src/main/resources/secret.properties', builder.asString());
+
+        var srcPath = 'src/main/java/';
+
+        zip.file('config/' + cluster.name + '-server.xml', $generatorXml.cluster(cluster));
+        zip.file('config/' + cluster.name + '-client.xml', $generatorXml.cluster(cluster, clientNearConfiguration));
+
+        zip.file(srcPath + 'ServerConfigurationFactory.java', $generatorJava.cluster(cluster, 'ServerConfigurationFactory'));
+        zip.file(srcPath + 'ClientConfigurationFactory.java', $generatorJava.cluster(cluster, 'ClientConfigurationFactory', clientNearConfiguration));
+
+        zip.file('pom.xml', $generatorPom.pom(cluster.caches, '1.5.0').asString());
+
+        zip.file('README.txt', $generatorReadme.readme().asString());
+        zip.file('jdbc-drivers/README.txt', $generatorReadme.readmeJdbc().asString());
+
+        for (var meta of $generatorJava.pojos(cluster.caches, $scope.configServer.useConstructor, $scope.configServer.includeKeyFields)) {
+            if (meta.keyClass)
+                zip.file(srcPath + meta.keyType.replace(/\./g, '/') + '.java', meta.keyClass);
+
+            zip.file(srcPath + meta.valueType.replace(/\./g, '/') + '.java', meta.valueClass);
+        }
+
+        var blob = zip.generate({type:'blob', mimeType: 'application/octet-stream'});
+
+        console.log(blob);
+
+        // Download archive.
+        saveAs(blob, cluster.name + '-configuration.zip');
+    };
+
     $loading.start('loadingSummaryScreen');
 
     $http.post('clusters/list')

http://git-wip-us.apache.org/repos/asf/ignite/blob/ce945056/modules/control-center-web/src/main/js/helpers/data-structures.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/helpers/data-structures.js b/modules/control-center-web/src/main/js/helpers/data-structures.js
index 7eeca24..ba59e3c 100644
--- a/modules/control-center-web/src/main/js/helpers/data-structures.js
+++ b/modules/control-center-web/src/main/js/helpers/data-structures.js
@@ -15,11 +15,6 @@
  * limitations under the License.
  */
 
-// For server side we should load required libraries.
-if (typeof window === 'undefined') {
-    $commonUtils = require('./common-utils');
-}
-
 // Entry point for common data structures.
 $dataStructures = {};
 
@@ -104,8 +99,3 @@ $dataStructures.fullClassName = function (clsName) {
 
     return clsName;
 };
-
-// For server side we should export properties generation entry point.
-if (typeof window === 'undefined') {
-    module.exports = $dataStructures;
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/ce945056/modules/control-center-web/src/main/js/helpers/generator/generator-common.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/helpers/generator/generator-common.js b/modules/control-center-web/src/main/js/helpers/generator/generator-common.js
new file mode 100644
index 0000000..0d16c5d
--- /dev/null
+++ b/modules/control-center-web/src/main/js/helpers/generator/generator-common.js
@@ -0,0 +1,423 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// Entry point for common functions for code generation.
+$generatorCommon = {};
+
+// Add leading zero.
+$generatorCommon.addLeadingZero = function (numberStr, minSize) {
+    if (typeof (numberStr) != 'string')
+        numberStr = '' + numberStr;
+
+    while (numberStr.length < minSize) {
+        numberStr = '0' + numberStr;
+    }
+
+    return numberStr;
+};
+
+// Format date to string.
+$generatorCommon.formatDate = function (date) {
+    var dd = $generatorCommon.addLeadingZero(date.getDate(), 2);
+    var mm = $generatorCommon.addLeadingZero(date.getMonth() + 1, 2);
+
+    var yyyy = date.getFullYear();
+
+    return mm + '/' + dd + '/' + yyyy + ' ' + $generatorCommon.addLeadingZero(date.getHours(), 2) + ':' + $generatorCommon.addLeadingZero(date.getMinutes(), 2);
+};
+
+// Generate comment for generated XML, Java, ... files.
+$generatorCommon.mainComment = function mainComment() {
+    return 'This configuration was generated by Ignite Web Console (' + $generatorCommon.formatDate(new Date()) + ')';
+};
+
+// Create result holder with service functions and properties for XML and java code generation.
+$generatorCommon.builder = function () {
+    var res = [];
+
+    res.deep = 0;
+    res.needEmptyLine = false;
+    res.lineStart = true;
+    res.datasources = [];
+    res.imports = {};
+    res.vars = {};
+
+    res.safeDeep = 0;
+    res.safeNeedEmptyLine = false;
+    res.safeImports = {};
+    res.safeDatasources = [];
+    res.safePoint = -1;
+
+    res.startSafeBlock = function () {
+        res.safeDeep = this.deep;
+        this.safeNeedEmptyLine = this.needEmptyLine;
+        this.safeImports = _.cloneDeep(this.imports);
+        this.safeDatasources = this.datasources.slice();
+        this.safePoint = this.length;
+    };
+
+    res.rollbackSafeBlock = function () {
+        if (this.safePoint >= 0) {
+            this.splice(this.safePoint, this.length - this.safePoint);
+
+            this.deep = res.safeDeep;
+            this.needEmptyLine = this.safeNeedEmptyLine;
+            this.datasources = this.safeDatasources;
+            this.imports = this.safeImports;
+            this.safePoint = -1;
+        }
+    };
+
+    res.asString = function() {
+      return this.join('\n');
+    };
+
+    res.append = function (s) {
+        this.push((this.lineStart ? _.repeat('    ', this.deep) : '') + s);
+
+        return this;
+    };
+
+    res.line = function (s) {
+        if (s) {
+            if (this.needEmptyLine)
+                this.push('');
+
+            this.append(s);
+        }
+
+        this.needEmptyLine = false;
+
+        this.lineStart = true;
+
+        return this;
+    };
+
+    res.startBlock = function (s) {
+        if (s) {
+            if (this.needEmptyLine)
+                this.push('');
+
+            this.append(s);
+        }
+
+        this.needEmptyLine = false;
+
+        this.lineStart = true;
+
+        this.deep++;
+
+        return this;
+    };
+
+    res.endBlock = function (s) {
+        this.deep--;
+
+        if (s)
+            this.append(s);
+
+        this.lineStart = true;
+
+        return this;
+    };
+
+    res.emptyLineIfNeeded = function () {
+        if (this.needEmptyLine) {
+            this.push('');
+            this.lineStart = true;
+
+            this.needEmptyLine = false;
+        }
+    };
+
+    /**
+     * Add class to imports.
+     *
+     * @param clsName Full class name.
+     * @returns {String} Short class name or full class name in case of names conflict.
+     */
+    res.importClass = function (clsName) {
+        var fullClassName = $dataStructures.fullClassName(clsName);
+
+        var dotIdx = fullClassName.lastIndexOf('.');
+
+        var shortName = dotIdx > 0 ? fullClassName.substr(dotIdx + 1) : fullClassName;
+
+        if (this.imports[shortName]) {
+            if (this.imports[shortName] != fullClassName)
+                return fullClassName; // Short class names conflict. Return full name.
+        }
+        else
+            this.imports[shortName] = fullClassName;
+
+        return shortName;
+    };
+
+    /**
+     * @returns String with "java imports" section.
+     */
+    res.generateImports = function () {
+        var res = [];
+
+        for (var clsName in this.imports) {
+            if (this.imports.hasOwnProperty(clsName) && this.imports[clsName].lastIndexOf('java.lang.', 0) != 0)
+                res.push('import ' + this.imports[clsName] + ';');
+        }
+
+        res.sort();
+
+        return res.join('\n')
+    };
+
+    return res;
+};
+
+// Eviction policies code generation descriptors.
+$generatorCommon.EVICTION_POLICIES = {
+    LRU: {
+        className: 'org.apache.ignite.cache.eviction.lru.LruEvictionPolicy',
+        fields: {batchSize: null, maxMemorySize: null, maxSize: null}
+    },
+    RND: {
+        className: 'org.apache.ignite.cache.eviction.random.RandomEvictionPolicy',
+        fields: {maxSize: null}
+    },
+    FIFO: {
+        className: 'org.apache.ignite.cache.eviction.fifo.FifoEvictionPolicy',
+        fields: {batchSize: null, maxMemorySize: null, maxSize: null}
+    },
+    SORTED: {
+        className: 'org.apache.ignite.cache.eviction.sorted.SortedEvictionPolicy',
+        fields: {batchSize: null, maxMemorySize: null, maxSize: null}
+    }
+};
+
+// Marshaller code generation descriptors.
+$generatorCommon.MARSHALLERS = {
+    OptimizedMarshaller: {
+        className: 'org.apache.ignite.marshaller.optimized.OptimizedMarshaller',
+        fields: {poolSize: null, requireSerializable: null }
+    },
+    JdkMarshaller: {
+        className: 'org.apache.ignite.marshaller.jdk.JdkMarshaller',
+        fields: {}
+    }
+};
+
+// Pairs of supported databases and their JDBC dialects.
+$generatorCommon.JDBC_DIALECTS = {
+    Generic: 'org.apache.ignite.cache.store.jdbc.dialect.BasicJdbcDialect',
+    Oracle: 'org.apache.ignite.cache.store.jdbc.dialect.OracleDialect',
+    DB2: 'org.apache.ignite.cache.store.jdbc.dialect.DB2Dialect',
+    SQLServer: 'org.apache.ignite.cache.store.jdbc.dialect.SQLServerDialect',
+    MySQL: 'org.apache.ignite.cache.store.jdbc.dialect.MySQLDialect',
+    PostgreSQL: 'org.apache.ignite.cache.store.jdbc.dialect.BasicJdbcDialect',
+    H2: 'org.apache.ignite.cache.store.jdbc.dialect.H2Dialect'
+};
+
+// Return JDBC dialect full class name for specified database.
+$generatorCommon.jdbcDialectClassName = function(db) {
+    var dialectClsName = $generatorCommon.JDBC_DIALECTS[db];
+
+    return dialectClsName ? dialectClsName : 'Unknown database: ' + db;
+};
+
+// Generate default data cache for specified igfs instance.
+$generatorCommon.igfsDataCache = function(igfs) {
+    return {
+        name: igfs.name + '-data',
+        cacheMode: 'PARTITIONED',
+        atomicityMode: 'TRANSACTIONAL',
+        writeSynchronizationMode: 'FULL_SYNC',
+        backups: 0,
+        igfsAffinnityGroupSize: igfs.affinnityGroupSize || 512
+    };
+};
+
+// Generate default meta cache for specified igfs instance.
+$generatorCommon.igfsMetaCache = function(igfs) {
+    return {
+        name: igfs.name + '-meta',
+        cacheMode: 'REPLICATED',
+        atomicityMode: 'TRANSACTIONAL',
+        writeSynchronizationMode: 'FULL_SYNC'
+    };
+};
+
+// Pairs of supported databases and their data sources.
+$generatorCommon.DATA_SOURCES = {
+    Generic: 'com.mchange.v2.c3p0.jboss.C3P0PooledDataSource',
+    Oracle: 'oracle.jdbc.pool.OracleDataSource',
+    DB2: 'com.ibm.db2.jcc.DB2DataSource',
+    SQLServer: 'com.microsoft.sqlserver.jdbc.SQLServerDataSource',
+    MySQL: 'com.mysql.jdbc.jdbc2.optional.MysqlDataSource',
+    PostgreSQL: 'org.postgresql.ds.PGPoolingDataSource',
+    H2: 'org.h2.jdbcx.JdbcDataSource'
+};
+
+// Return data source full class name for specified database.
+$generatorCommon.dataSourceClassName = function(db) {
+    var dsClsName = $generatorCommon.DATA_SOURCES[db];
+
+    return dsClsName ? dsClsName : 'Unknown database: ' + db;
+};
+
+// Store factories code generation descriptors.
+$generatorCommon.STORE_FACTORIES = {
+    CacheJdbcPojoStoreFactory: {
+        className: 'org.apache.ignite.cache.store.jdbc.CacheJdbcPojoStoreFactory',
+        fields: {
+            configuration: {type: 'bean'}
+        }
+    },
+    CacheJdbcBlobStoreFactory: {
+        className: 'org.apache.ignite.cache.store.jdbc.CacheJdbcBlobStoreFactory',
+        fields: {
+            user: null,
+            dataSourceBean: null,
+            initSchema: null,
+            createTableQuery: null,
+            loadQuery: null,
+            insertQuery: null,
+            updateQuery: null,
+            deleteQuery: null
+        }
+    },
+    CacheHibernateBlobStoreFactory: {
+        className: 'org.apache.ignite.cache.store.hibernate.CacheHibernateBlobStoreFactory',
+        fields: {hibernateProperties: {type: 'propertiesAsList', propVarName: 'props'}}
+    }
+};
+
+// Swap space SPI code generation descriptor.
+$generatorCommon.SWAP_SPACE_SPI = {
+    className: 'org.apache.ignite.spi.swapspace.file.FileSwapSpaceSpi',
+    fields: {
+        baseDirectory: {type: 'path'},
+        readStripesNumber: null,
+        maximumSparsity: {type: 'float'},
+        maxWriteQueueSize: null,
+        writeBufferSize: null
+    }
+};
+
+// Transaction configuration code generation descriptor.
+$generatorCommon.TRANSACTION_CONFIGURATION = {
+    className: 'org.apache.ignite.configuration.TransactionConfiguration',
+    fields: {
+        defaultTxConcurrency: {type: 'enum', enumClass: 'org.apache.ignite.transactions.TransactionConcurrency'},
+        transactionIsolation: {
+            type: 'org.apache.ignite.transactions.TransactionIsolation',
+            setterName: 'defaultTxIsolation'
+        },
+        defaultTxTimeout: null,
+        pessimisticTxLogLinger: null,
+        pessimisticTxLogSize: null,
+        txSerializableEnabled: null,
+        txManagerLookupClassName: null
+    }
+};
+
+// SSL configuration code generation descriptor.
+$generatorCommon.SSL_CONFIGURATION_TRUST_FILE_FACTORY = {
+    className: 'org.apache.ignite.ssl.SslContextFactory',
+    fields: {
+        keyAlgorithm: null,
+        keyStoreFilePath: {type: 'path'},
+        keyStorePassword: {type: 'raw'},
+        keyStoreType: null,
+        protocol: null,
+        trustStoreFilePath: {type: 'path'},
+        trustStorePassword: {type: 'raw'},
+        trustStoreType: null
+    }
+};
+
+// SSL configuration code generation descriptor.
+$generatorCommon.SSL_CONFIGURATION_TRUST_MANAGER_FACTORY = {
+    className: 'org.apache.ignite.ssl.SslContextFactory',
+    fields: {
+        keyAlgorithm: null,
+        keyStoreFilePath: {type: 'path'},
+        keyStorePassword: {type: 'raw'},
+        keyStoreType: null,
+        protocol: null,
+        trustManagers: {type: 'array'}
+    }
+};
+
+// Communication configuration code generation descriptor.
+$generatorCommon.CONNECTOR_CONFIGURATION = {
+    className: 'org.apache.ignite.configuration.ConnectorConfiguration',
+    fields: {
+        jettyPath: null,
+        host: null,
+        port: {dflt: 11211},
+        portRange: {dflt: 100},
+        idleTimeout: {dflt: 7000},
+        receiveBufferSize: {dflt: 32768},
+        sendBufferSize: {dflt: 32768},
+        sendQueueLimit: {dflt: 0},
+        directBuffer: {dflt: false},
+        noDelay: {dflt: false},
+        selectorCount: null,
+        threadPoolSize: null,
+        messageInterceptor: {type: 'bean'},
+        secretKey: null,
+        sslEnabled: {dflt: false}
+    }
+};
+
+// Communication configuration code generation descriptor.
+$generatorCommon.COMMUNICATION_CONFIGURATION = {
+    className: 'org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi',
+    fields: {
+        listener: {type: 'bean'},
+        localAddress: null,
+        localPort: {dflt: 47100},
+        localPortRange: {dflt: 100},
+        sharedMemoryPort: {dflt: 48100},
+        directBuffer: {dflt: false},
+        directSendBuffer: {dflt: false},
+        idleConnectionTimeout: {dflt: 30000},
+        connectTimeout: {dflt: 5000},
+        maxConnectTimeout: {dflt: 600000},
+        reconnectCount: {dflt: 10},
+        socketSendBuffer: {dflt: 32768},
+        socketReceiveBuffer: {dflt: 32768},
+        messageQueueLimit: {dflt: 1024},
+        slowClientQueueLimit: null,
+        tcpNoDelay: {dflt: true},
+        ackSendThreshold: {dflt: 16},
+        unacknowledgedMessagesBufferSize: {dflt: 0},
+        socketWriteTimeout: {dflt: 2000},
+        selectorsCount: null,
+        addressResolver: {type: 'bean'}
+    }
+};
+
+// Communication configuration code generation descriptor.
+$generatorCommon.IGFS_IPC_CONFIGURATION = {
+    className: 'org.apache.ignite.igfs.IgfsIpcEndpointConfiguration',
+    fields: {
+        type: {type: 'enum', enumClass: 'org.apache.ignite.igfs.IgfsIpcEndpointType'},
+        host: {dflt: '127.0.0.1'},
+        port: {dflt: 10500},
+        memorySize: {dflt: 262144},
+        tokenDirectoryPath: {dflt: 'ipc/shmem'}
+    }
+};

http://git-wip-us.apache.org/repos/asf/ignite/blob/ce945056/modules/control-center-web/src/main/js/helpers/generator/generator-docker.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/helpers/generator/generator-docker.js b/modules/control-center-web/src/main/js/helpers/generator/generator-docker.js
new file mode 100644
index 0000000..6d558c3
--- /dev/null
+++ b/modules/control-center-web/src/main/js/helpers/generator/generator-docker.js
@@ -0,0 +1,53 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// Docker file generation entry point.
+$generatorDocker = {};
+
+// Generate Docker file for cluster.
+$generatorDocker.clusterDocker = function (cluster, os) {
+    if (!os)
+        os = 'debian:8';
+
+    return '# Start from a OS image.\n' +
+        'FROM ' + os + '\n' +
+        '\n' +
+        '# Install tools.\n' +
+        'RUN apt-get update && apt-get install -y --fix-missing \\\n' +
+        '  wget \\\n' +
+        '  dstat \\\n' +
+        '  maven \\\n' +
+        '  git\n' +
+        '\n' +
+        '# Install Java. \n' +
+        'RUN \\\n' +
+        'apt-get update && \\\n' +
+        'apt-get install -y openjdk-7-jdk && \\\n' +
+        'rm -rf /var/lib/apt/lists/*\n' +
+        '\n' +
+        '# Define commonly used JAVA_HOME variable.\n' +
+        'ENV JAVA_HOME /usr/lib/jvm/java-7-openjdk-amd64\n' +
+        '\n' +
+        '# Create working directory\n' +
+        'WORKDIR /home\n' +
+        '\n' +
+        'RUN wget -O ignite.zip http://tiny.cc/updater/download_ignite.php && unzip ignite.zip && rm ignite.zip\n' +
+        '\n' +
+        'COPY *.xml /tmp/\n' +
+        '\n' +
+        'RUN mv /tmp/*.xml /home/$(ls)/config';
+};


[7/7] ignite git commit: IGNITE-843 Removed random eviction policy.

Posted by an...@apache.org.
IGNITE-843 Removed random eviction policy.


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/2dc76991
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/2dc76991
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/2dc76991

Branch: refs/heads/ignite-843-rc1
Commit: 2dc76991ac53898d95df82e783e31e55289290c2
Parents: ce94505
Author: Andrey <an...@gridgain.com>
Authored: Tue Nov 10 13:57:17 2015 +0700
Committer: Andrey <an...@gridgain.com>
Committed: Tue Nov 10 13:57:17 2015 +0700

----------------------------------------------------------------------
 .../src/main/js/controllers/models/caches.json  | 30 --------------------
 .../src/main/js/controllers/models/summary.json | 15 ----------
 modules/control-center-web/src/main/js/db.js    | 10 ++-----
 .../js/helpers/generator/generator-common.js    |  4 ---
 4 files changed, 2 insertions(+), 57 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/2dc76991/modules/control-center-web/src/main/js/controllers/models/caches.json
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/controllers/models/caches.json b/modules/control-center-web/src/main/js/controllers/models/caches.json
index 07c6cc3..7c40aba 100644
--- a/modules/control-center-web/src/main/js/controllers/models/caches.json
+++ b/modules/control-center-web/src/main/js/controllers/models/caches.json
@@ -236,21 +236,6 @@
                 }
               ]
             },
-            "RND": {
-              "expanded": false,
-              "fields": [
-                {
-                  "label": "Max size",
-                  "type": "number",
-                  "path": "evictionPolicy.RND",
-                  "model": "maxSize",
-                  "placeholder": 100000,
-                  "tip": [
-                    "Maximum allowed size of cache before entry will start getting evicted"
-                  ]
-                }
-              ]
-            },
             "FIFO": {
               "expanded": false,
               "fields": [
@@ -923,21 +908,6 @@
                 }
               ]
             },
-            "RND": {
-              "expanded": false,
-              "fields": [
-                {
-                  "label": "Max size",
-                  "type": "number",
-                  "path": "nearConfiguration.nearEvictionPolicy.RND",
-                  "model": "maxSize",
-                  "placeholder": 100000,
-                  "tip": [
-                    "Maximum allowed size of cache before entry will start getting evicted"
-                  ]
-                }
-              ]
-            },
             "FIFO": {
               "expanded": false,
               "fields": [

http://git-wip-us.apache.org/repos/asf/ignite/blob/2dc76991/modules/control-center-web/src/main/js/controllers/models/summary.json
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/controllers/models/summary.json b/modules/control-center-web/src/main/js/controllers/models/summary.json
index 69b6d5b..b3025a3 100644
--- a/modules/control-center-web/src/main/js/controllers/models/summary.json
+++ b/modules/control-center-web/src/main/js/controllers/models/summary.json
@@ -81,21 +81,6 @@
             }
           ]
         },
-        "RND": {
-          "expanded": false,
-          "fields": [
-            {
-              "label": "Max size",
-              "type": "number",
-              "path": "nearConfiguration.nearEvictionPolicy.RND",
-              "model": "maxSize",
-              "placeholder": 100000,
-              "tip": [
-                "Maximum allowed size of cache before entry will start getting evicted"
-              ]
-            }
-          ]
-        },
         "FIFO": {
           "expanded": false,
           "fields": [

http://git-wip-us.apache.org/repos/asf/ignite/blob/2dc76991/modules/control-center-web/src/main/js/db.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/db.js b/modules/control-center-web/src/main/js/db.js
index b45cdce..cce1976 100644
--- a/modules/control-center-web/src/main/js/db.js
+++ b/modules/control-center-web/src/main/js/db.js
@@ -105,15 +105,12 @@ var CacheSchema = new Schema({
     swapEnabled: Boolean,
 
     evictionPolicy: {
-        kind: {type: String, enum: ['LRU', 'RND', 'FIFO', 'Sorted']},
+        kind: {type: String, enum: ['LRU', 'FIFO', 'Sorted']},
         LRU: {
             batchSize: Number,
             maxMemorySize: Number,
             maxSize: Number
         },
-        RND: {
-            maxSize: Number
-        },
         FIFO: {
             batchSize: Number,
             maxMemorySize: Number,
@@ -189,15 +186,12 @@ var CacheSchema = new Schema({
     nearConfiguration: {
         nearStartSize: Number,
         nearEvictionPolicy: {
-            kind: {type: String, enum: ['LRU', 'RND', 'FIFO', 'Sorted']},
+            kind: {type: String, enum: ['LRU', 'FIFO', 'Sorted']},
             LRU: {
                 batchSize: Number,
                 maxMemorySize: Number,
                 maxSize: Number
             },
-            RND: {
-                maxSize: Number
-            },
             FIFO: {
                 batchSize: Number,
                 maxMemorySize: Number,

http://git-wip-us.apache.org/repos/asf/ignite/blob/2dc76991/modules/control-center-web/src/main/js/helpers/generator/generator-common.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/helpers/generator/generator-common.js b/modules/control-center-web/src/main/js/helpers/generator/generator-common.js
index 0d16c5d..16bb952 100644
--- a/modules/control-center-web/src/main/js/helpers/generator/generator-common.js
+++ b/modules/control-center-web/src/main/js/helpers/generator/generator-common.js
@@ -192,10 +192,6 @@ $generatorCommon.EVICTION_POLICIES = {
         className: 'org.apache.ignite.cache.eviction.lru.LruEvictionPolicy',
         fields: {batchSize: null, maxMemorySize: null, maxSize: null}
     },
-    RND: {
-        className: 'org.apache.ignite.cache.eviction.random.RandomEvictionPolicy',
-        fields: {maxSize: null}
-    },
     FIFO: {
         className: 'org.apache.ignite.cache.eviction.fifo.FifoEvictionPolicy',
         fields: {batchSize: null, maxMemorySize: null, maxSize: null}


[2/7] ignite git commit: IGNITE-1857 Generate configuration zip on client side.

Posted by an...@apache.org.
http://git-wip-us.apache.org/repos/asf/ignite/blob/ce945056/modules/control-center-web/src/main/js/routes/generator/generator-common.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/routes/generator/generator-common.js b/modules/control-center-web/src/main/js/routes/generator/generator-common.js
deleted file mode 100644
index 0ae36b5..0000000
--- a/modules/control-center-web/src/main/js/routes/generator/generator-common.js
+++ /dev/null
@@ -1,436 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-// For server side we should load required libraries.
-if (typeof window === 'undefined') {
-    _ = require('lodash');
-
-    $commonUtils = require('../../helpers/common-utils');
-    $dataStructures = require('../../helpers/data-structures');
-}
-
-// Entry point for common functions for code generation.
-$generatorCommon = {};
-
-// Add leading zero.
-$generatorCommon.addLeadingZero = function (numberStr, minSize) {
-    if (typeof (numberStr) != 'string')
-        numberStr = '' + numberStr;
-
-    while (numberStr.length < minSize) {
-        numberStr = '0' + numberStr;
-    }
-
-    return numberStr;
-};
-
-// Format date to string.
-$generatorCommon.formatDate = function (date) {
-    var dd = $generatorCommon.addLeadingZero(date.getDate(), 2);
-    var mm = $generatorCommon.addLeadingZero(date.getMonth() + 1, 2);
-
-    var yyyy = date.getFullYear();
-
-    return mm + '/' + dd + '/' + yyyy + ' ' + $generatorCommon.addLeadingZero(date.getHours(), 2) + ':' + $generatorCommon.addLeadingZero(date.getMinutes(), 2);
-};
-
-// Generate comment for generated XML, Java, ... files.
-$generatorCommon.mainComment = function mainComment() {
-    return 'This configuration was generated by Ignite Web Console (' + $generatorCommon.formatDate(new Date()) + ')';
-};
-
-// Create result holder with service functions and properties for XML and java code generation.
-$generatorCommon.builder = function () {
-    var res = [];
-
-    res.deep = 0;
-    res.needEmptyLine = false;
-    res.lineStart = true;
-    res.datasources = [];
-    res.imports = {};
-    res.vars = {};
-
-    res.safeDeep = 0;
-    res.safeNeedEmptyLine = false;
-    res.safeImports = {};
-    res.safeDatasources = [];
-    res.safePoint = -1;
-
-    res.startSafeBlock = function () {
-        res.safeDeep = this.deep;
-        this.safeNeedEmptyLine = this.needEmptyLine;
-        this.safeImports = _.cloneDeep(this.imports);
-        this.safeDatasources = this.datasources.slice();
-        this.safePoint = this.length;
-    };
-
-    res.rollbackSafeBlock = function () {
-        if (this.safePoint >= 0) {
-            this.splice(this.safePoint, this.length - this.safePoint);
-
-            this.deep = res.safeDeep;
-            this.needEmptyLine = this.safeNeedEmptyLine;
-            this.datasources = this.safeDatasources;
-            this.imports = this.safeImports;
-            this.safePoint = -1;
-        }
-    };
-
-    res.asString = function() {
-      return this.join('\n');
-    };
-
-    res.append = function (s) {
-        this.push((this.lineStart ? _.repeat('    ', this.deep) : '') + s);
-
-        return this;
-    };
-
-    res.line = function (s) {
-        if (s) {
-            if (this.needEmptyLine)
-                this.push('');
-
-            this.append(s);
-        }
-
-        this.needEmptyLine = false;
-
-        this.lineStart = true;
-
-        return this;
-    };
-
-    res.startBlock = function (s) {
-        if (s) {
-            if (this.needEmptyLine)
-                this.push('');
-
-            this.append(s);
-        }
-
-        this.needEmptyLine = false;
-
-        this.lineStart = true;
-
-        this.deep++;
-
-        return this;
-    };
-
-    res.endBlock = function (s) {
-        this.deep--;
-
-        if (s)
-            this.append(s);
-
-        this.lineStart = true;
-
-        return this;
-    };
-
-    res.emptyLineIfNeeded = function () {
-        if (this.needEmptyLine) {
-            this.push('');
-            this.lineStart = true;
-
-            this.needEmptyLine = false;
-        }
-    };
-
-    /**
-     * Add class to imports.
-     *
-     * @param clsName Full class name.
-     * @returns {String} Short class name or full class name in case of names conflict.
-     */
-    res.importClass = function (clsName) {
-        var fullClassName = $dataStructures.fullClassName(clsName);
-
-        var dotIdx = fullClassName.lastIndexOf('.');
-
-        var shortName = dotIdx > 0 ? fullClassName.substr(dotIdx + 1) : fullClassName;
-
-        if (this.imports[shortName]) {
-            if (this.imports[shortName] != fullClassName)
-                return fullClassName; // Short class names conflict. Return full name.
-        }
-        else
-            this.imports[shortName] = fullClassName;
-
-        return shortName;
-    };
-
-    /**
-     * @returns String with "java imports" section.
-     */
-    res.generateImports = function () {
-        var res = [];
-
-        for (var clsName in this.imports) {
-            if (this.imports.hasOwnProperty(clsName) && this.imports[clsName].lastIndexOf('java.lang.', 0) != 0)
-                res.push('import ' + this.imports[clsName] + ';');
-        }
-
-        res.sort();
-
-        return res.join('\n')
-    };
-
-    return res;
-};
-
-// Eviction policies code generation descriptors.
-$generatorCommon.EVICTION_POLICIES = {
-    LRU: {
-        className: 'org.apache.ignite.cache.eviction.lru.LruEvictionPolicy',
-        fields: {batchSize: null, maxMemorySize: null, maxSize: null}
-    },
-    RND: {
-        className: 'org.apache.ignite.cache.eviction.random.RandomEvictionPolicy',
-        fields: {maxSize: null}
-    },
-    FIFO: {
-        className: 'org.apache.ignite.cache.eviction.fifo.FifoEvictionPolicy',
-        fields: {batchSize: null, maxMemorySize: null, maxSize: null}
-    },
-    SORTED: {
-        className: 'org.apache.ignite.cache.eviction.sorted.SortedEvictionPolicy',
-        fields: {batchSize: null, maxMemorySize: null, maxSize: null}
-    }
-};
-
-// Marshaller code generation descriptors.
-$generatorCommon.MARSHALLERS = {
-    OptimizedMarshaller: {
-        className: 'org.apache.ignite.marshaller.optimized.OptimizedMarshaller',
-        fields: {poolSize: null, requireSerializable: null }
-    },
-    JdkMarshaller: {
-        className: 'org.apache.ignite.marshaller.jdk.JdkMarshaller',
-        fields: {}
-    }
-};
-
-// Pairs of supported databases and their JDBC dialects.
-$generatorCommon.JDBC_DIALECTS = {
-    Generic: 'org.apache.ignite.cache.store.jdbc.dialect.BasicJdbcDialect',
-    Oracle: 'org.apache.ignite.cache.store.jdbc.dialect.OracleDialect',
-    DB2: 'org.apache.ignite.cache.store.jdbc.dialect.DB2Dialect',
-    SQLServer: 'org.apache.ignite.cache.store.jdbc.dialect.SQLServerDialect',
-    MySQL: 'org.apache.ignite.cache.store.jdbc.dialect.MySQLDialect',
-    PostgreSQL: 'org.apache.ignite.cache.store.jdbc.dialect.BasicJdbcDialect',
-    H2: 'org.apache.ignite.cache.store.jdbc.dialect.H2Dialect'
-};
-
-// Return JDBC dialect full class name for specified database.
-$generatorCommon.jdbcDialectClassName = function(db) {
-    var dialectClsName = $generatorCommon.JDBC_DIALECTS[db];
-
-    return dialectClsName ? dialectClsName : 'Unknown database: ' + db;
-};
-
-// Generate default data cache for specified igfs instance.
-$generatorCommon.igfsDataCache = function(igfs) {
-    return {
-        name: igfs.name + '-data',
-        cacheMode: 'PARTITIONED',
-        atomicityMode: 'TRANSACTIONAL',
-        writeSynchronizationMode: 'FULL_SYNC',
-        backups: 0,
-        igfsAffinnityGroupSize: igfs.affinnityGroupSize || 512
-    };
-};
-
-// Generate default meta cache for specified igfs instance.
-$generatorCommon.igfsMetaCache = function(igfs) {
-    return {
-        name: igfs.name + '-meta',
-        cacheMode: 'REPLICATED',
-        atomicityMode: 'TRANSACTIONAL',
-        writeSynchronizationMode: 'FULL_SYNC'
-    };
-};
-
-// Pairs of supported databases and their data sources.
-$generatorCommon.DATA_SOURCES = {
-    Generic: 'com.mchange.v2.c3p0.jboss.C3P0PooledDataSource',
-    Oracle: 'oracle.jdbc.pool.OracleDataSource',
-    DB2: 'com.ibm.db2.jcc.DB2DataSource',
-    SQLServer: 'com.microsoft.sqlserver.jdbc.SQLServerDataSource',
-    MySQL: 'com.mysql.jdbc.jdbc2.optional.MysqlDataSource',
-    PostgreSQL: 'org.postgresql.ds.PGPoolingDataSource',
-    H2: 'org.h2.jdbcx.JdbcDataSource'
-};
-
-// Return data source full class name for specified database.
-$generatorCommon.dataSourceClassName = function(db) {
-    var dsClsName = $generatorCommon.DATA_SOURCES[db];
-
-    return dsClsName ? dsClsName : 'Unknown database: ' + db;
-};
-
-// Store factories code generation descriptors.
-$generatorCommon.STORE_FACTORIES = {
-    CacheJdbcPojoStoreFactory: {
-        className: 'org.apache.ignite.cache.store.jdbc.CacheJdbcPojoStoreFactory',
-        fields: {
-            configuration: {type: 'bean'}
-        }
-    },
-    CacheJdbcBlobStoreFactory: {
-        className: 'org.apache.ignite.cache.store.jdbc.CacheJdbcBlobStoreFactory',
-        fields: {
-            user: null,
-            dataSourceBean: null,
-            initSchema: null,
-            createTableQuery: null,
-            loadQuery: null,
-            insertQuery: null,
-            updateQuery: null,
-            deleteQuery: null
-        }
-    },
-    CacheHibernateBlobStoreFactory: {
-        className: 'org.apache.ignite.cache.store.hibernate.CacheHibernateBlobStoreFactory',
-        fields: {hibernateProperties: {type: 'propertiesAsList', propVarName: 'props'}}
-    }
-};
-
-// Swap space SPI code generation descriptor.
-$generatorCommon.SWAP_SPACE_SPI = {
-    className: 'org.apache.ignite.spi.swapspace.file.FileSwapSpaceSpi',
-    fields: {
-        baseDirectory: {type: 'path'},
-        readStripesNumber: null,
-        maximumSparsity: {type: 'float'},
-        maxWriteQueueSize: null,
-        writeBufferSize: null
-    }
-};
-
-// Transaction configuration code generation descriptor.
-$generatorCommon.TRANSACTION_CONFIGURATION = {
-    className: 'org.apache.ignite.configuration.TransactionConfiguration',
-    fields: {
-        defaultTxConcurrency: {type: 'enum', enumClass: 'org.apache.ignite.transactions.TransactionConcurrency'},
-        transactionIsolation: {
-            type: 'org.apache.ignite.transactions.TransactionIsolation',
-            setterName: 'defaultTxIsolation'
-        },
-        defaultTxTimeout: null,
-        pessimisticTxLogLinger: null,
-        pessimisticTxLogSize: null,
-        txSerializableEnabled: null,
-        txManagerLookupClassName: null
-    }
-};
-
-// SSL configuration code generation descriptor.
-$generatorCommon.SSL_CONFIGURATION_TRUST_FILE_FACTORY = {
-    className: 'org.apache.ignite.ssl.SslContextFactory',
-    fields: {
-        keyAlgorithm: null,
-        keyStoreFilePath: {type: 'path'},
-        keyStorePassword: {type: 'raw'},
-        keyStoreType: null,
-        protocol: null,
-        trustStoreFilePath: {type: 'path'},
-        trustStorePassword: {type: 'raw'},
-        trustStoreType: null
-    }
-};
-
-// SSL configuration code generation descriptor.
-$generatorCommon.SSL_CONFIGURATION_TRUST_MANAGER_FACTORY = {
-    className: 'org.apache.ignite.ssl.SslContextFactory',
-    fields: {
-        keyAlgorithm: null,
-        keyStoreFilePath: {type: 'path'},
-        keyStorePassword: {type: 'raw'},
-        keyStoreType: null,
-        protocol: null,
-        trustManagers: {type: 'array'}
-    }
-};
-
-// Communication configuration code generation descriptor.
-$generatorCommon.CONNECTOR_CONFIGURATION = {
-    className: 'org.apache.ignite.configuration.ConnectorConfiguration',
-    fields: {
-        jettyPath: null,
-        host: null,
-        port: {dflt: 11211},
-        portRange: {dflt: 100},
-        idleTimeout: {dflt: 7000},
-        receiveBufferSize: {dflt: 32768},
-        sendBufferSize: {dflt: 32768},
-        sendQueueLimit: {dflt: 0},
-        directBuffer: {dflt: false},
-        noDelay: {dflt: false},
-        selectorCount: null,
-        threadPoolSize: null,
-        messageInterceptor: {type: 'bean'},
-        secretKey: null,
-        sslEnabled: {dflt: false}
-    }
-};
-
-// Communication configuration code generation descriptor.
-$generatorCommon.COMMUNICATION_CONFIGURATION = {
-    className: 'org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi',
-    fields: {
-        listener: {type: 'bean'},
-        localAddress: null,
-        localPort: {dflt: 47100},
-        localPortRange: {dflt: 100},
-        sharedMemoryPort: {dflt: 48100},
-        directBuffer: {dflt: false},
-        directSendBuffer: {dflt: false},
-        idleConnectionTimeout: {dflt: 30000},
-        connectTimeout: {dflt: 5000},
-        maxConnectTimeout: {dflt: 600000},
-        reconnectCount: {dflt: 10},
-        socketSendBuffer: {dflt: 32768},
-        socketReceiveBuffer: {dflt: 32768},
-        messageQueueLimit: {dflt: 1024},
-        slowClientQueueLimit: null,
-        tcpNoDelay: {dflt: true},
-        ackSendThreshold: {dflt: 16},
-        unacknowledgedMessagesBufferSize: {dflt: 0},
-        socketWriteTimeout: {dflt: 2000},
-        selectorsCount: null,
-        addressResolver: {type: 'bean'}
-    }
-};
-
-// Communication configuration code generation descriptor.
-$generatorCommon.IGFS_IPC_CONFIGURATION = {
-    className: 'org.apache.ignite.igfs.IgfsIpcEndpointConfiguration',
-    fields: {
-        type: {type: 'enum', enumClass: 'org.apache.ignite.igfs.IgfsIpcEndpointType'},
-        host: {dflt: '127.0.0.1'},
-        port: {dflt: 10500},
-        memorySize: {dflt: 262144},
-        tokenDirectoryPath: {dflt: 'ipc/shmem'}
-    }
-};
-
-// For server side we should export Java code generation entry point.
-if (typeof window === 'undefined') {
-    module.exports = $generatorCommon;
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/ce945056/modules/control-center-web/src/main/js/routes/generator/generator-docker.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/routes/generator/generator-docker.js b/modules/control-center-web/src/main/js/routes/generator/generator-docker.js
deleted file mode 100644
index 4e12b53..0000000
--- a/modules/control-center-web/src/main/js/routes/generator/generator-docker.js
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-// Docker file generation entry point.
-$generatorDocker = {};
-
-// Generate Docker file for cluster.
-$generatorDocker.clusterDocker = function (cluster, os) {
-    if (!os)
-        os = 'debian:8';
-
-    return '# Start from a OS image.\n' +
-        'FROM ' + os + '\n' +
-        '\n' +
-        '# Install tools.\n' +
-        'RUN apt-get update && apt-get install -y --fix-missing \\\n' +
-        '  wget \\\n' +
-        '  dstat \\\n' +
-        '  maven \\\n' +
-        '  git\n' +
-        '\n' +
-        '# Install Java. \n' +
-        'RUN \\\n' +
-        'apt-get update && \\\n' +
-        'apt-get install -y openjdk-7-jdk && \\\n' +
-        'rm -rf /var/lib/apt/lists/*\n' +
-        '\n' +
-        '# Define commonly used JAVA_HOME variable.\n' +
-        'ENV JAVA_HOME /usr/lib/jvm/java-7-openjdk-amd64\n' +
-        '\n' +
-        '# Create working directory\n' +
-        'WORKDIR /home\n' +
-        '\n' +
-        'RUN wget -O ignite.zip http://tiny.cc/updater/download_ignite.php && unzip ignite.zip && rm ignite.zip\n' +
-        '\n' +
-        'COPY *.xml /tmp/\n' +
-        '\n' +
-        'RUN mv /tmp/*.xml /home/$(ls)/config';
-};
-
-// For server side we should export Java code generation entry point.
-if (typeof window === 'undefined') {
-    module.exports = $generatorDocker;
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/ce945056/modules/control-center-web/src/main/js/routes/generator/generator-java.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/routes/generator/generator-java.js b/modules/control-center-web/src/main/js/routes/generator/generator-java.js
deleted file mode 100644
index 3f11d0d..0000000
--- a/modules/control-center-web/src/main/js/routes/generator/generator-java.js
+++ /dev/null
@@ -1,1956 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-// For server side we should load required libraries.
-if (typeof window === 'undefined') {
-    _ = require('lodash');
-
-    $commonUtils = require('../../helpers/common-utils');
-    $dataStructures = require('../../helpers/data-structures');
-    $generatorCommon = require('./generator-common');
-}
-
-// Java generation entry point.
-$generatorJava = {};
-
-/**
- * Translate some value to valid java code.
- *
- * @param val Value to convert.
- * @param type Value type.
- * @returns {*} String with value that will be valid for java.
- */
-$generatorJava.toJavaCode = function (val, type) {
-    if (val == null)
-        return 'null';
-
-    if (type == 'raw')
-        return val;
-
-    if (type == 'class')
-        return val + '.class';
-
-    if (type == 'float')
-        return val + 'f';
-
-    if (type == 'path')
-        return '"' + val.replace(/\\/g, '\\\\') + '"';
-
-    if (type)
-        return type + '.' + val;
-
-    if (typeof(val) == 'string')
-        return '"' + val.replace('"', '\\"') + '"';
-
-    if (typeof(val) == 'number' || typeof(val) == 'boolean')
-        return '' + val;
-
-    throw "Unknown type: " + typeof(val) + ' (' + val + ')';
-};
-
-/**
- * @param propName Property name.
- * @param setterName Optional concrete setter name.
- * @returns Property setter with name by java conventions.
- */
-$generatorJava.setterName = function (propName, setterName) {
-    return setterName ? setterName : $commonUtils.toJavaName('set', propName);
-};
-
-/**
- * Add variable declaration.
- *
- * @param res Resulting output with generated code.
- * @param varName Variable name.
- * @param varFullType Variable full class name to be added to imports.
- * @param varFullActualType Variable actual full class name to be added to imports.
- * @param varFullGenericType1 Optional full class name of first generic.
- * @param varFullGenericType2 Optional full class name of second generic.
- */
-$generatorJava.declareVariable = function (res, varName, varFullType, varFullActualType, varFullGenericType1, varFullGenericType2) {
-    res.emptyLineIfNeeded();
-
-    var varType = res.importClass(varFullType);
-
-    var varNew = !res.vars[varName];
-
-    if (varNew)
-        res.vars[varName] = true;
-
-    if (varFullActualType && varFullGenericType1) {
-        var varActualType = res.importClass(varFullActualType);
-        var varGenericType1 = res.importClass(varFullGenericType1);
-
-        if (varFullGenericType2)
-            var varGenericType2 = res.importClass(varFullGenericType2);
-
-        res.line((varNew ? (varType + '<' + varGenericType1 + (varGenericType2 ? ', ' + varGenericType2 : '') + '> ') : '') + varName + ' = new ' + varActualType + '<>();');
-    }
-    else
-        res.line((varNew ? (varType + ' ') : '') + varName + ' = new ' + varType + '();');
-
-    res.needEmptyLine = true;
-};
-
-/**
- * Add property via setter / property name.
- *
- * @param res Resulting output with generated code.
- * @param varName Variable name.
- * @param obj Source object with data.
- * @param propName Property name to take from source object.
- * @param dataType Optional info about property data type.
- * @param setterName Optional special setter name.
- * @param dflt Optional default value.
- */
-$generatorJava.property = function (res, varName, obj, propName, dataType, setterName, dflt) {
-    var val = obj[propName];
-
-    if ($commonUtils.isDefinedAndNotEmpty(val)) {
-        var hasDflt = $commonUtils.isDefined(dflt);
-
-        // Add to result if no default provided or value not equals to default.
-        if (!hasDflt || (hasDflt && val != dflt)) {
-            res.emptyLineIfNeeded();
-
-            res.line(varName + '.' + $generatorJava.setterName(propName, setterName)
-                + '(' + $generatorJava.toJavaCode(val, dataType) + ');');
-
-            return true;
-        }
-    }
-
-    return false;
-};
-
-/**
- * Add property via setter assuming that it is a 'Class'.
- *
- * @param res Resulting output with generated code.
- * @param varName Variable name.
- * @param obj Source object with data.
- * @param propName Property name to take from source object.
- */
-$generatorJava.classNameProperty = function (res, varName, obj, propName) {
-    var val = obj[propName];
-
-    if ($commonUtils.isDefined(val)) {
-        res.emptyLineIfNeeded();
-
-        res.line(varName + '.' + $generatorJava.setterName(propName) + '(' + res.importClass(val) + '.class);');
-    }
-};
-
-/**
- * Add list property.
- *
- * @param res Resulting output with generated code.
- * @param varName Variable name.
- * @param obj Source object with data.
- * @param propName Property name to take from source object.
- * @param dataType Optional data type.
- * @param setterName Optional setter name.
- */
-$generatorJava.listProperty = function (res, varName, obj, propName, dataType, setterName) {
-    var val = obj[propName];
-
-    if (val && val.length > 0) {
-        res.emptyLineIfNeeded();
-
-        res.importClass('java.util.Arrays');
-
-        res.line(varName + '.' + $generatorJava.setterName(propName, setterName) +
-            '(Arrays.asList(' +
-                _.map(val, function (v) {
-                    return $generatorJava.toJavaCode(v, dataType)
-                }).join(', ') +
-            '));');
-
-        res.needEmptyLine = true;
-    }
-};
-
-/**
- * Add array property.
- *
- * @param res Resulting output with generated code.
- * @param varName Variable name.
- * @param obj Source object with data.
- * @param propName Property name to take from source object.
- * @param setterName Optional setter name.
- */
-$generatorJava.arrayProperty = function (res, varName, obj, propName, setterName) {
-    var val = obj[propName];
-
-    if (val && val.length > 0) {
-        res.emptyLineIfNeeded();
-
-        res.line(varName + '.' + $generatorJava.setterName(propName, setterName) + '({ ' +
-            _.map(val, function (v) {
-                return 'new ' + res.importClass(v) + '()'
-            }).join(', ') +
-        ' });');
-
-        res.needEmptyLine = true;
-    }
-};
-
-/**
- * Add multi-param property (setter with several arguments).
- *
- * @param res Resulting output with generated code.
- * @param varName Variable name.
- * @param obj Source object with data.
- * @param propName Property name to take from source object.
- * @param dataType Optional data type.
- * @param setterName Optional setter name.
- */
-$generatorJava.multiparamProperty = function (res, varName, obj, propName, dataType, setterName) {
-    var val = obj[propName];
-
-    if (val && val.length > 0) {
-        res.emptyLineIfNeeded();
-
-        res.append(varName + '.' + $generatorJava.setterName(propName, setterName) + '(');
-
-        _.forEach(val, function(v, ix) {
-            if (ix > 0)
-                res.append(', ');
-
-            res.append($generatorJava.toJavaCode(v, dataType));
-        });
-
-        res.line(');');
-    }
-};
-
-/**
- * Add complex bean.
- * @param res Resulting output with generated code.
- * @param varName Variable name.
- * @param bean
- * @param beanPropName
- * @param beanVarName
- * @param beanClass
- * @param props
- * @param createBeanAlthoughNoProps If 'true' then create empty bean.
- */
-$generatorJava.beanProperty = function (res, varName, bean, beanPropName, beanVarName, beanClass, props, createBeanAlthoughNoProps) {
-    if (bean && $commonUtils.hasProperty(bean, props)) {
-        res.emptyLineIfNeeded();
-
-        $generatorJava.declareVariable(res, beanVarName, beanClass);
-
-        _.forIn(props, function(descr, propName) {
-            if (props.hasOwnProperty(propName)) {
-                if (descr) {
-                    switch (descr.type) {
-                        case 'list':
-                            $generatorJava.listProperty(res, beanVarName, bean, propName, descr.elementsType, descr.setterName);
-                            break;
-
-                        case 'array':
-                            $generatorJava.arrayProperty(res, beanVarName, bean, propName, descr.setterName);
-                            break;
-
-                        case 'enum':
-                            $generatorJava.property(res, beanVarName, bean, propName, res.importClass(descr.enumClass), descr.setterName);
-                            break;
-
-                        case 'float':
-                            $generatorJava.property(res, beanVarName, bean, propName, 'float', descr.setterName);
-                            break;
-
-                        case 'path':
-                            $generatorJava.property(res, beanVarName, bean, propName, 'path', descr.setterName);
-                            break;
-
-                        case 'raw':
-                            $generatorJava.property(res, beanVarName, bean, propName, 'raw', descr.setterName);
-                            break;
-
-                        case 'propertiesAsList':
-                            var val = bean[propName];
-
-                            if (val && val.length > 0) {
-                                res.line('Properties ' + descr.propVarName + ' = new Properties();');
-
-                                _.forEach(val, function(nameAndValue) {
-                                    var eqIndex = nameAndValue.indexOf('=');
-
-                                    if (eqIndex >= 0) {
-                                        res.line(descr.propVarName + '.setProperty('
-                                            + nameAndValue.substring(0, eqIndex) + ', '
-                                            + nameAndValue.substr(eqIndex + 1) + ');');
-                                    }
-                                });
-
-                                res.line(beanVarName + '.' + $generatorJava.setterName(propName) + '(' + descr.propVarName + ');');
-                            }
-                            break;
-
-                        case 'bean':
-                            if ($commonUtils.isDefinedAndNotEmpty(bean[propName]))
-                                res.line(beanVarName + '.' + $generatorJava.setterName(propName) + '(new ' + res.importClass(bean[propName]) + '());');
-
-                            break;
-
-                        default:
-                            $generatorJava.property(res, beanVarName, bean, propName, null, descr.setterName, descr.dflt);
-                    }
-                }
-                else {
-                    $generatorJava.property(res, beanVarName, bean, propName);
-                }
-            }
-        });
-
-        res.needEmptyLine = true;
-
-        res.line(varName + '.' + $generatorJava.setterName(beanPropName) + '(' + beanVarName + ');');
-
-        res.needEmptyLine = true;
-    }
-    else if (createBeanAlthoughNoProps) {
-        res.emptyLineIfNeeded();
-        res.line(varName + '.' + $generatorJava.setterName(beanPropName) + '(new ' + res.importClass(beanClass) + '());');
-
-        res.needEmptyLine = true;
-    }
-};
-
-/**
- * Add eviction policy.
- *
- * @param res Resulting output with generated code.
- * @param varName Current using variable name.
- * @param evtPlc Data to add.
- * @param propName Name in source data.
- */
-$generatorJava.evictionPolicy = function (res, varName, evtPlc, propName) {
-    if (evtPlc && evtPlc.kind) {
-        var evictionPolicyDesc = $generatorCommon.EVICTION_POLICIES[evtPlc.kind];
-
-        var obj = evtPlc[evtPlc.kind.toUpperCase()];
-
-        $generatorJava.beanProperty(res, varName, obj, propName, propName,
-            evictionPolicyDesc.className, evictionPolicyDesc.fields, true);
-    }
-};
-
-// Generate cluster general group.
-$generatorJava.clusterGeneral = function (cluster, clientNearCfg, res) {
-    if (!res)
-        res = $generatorCommon.builder();
-
-    $generatorJava.declareVariable(res, 'cfg', 'org.apache.ignite.configuration.IgniteConfiguration');
-
-    $generatorJava.property(res, 'cfg', cluster, 'name', null, 'setGridName');
-    res.needEmptyLine = true;
-
-    if (clientNearCfg) {
-        res.line('cfg.setClientMode(true);');
-
-        res.needEmptyLine = true;
-    }
-
-    if (cluster.discovery) {
-        var d = cluster.discovery;
-
-        $generatorJava.declareVariable(res, 'discovery', 'org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi');
-
-        switch (d.kind) {
-            case 'Multicast':
-                $generatorJava.beanProperty(res, 'discovery', d.Multicast, 'ipFinder', 'ipFinder',
-                    'org.apache.ignite.spi.discovery.tcp.ipfinder.multicast.TcpDiscoveryMulticastIpFinder',
-                    {
-                        multicastGroup: null,
-                        multicastPort: null,
-                        responseWaitTime: null,
-                        addressRequestAttempts: null,
-                        localAddress: null,
-                        addresses: {type: 'list'}
-                    }, true);
-
-                break;
-
-            case 'Vm':
-                $generatorJava.beanProperty(res, 'discovery', d.Vm, 'ipFinder', 'ipFinder',
-                    'org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder',
-                    {addresses: {type: 'list'}}, true);
-
-                break;
-
-            case 'S3':
-                $generatorJava.beanProperty(res, 'discovery', d.S3, 'ipFinder', 'ipFinder',
-                    'org.apache.ignite.spi.discovery.tcp.ipfinder.s3.TcpDiscoveryS3IpFinder', {bucketName: null}, true);
-
-                break;
-
-            case 'Cloud':
-                $generatorJava.beanProperty(res, 'discovery', d.Cloud, 'ipFinder', 'ipFinder',
-                    'org.apache.ignite.spi.discovery.tcp.ipfinder.cloud.TcpDiscoveryCloudIpFinder',
-                    {
-                        credential: null,
-                        credentialPath: null,
-                        identity: null,
-                        provider: null,
-                        regions: {type: 'list'},
-                        zones: {type: 'list'}
-                    }, true);
-
-                break;
-
-            case 'GoogleStorage':
-                $generatorJava.beanProperty(res, 'discovery', d.GoogleStorage, 'ipFinder', 'ipFinder',
-                    'org.apache.ignite.spi.discovery.tcp.ipfinder.gce.TcpDiscoveryGoogleStorageIpFinder',
-                    {
-                        projectName: null,
-                        bucketName: null,
-                        serviceAccountP12FilePath: null,
-                        serviceAccountId: null
-                    }, true);
-
-                break;
-
-            case 'Jdbc':
-                $generatorJava.beanProperty(res, 'discovery', d.Jdbc, 'ipFinder', 'ipFinder',
-                    'org.apache.ignite.spi.discovery.tcp.ipfinder.jdbc.TcpDiscoveryJdbcIpFinder', {initSchema: null}, true);
-
-                break;
-
-            case 'SharedFs':
-                $generatorJava.beanProperty(res, 'discovery', d.SharedFs, 'ipFinder', 'ipFinder',
-                    'org.apache.ignite.spi.discovery.tcp.ipfinder.sharedfs.TcpDiscoverySharedFsIpFinder', {path: null}, true);
-
-                break;
-
-            default:
-                res.line('Unknown discovery kind: ' + d.kind);
-        }
-
-        res.needEmptyLine = false;
-
-        $generatorJava.clusterDiscovery(d, res);
-
-        res.emptyLineIfNeeded();
-
-        res.line('cfg.setDiscoverySpi(discovery);');
-
-        res.needEmptyLine = true;
-    }
-
-    return res;
-};
-
-// Generate atomics group.
-$generatorJava.clusterAtomics = function (cluster, res) {
-    if (!res)
-        res = $generatorCommon.builder();
-
-    var atomics = cluster.atomicConfiguration;
-
-    if ($commonUtils.hasAtLeastOneProperty(atomics, ['cacheMode', 'atomicSequenceReserveSize', 'backups'])) {
-        res.startSafeBlock();
-
-        $generatorJava.declareVariable(res, 'atomicCfg', 'org.apache.ignite.configuration.AtomicConfiguration');
-
-        $generatorJava.property(res, 'atomicCfg', atomics, 'cacheMode');
-
-        var cacheMode = atomics.cacheMode ? atomics.cacheMode : 'PARTITIONED';
-
-        var hasData = cacheMode != 'PARTITIONED';
-
-        hasData = $generatorJava.property(res, 'atomicCfg', atomics, 'atomicSequenceReserveSize') || hasData;
-
-        if (cacheMode == 'PARTITIONED')
-            hasData = $generatorJava.property(res, 'atomicCfg', atomics, 'backups') || hasData;
-
-        res.needEmptyLine = true;
-
-        res.line('cfg.setAtomicConfiguration(atomicCfg);');
-
-        res.needEmptyLine = true;
-
-        if (!hasData)
-            res.rollbackSafeBlock();
-    }
-
-    return res;
-};
-
-// Generate communication group.
-$generatorJava.clusterCommunication = function (cluster, res) {
-    if (!res)
-        res = $generatorCommon.builder();
-
-    var cfg = $generatorCommon.COMMUNICATION_CONFIGURATION;
-
-    $generatorJava.beanProperty(res, 'cfg', cluster.communication, 'communicationSpi', 'commSpi', cfg.className, cfg.fields);
-
-    res.needEmptyLine = false;
-
-    $generatorJava.property(res, 'cfg', cluster, 'networkTimeout', null, null, 5000);
-    $generatorJava.property(res, 'cfg', cluster, 'networkSendRetryDelay', null, null, 1000);
-    $generatorJava.property(res, 'cfg', cluster, 'networkSendRetryCount', null, null, 3);
-    $generatorJava.property(res, 'cfg', cluster, 'segmentCheckFrequency');
-    $generatorJava.property(res, 'cfg', cluster, 'waitForSegmentOnStart', null, null, false);
-    $generatorJava.property(res, 'cfg', cluster, 'discoveryStartupDelay', null, null, 600000);
-
-    res.needEmptyLine = true;
-
-    return res;
-};
-
-// Generate REST access group.
-$generatorJava.clusterConnector = function (cluster, res) {
-    if (!res)
-        res = $generatorCommon.builder();
-
-    if ($commonUtils.isDefined(cluster.connector) && $commonUtils.isDefined(cluster.connector.enabled)) {
-        var cfg = _.cloneDeep($generatorCommon.CONNECTOR_CONFIGURATION);
-
-        if (cluster.connector.sslEnabled) {
-            cfg.fields.sslClientAuth = {dflt: false};
-            cfg.fields.sslFactory = {type: 'bean'};
-        }
-
-        $generatorJava.beanProperty(res, 'cfg', cluster.connector, 'connectorConfiguration', 'clientCfg',
-            cfg.className, cfg.fields, true);
-
-        res.needEmptyLine = true;
-    }
-
-    return res;
-};
-
-// Generate deployment group.
-$generatorJava.clusterDeployment = function (cluster, res) {
-    if (!res)
-        res = $generatorCommon.builder();
-
-    $generatorJava.property(res, 'cfg', cluster, 'deploymentMode', null, null, 'SHARED');
-
-    res.needEmptyLine = true;
-
-    var p2pEnabled = cluster.peerClassLoadingEnabled;
-
-    if ($commonUtils.isDefined(p2pEnabled)) {
-        $generatorJava.property(res, 'cfg', cluster, 'peerClassLoadingEnabled', null, null, false);
-
-        if (p2pEnabled) {
-            $generatorJava.property(res, 'cfg', cluster, 'peerClassLoadingMissedResourcesCacheSize');
-            $generatorJava.property(res, 'cfg', cluster, 'peerClassLoadingThreadPoolSize');
-            $generatorJava.multiparamProperty(res, 'cfg', cluster, 'peerClassLoadingLocalClassPathExclude');
-        }
-
-        res.needEmptyLine = true;
-    }
-
-    return res;
-};
-
-// Generate discovery group.
-$generatorJava.clusterDiscovery = function (disco, res) {
-    if (!res)
-        res = $generatorCommon.builder();
-
-    $generatorJava.property(res, 'discovery', disco, 'localAddress');
-    $generatorJava.property(res, 'discovery', disco, 'localPort', null, null, 47500);
-    $generatorJava.property(res, 'discovery', disco, 'localPortRange', null, null, 100);
-
-    if ($commonUtils.isDefinedAndNotEmpty(disco.addressResolver)) {
-        $generatorJava.beanProperty(res, 'discovery', disco, 'addressResolver', 'addressResolver', disco.addressResolver, {}, true);
-        res.needEmptyLine = false;
-    }
-
-    $generatorJava.property(res, 'discovery', disco, 'socketTimeout', null, null, 5000);
-    $generatorJava.property(res, 'discovery', disco, 'ackTimeout', null, null, 5000);
-    $generatorJava.property(res, 'discovery', disco, 'maxAckTimeout', null, null, 600000);
-    $generatorJava.property(res, 'discovery', disco, 'networkTimeout', null, null, 5000);
-    $generatorJava.property(res, 'discovery', disco, 'joinTimeout', null, null, 0);
-    $generatorJava.property(res, 'discovery', disco, 'threadPriority', null, null, 10);
-    $generatorJava.property(res, 'discovery', disco, 'heartbeatFrequency', null, null, 2000);
-    $generatorJava.property(res, 'discovery', disco, 'maxMissedHeartbeats', null, null, 1);
-    $generatorJava.property(res, 'discovery', disco, 'maxMissedClientHeartbeats', null, null, 5);
-    $generatorJava.property(res, 'discovery', disco, 'topHistorySize', null, null, 100);
-
-    if ($commonUtils.isDefinedAndNotEmpty(disco.listener)) {
-        $generatorJava.beanProperty(res, 'discovery', disco, 'listener', 'listener', disco.listener, {}, true);
-        res.needEmptyLine = false;
-    }
-
-    if ($commonUtils.isDefinedAndNotEmpty(disco.dataExchange)) {
-        $generatorJava.beanProperty(res, 'discovery', disco, 'dataExchange', 'dataExchange', disco.dataExchange, {}, true);
-        res.needEmptyLine = false;
-    }
-
-    if ($commonUtils.isDefinedAndNotEmpty(disco.metricsProvider)) {
-        $generatorJava.beanProperty(res, 'discovery', disco, 'metricsProvider', 'metricsProvider', disco.metricsProvider, {}, true);
-        res.needEmptyLine = false;
-    }
-
-    $generatorJava.property(res, 'discovery', disco, 'reconnectCount', null, null, 10);
-    $generatorJava.property(res, 'discovery', disco, 'statisticsPrintFrequency', null, null, 0);
-    $generatorJava.property(res, 'discovery', disco, 'ipFinderCleanFrequency', null, null, 60000);
-
-    if ($commonUtils.isDefinedAndNotEmpty(disco.authenticator)) {
-        $generatorJava.beanProperty(res, 'discovery', disco, 'authenticator', 'authenticator', disco.authenticator, {}, true);
-        res.needEmptyLine = false;
-    }
-
-    $generatorJava.property(res, 'discovery', disco, 'forceServerMode', null, null, false);
-    $generatorJava.property(res, 'discovery', disco, 'clientReconnectDisabled', null, null, false);
-
-    res.needEmptyLine = true;
-
-    return res;
-};
-
-// Generate events group.
-$generatorJava.clusterEvents = function (cluster, res) {
-    if (!res)
-        res = $generatorCommon.builder();
-
-    if (cluster.includeEventTypes && cluster.includeEventTypes.length > 0) {
-        res.emptyLineIfNeeded();
-
-        if (cluster.includeEventTypes.length == 1) {
-            res.importClass('org.apache.ignite.events.EventType');
-
-            res.line('cfg.setIncludeEventTypes(EventType.' + cluster.includeEventTypes[0] + ');');
-        }
-        else {
-            res.append('int[] events = new int[EventType.' + cluster.includeEventTypes[0] + '.length');
-
-            _.forEach(cluster.includeEventTypes, function(e, ix) {
-                if (ix > 0) {
-                    res.needEmptyLine = true;
-
-                    res.append('    + EventType.' + e + '.length');
-                }
-            });
-
-            res.line('];');
-
-            res.needEmptyLine = true;
-
-            res.line('int k = 0;');
-
-            _.forEach(cluster.includeEventTypes, function(e) {
-                res.needEmptyLine = true;
-
-                res.line('System.arraycopy(EventType.' + e + ', 0, events, k, EventType.' + e + '.length);');
-                res.line('k += EventType.' + e + '.length;');
-            });
-
-            res.needEmptyLine = true;
-
-            res.line('cfg.setIncludeEventTypes(events);');
-        }
-
-        res.needEmptyLine = true;
-    }
-
-    res.needEmptyLine = true;
-
-    return res;
-};
-
-// Generate marshaller group.
-$generatorJava.clusterMarshaller = function (cluster, res) {
-    if (!res)
-        res = $generatorCommon.builder();
-
-    var marshaller = cluster.marshaller;
-
-    if (marshaller && marshaller.kind) {
-        var marshallerDesc = $generatorCommon.MARSHALLERS[marshaller.kind];
-
-        $generatorJava.beanProperty(res, 'cfg', marshaller[marshaller.kind], 'marshaller', 'marshaller',
-            marshallerDesc.className, marshallerDesc.fields, true);
-
-        $generatorJava.beanProperty(res, 'marshaller', marshaller[marshaller.kind], marshallerDesc.className, marshallerDesc.fields, true);
-    }
-
-    $generatorJava.property(res, 'cfg', cluster, 'marshalLocalJobs', null, null, false);
-    $generatorJava.property(res, 'cfg', cluster, 'marshallerCacheKeepAliveTime');
-    $generatorJava.property(res, 'cfg', cluster, 'marshallerCacheThreadPoolSize');
-
-    res.needEmptyLine = true;
-
-    return res;
-};
-
-// Generate metrics group.
-$generatorJava.clusterMetrics = function (cluster, res) {
-    if (!res)
-        res = $generatorCommon.builder();
-
-    $generatorJava.property(res, 'cfg', cluster, 'metricsExpireTime');
-    $generatorJava.property(res, 'cfg', cluster, 'metricsHistorySize');
-    $generatorJava.property(res, 'cfg', cluster, 'metricsLogFrequency');
-    $generatorJava.property(res, 'cfg', cluster, 'metricsUpdateFrequency');
-
-    res.needEmptyLine = true;
-
-    return res;
-};
-
-// Generate swap group.
-$generatorJava.clusterSwap = function (cluster, res) {
-    if (!res)
-        res = $generatorCommon.builder();
-
-    if (cluster.swapSpaceSpi && cluster.swapSpaceSpi.kind == 'FileSwapSpaceSpi') {
-        $generatorJava.beanProperty(res, 'cfg', cluster.swapSpaceSpi.FileSwapSpaceSpi, 'swapSpaceSpi', 'swapSpi',
-            $generatorCommon.SWAP_SPACE_SPI.className, $generatorCommon.SWAP_SPACE_SPI.fields, true);
-
-        res.needEmptyLine = true;
-    }
-
-    return res;
-};
-
-// Generate time group.
-$generatorJava.clusterTime = function (cluster, res) {
-    if (!res)
-        res = $generatorCommon.builder();
-
-    $generatorJava.property(res, 'cfg', cluster, 'clockSyncSamples');
-    $generatorJava.property(res, 'cfg', cluster, 'clockSyncFrequency');
-    $generatorJava.property(res, 'cfg', cluster, 'timeServerPortBase');
-    $generatorJava.property(res, 'cfg', cluster, 'timeServerPortRange');
-
-    res.needEmptyLine = true;
-
-    return res;
-};
-
-// Generate thread pools group.
-$generatorJava.clusterPools = function (cluster, res) {
-    if (!res)
-        res = $generatorCommon.builder();
-
-    $generatorJava.property(res, 'cfg', cluster, 'publicThreadPoolSize');
-    $generatorJava.property(res, 'cfg', cluster, 'systemThreadPoolSize');
-    $generatorJava.property(res, 'cfg', cluster, 'managementThreadPoolSize');
-    $generatorJava.property(res, 'cfg', cluster, 'igfsThreadPoolSize');
-
-    res.needEmptyLine = true;
-
-    return res;
-};
-
-// Generate transactions group.
-$generatorJava.clusterTransactions = function (cluster, res) {
-    if (!res)
-        res = $generatorCommon.builder();
-
-    $generatorJava.beanProperty(res, 'cfg', cluster.transactionConfiguration, 'transactionConfiguration',
-        'transactionConfiguration', $generatorCommon.TRANSACTION_CONFIGURATION.className,
-        $generatorCommon.TRANSACTION_CONFIGURATION.fields);
-
-    return res;
-};
-
-// Generate cache general group.
-$generatorJava.cacheGeneral = function (cache, varName, res) {
-    if (!res)
-        res = $generatorCommon.builder();
-
-    $generatorJava.property(res, varName, cache, 'name');
-
-    res.importClass('org.apache.ignite.cache.CacheAtomicityMode');
-    res.importClass('org.apache.ignite.cache.CacheMode');
-
-    $generatorJava.property(res, varName, cache, 'cacheMode', 'CacheMode');
-    $generatorJava.property(res, varName, cache, 'atomicityMode', 'CacheAtomicityMode');
-
-    if (cache.cacheMode == 'PARTITIONED')
-        $generatorJava.property(res, varName, cache, 'backups');
-
-    $generatorJava.property(res, varName, cache, 'readFromBackup');
-    $generatorJava.property(res, varName, cache, 'copyOnRead');
-    $generatorJava.property(res, varName, cache, 'invalidate');
-
-    res.needEmptyLine = true;
-
-    return res;
-};
-
-// Generate cache memory group.
-$generatorJava.cacheMemory = function (cache, varName, res) {
-    if (!res)
-        res = $generatorCommon.builder();
-
-    $generatorJava.property(res, varName, cache, 'memoryMode', 'CacheMemoryMode');
-    $generatorJava.property(res, varName, cache, 'offHeapMaxMemory');
-
-    res.needEmptyLine = true;
-
-    $generatorJava.evictionPolicy(res, varName, cache.evictionPolicy, 'evictionPolicy');
-
-    $generatorJava.property(res, varName, cache, 'swapEnabled');
-    $generatorJava.property(res, varName, cache, 'startSize');
-
-    res.needEmptyLine = true;
-
-    return res;
-};
-
-// Generate cache query & indexing group.
-$generatorJava.cacheQuery = function (cache, varName, res) {
-    if (!res)
-        res = $generatorCommon.builder();
-
-    $generatorJava.property(res, varName, cache, 'sqlOnheapRowCacheSize');
-    $generatorJava.property(res, varName, cache, 'longQueryWarningTimeout');
-
-    if (cache.indexedTypes && cache.indexedTypes.length > 0) {
-        res.emptyLineIfNeeded();
-
-        res.startBlock(varName + '.setIndexedTypes(');
-
-        var len = cache.indexedTypes.length - 1;
-
-        _.forEach(cache.indexedTypes, function(pair, ix) {
-            res.line($generatorJava.toJavaCode(res.importClass(pair.keyClass), 'class') + ', ' +
-                $generatorJava.toJavaCode(res.importClass(pair.valueClass), 'class') + (ix < len ? ',' : ''));
-        });
-
-        res.endBlock(');');
-    }
-
-    $generatorJava.multiparamProperty(res, varName, cache, 'sqlFunctionClasses', 'class');
-
-    $generatorJava.property(res, varName, cache, 'sqlEscapeAll');
-
-    res.needEmptyLine = true;
-
-    return res;
-};
-
-/**
- * Generate cache store group.
- *
- * @param cache Cache descriptor.
- * @param cacheVarName Cache variable name.
- * @param res Resulting output with generated code.
- * @returns {*} Java code for cache store configuration.
- */
-$generatorJava.cacheStore = function (cache, cacheVarName, res) {
-    if (!res)
-        res = $generatorCommon.builder();
-
-    if (cache.cacheStoreFactory && cache.cacheStoreFactory.kind) {
-        var factoryKind = cache.cacheStoreFactory.kind;
-
-        var storeFactory = cache.cacheStoreFactory[factoryKind];
-
-        if (storeFactory) {
-            var storeFactoryDesc = $generatorCommon.STORE_FACTORIES[factoryKind];
-
-            var dataSourceFound = false;
-
-            if (storeFactory.dialect) {
-                var dataSourceBean = storeFactory.dataSourceBean;
-
-                dataSourceFound = true;
-
-                if (!_.contains(res.datasources, dataSourceBean)) {
-                    res.datasources.push(dataSourceBean);
-
-                    var dsClsName = $generatorCommon.dataSourceClassName(storeFactory.dialect);
-
-                    res.needEmptyLine = true;
-
-                    $generatorJava.declareVariable(res, 'dataSource', dsClsName);
-
-                    switch (storeFactory.dialect) {
-                        case 'DB2':
-                            res.line('dataSource.setServerName(props.getProperty("' + dataSourceBean + '.jdbc.server_name"));');
-                            res.line('dataSource.setPortNumber(Integer.valueOf(props.getProperty("' + dataSourceBean + '.jdbc.port_number")));');
-                            res.line('dataSource.setDatabaseName(props.getProperty("' + dataSourceBean + '.jdbc.database_name"));');
-                            res.line('dataSource.setDriverType(Integer.valueOf(props.getProperty("' + dataSourceBean + '.jdbc.driver_type")));');
-                            break;
-
-                        default:
-                            res.line('dataSource.setURL(props.getProperty("' + dataSourceBean + '.jdbc.url"));');
-                    }
-
-                    res.line('dataSource.setUser(props.getProperty("' + dataSourceBean + '.jdbc.username"));');
-                    res.line('dataSource.setPassword(props.getProperty("' + dataSourceBean + '.jdbc.password"));');
-                }
-            }
-
-            if (factoryKind == 'CacheJdbcPojoStoreFactory') {
-                // Generate POJO store factory.
-                $generatorJava.declareVariable(res, 'storeFactory', 'org.apache.ignite.cache.store.jdbc.CacheJdbcPojoStoreFactory');
-
-                $generatorJava.declareVariable(res, 'storeFactoryCfg', 'org.apache.ignite.cache.store.jdbc.CacheJdbcPojoStoreConfiguration');
-
-                if (dataSourceFound)
-                    res.line('storeFactoryCfg.setDataSource(dataSource);');
-
-                res.line('storeFactoryCfg.setDialect(new ' +
-                    res.importClass($generatorCommon.jdbcDialectClassName(storeFactory.dialect)) + '());');
-
-                res.needEmptyLine = true;
-
-                if (cache.metadatas && cache.metadatas.length > 0) {
-                    $generatorJava.declareVariable(res, 'jdbcTypes', 'java.util.Collection', 'java.util.ArrayList', 'org.apache.ignite.cache.store.jdbc.JdbcType');
-
-                    res.needEmptyLine = true;
-
-                    _.forEach(cache.metadatas, function (meta) {
-                        $generatorJava.declareVariable(res, 'jdbcType', 'org.apache.ignite.cache.store.jdbc.JdbcType');
-
-                        res.needEmptyLine = true;
-
-                        $generatorJava.metadataStore(meta, true, res);
-
-                        res.needEmptyLine = true;
-
-                        res.line('jdbcTypes.add(jdbcType);');
-
-                        res.needEmptyLine = true;
-                    });
-
-                    res.line('storeFactoryCfg.setTypes(jdbcTypes);');
-
-                    res.needEmptyLine = true;
-                }
-
-                res.line('storeFactory.setConfiguration(storeFactoryCfg);');
-            }
-            else {
-                $generatorJava.beanProperty(res, cacheVarName, storeFactory, 'cacheStoreFactory', 'storeFactory',
-                    storeFactoryDesc.className, storeFactoryDesc.fields, true);
-
-                if (dataSourceFound)
-                    res.line('storeFactory.setDataSource(dataSource);');
-            }
-
-            res.needEmptyLine = true;
-        }
-
-        res.line(cacheVarName + '.setStoreFactory(storeFactory);');
-
-        res.needEmptyLine = true;
-    }
-
-    $generatorJava.property(res, cacheVarName, cache, 'loadPreviousValue');
-    $generatorJava.property(res, cacheVarName, cache, 'readThrough');
-    $generatorJava.property(res, cacheVarName, cache, 'writeThrough');
-
-    res.needEmptyLine = true;
-
-    $generatorJava.property(res, cacheVarName, cache, 'writeBehindEnabled');
-    $generatorJava.property(res, cacheVarName, cache, 'writeBehindBatchSize');
-    $generatorJava.property(res, cacheVarName, cache, 'writeBehindFlushSize');
-    $generatorJava.property(res, cacheVarName, cache, 'writeBehindFlushFrequency');
-    $generatorJava.property(res, cacheVarName, cache, 'writeBehindFlushThreadCount');
-
-    res.needEmptyLine = true;
-
-    return res;
-};
-
-// Generate cache concurrency group.
-$generatorJava.cacheConcurrency = function (cache, varName, res) {
-    if (!res)
-        res = $generatorCommon.builder();
-
-    $generatorJava.property(res, varName, cache, 'maxConcurrentAsyncOperations');
-    $generatorJava.property(res, varName, cache, 'defaultLockTimeout');
-    $generatorJava.property(res, varName, cache, 'atomicWriteOrderMode', res.importClass('org.apache.ignite.cache.CacheAtomicWriteOrderMode'));
-    $generatorJava.property(res, varName, cache, 'writeSynchronizationMode', res.importClass('org.apache.ignite.cache.CacheWriteSynchronizationMode'));
-
-    res.needEmptyLine = true;
-
-    return res;
-};
-
-// Generate cache rebalance group.
-$generatorJava.cacheRebalance = function (cache, varName, res) {
-    if (!res)
-        res = $generatorCommon.builder();
-
-    if (cache.cacheMode != 'LOCAL') {
-        $generatorJava.property(res, varName, cache, 'rebalanceMode', 'CacheRebalanceMode');
-        $generatorJava.property(res, varName, cache, 'rebalanceThreadPoolSize');
-        $generatorJava.property(res, varName, cache, 'rebalanceBatchSize');
-        $generatorJava.property(res, varName, cache, 'rebalanceOrder');
-        $generatorJava.property(res, varName, cache, 'rebalanceDelay');
-        $generatorJava.property(res, varName, cache, 'rebalanceTimeout');
-        $generatorJava.property(res, varName, cache, 'rebalanceThrottle');
-
-        res.needEmptyLine = true;
-    }
-
-    if (cache.igfsAffinnityGroupSize) {
-        res.line(varName + '.setAffinityMapper(new ' + res.importClass('org.apache.ignite.igfs.IgfsGroupDataBlocksKeyMapper') + '(' + cache.igfsAffinnityGroupSize + '));');
-
-        res.needEmptyLine = true;
-    }
-
-    return res;
-};
-
-// Generate cache server near cache group.
-$generatorJava.cacheServerNearCache = function (cache, varName, res) {
-    if (!res)
-        res = $generatorCommon.builder();
-
-    if (cache.cacheMode == 'PARTITIONED' && cache.nearCacheEnabled) {
-        res.needEmptyLine = true;
-
-        res.importClass('org.apache.ignite.configuration.NearCacheConfiguration');
-
-        $generatorJava.beanProperty(res, varName, cache.nearConfiguration, 'nearConfiguration', 'nearConfiguration',
-            'NearCacheConfiguration', {nearStartSize: null}, true);
-
-        if (cache.nearConfiguration && cache.nearConfiguration.nearEvictionPolicy && cache.nearConfiguration.nearEvictionPolicy.kind) {
-            $generatorJava.evictionPolicy(res, 'nearConfiguration', cache.nearConfiguration.nearEvictionPolicy, 'nearEvictionPolicy');
-        }
-
-        res.needEmptyLine = true;
-    }
-
-    return res;
-};
-
-// Generate cache statistics group.
-$generatorJava.cacheStatistics = function (cache, varName, res) {
-    if (!res)
-        res = $generatorCommon.builder();
-
-    $generatorJava.property(res, varName, cache, 'statisticsEnabled');
-    $generatorJava.property(res, varName, cache, 'managementEnabled');
-
-    res.needEmptyLine = true;
-
-    return res;
-};
-
-// Generate metadata query fields.
-$generatorJava.metadataQueryFields = function (res, meta) {
-    var fields = meta.fields;
-
-    if (fields && fields.length > 0) {
-        $generatorJava.declareVariable(res, 'fields', 'java.util.LinkedHashMap', 'java.util.LinkedHashMap', 'java.lang.String', 'java.lang.String');
-
-        _.forEach(fields, function (field) {
-            res.line('fields.put("' + field.name + '", "' + $dataStructures.fullClassName(field.className) + '");');
-        });
-
-        res.needEmptyLine = true;
-
-        res.line('queryMeta.setFields(fields);');
-
-        res.needEmptyLine = true;
-    }
-};
-
-// Generate metadata query aliases.
-$generatorJava.metadataQueryAliases = function (res, meta) {
-    var aliases = meta.aliases;
-
-    if (aliases && aliases.length > 0) {
-        $generatorJava.declareVariable(res, 'aliases', 'java.util.Map', 'java.util.HashMap', 'java.lang.String', 'java.lang.String');
-
-        _.forEach(aliases, function (alias) {
-            res.line('aliases.put("' + alias.field + '", "' + alias.alias + '");');
-        });
-
-        res.needEmptyLine = true;
-
-        res.line('queryMeta.setAliases(aliases);');
-
-        res.needEmptyLine = true;
-    }
-};
-
-// Generate metadata indexes.
-$generatorJava.metadataQueryIndexes = function (res, meta) {
-    var indexes = meta.indexes;
-
-    if (indexes && indexes.length > 0) {
-        res.needEmptyLine = true;
-
-        $generatorJava.declareVariable(res, 'indexes', 'java.util.Map', 'java.util.LinkedHashMap', 'String', 'org.apache.ignite.cache.store.QueryEntityIndex');
-
-        _.forEach(indexes, function (index) {
-            res.needEmptyLine = true;
-
-            $generatorJava.declareVariable(res, 'index', 'org.apache.ignite.cache.store.QueryEntityIndex');
-
-            $generatorJava.property(res, 'index', index, 'name');
-            $generatorJava.property(res, 'index', index, 'type', 'org.apache.ignite.cache.store.QueryEntityIndex.Type');
-
-            var fields = index.fields;
-
-            if (fields && fields.length > 0) {
-                $generatorJava.declareVariable(res, 'indFlds', 'java.util.LinkedHashMap', 'java.util.LinkedHashMap', 'String', 'Boolean');
-
-                _.forEach(fields, function(field) {
-                    res.line('indFlds.put("' + field.name + '", ' + field.direction + ');');
-                });
-
-                res.needEmptyLine = true;
-
-                res.line('index.setFields(indFlds);');
-
-                res.needEmptyLine = true;
-            }
-
-            res.line('indexes.add(index);');
-        });
-
-        res.needEmptyLine = true;
-
-        res.line('queryMeta.setIndexes(indexes);');
-
-        res.needEmptyLine = true;
-    }
-};
-
-// Generate metadata db fields.
-$generatorJava.metadataDatabaseFields = function (res, meta, fieldProperty) {
-    var dbFields = meta[fieldProperty];
-
-    if (dbFields && dbFields.length > 0) {
-        res.needEmptyLine = true;
-
-        res.importClass('java.sql.Types');
-
-        res.startBlock('jdbcType.' + $commonUtils.toJavaName('set', fieldProperty) + '(');
-
-        var lastIx = dbFields.length - 1;
-
-        _.forEach(dbFields, function (field, ix) {
-            res.line('new JdbcTypeField(' +
-                'Types.' + field.databaseType + ', ' + '"' + field.databaseName + '", ' +
-                res.importClass(field.javaType) + '.class, ' + '"' + field.javaName + '"'+ ')' + (ix < lastIx ? ',' : ''));
-        });
-
-        res.endBlock(');');
-
-        res.needEmptyLine = true;
-    }
-};
-
-// Generate metadata general group.
-$generatorJava.metadataGeneral = function (meta, res) {
-    if (!res)
-        res = $generatorCommon.builder();
-
-    $generatorJava.classNameProperty(res, 'typeMeta', meta, 'keyType');
-    $generatorJava.classNameProperty(res, 'typeMeta', meta, 'valueType');
-
-    res.needEmptyLine = true;
-
-    return res;
-};
-
-// Generate metadata for query group.
-$generatorJava.metadataQuery = function (meta, res) {
-    if (!res)
-        res = $generatorCommon.builder();
-
-    $generatorJava.metadataQueryFields(res, meta);
-
-    $generatorJava.metadataQueryAliases(res, meta);
-
-    $generatorJava.metadataQueryIndexes(res, meta);
-
-    res.needEmptyLine = true;
-
-    return res;
-};
-
-// Generate metadata for store group.
-$generatorJava.metadataStore = function (meta, withTypes, res) {
-    if (!res)
-        res = $generatorCommon.builder();
-
-    $generatorJava.property(res, 'jdbcType', meta, 'databaseSchema');
-    $generatorJava.property(res, 'jdbcType', meta, 'databaseTable');
-    $generatorJava.property(res, 'jdbcType', meta, 'keepSerialized', null, null, false);
-
-    if (withTypes) {
-        $generatorJava.property(res, 'jdbcType', meta, 'keyType');
-        $generatorJava.property(res, 'jdbcType', meta, 'valueType');
-    }
-
-    $generatorJava.metadataDatabaseFields(res, meta, 'keyFields');
-
-    $generatorJava.metadataDatabaseFields(res, meta, 'valueFields');
-
-    res.needEmptyLine = true;
-
-    return res;
-};
-
-// Generate cache type metadata config.
-$generatorJava.cacheMetadata = function(meta, res) {
-    $generatorJava.declareVariable(res, 'typeMeta', 'org.apache.ignite.cache.CacheTypeMetadata');
-
-    $generatorJava.metadataGeneral(meta, res);
-
-    res.emptyLineIfNeeded();
-    res.line('types.add(typeMeta);');
-
-    res.needEmptyLine = true;
-};
-
-// Generate cache type metadata config.
-$generatorJava.cacheQueryMetadata = function(meta, res) {
-    $generatorJava.declareVariable(res, 'queryMeta', 'org.apache.ignite.cache.store.QueryEntity');
-
-    $generatorJava.classNameProperty(res, 'queryMeta', meta, 'keyType');
-    $generatorJava.classNameProperty(res, 'queryMeta', meta, 'valueType');
-
-    res.needEmptyLine = true;
-
-    $generatorJava.metadataQuery(meta, res);
-
-    res.emptyLineIfNeeded();
-    res.line('queryEntities.add(queryMeta);');
-
-    res.needEmptyLine = true;
-};
-
-// Generate cache type metadata configs.
-$generatorJava.cacheMetadatas = function (metadatas, varName, res) {
-    if (!res)
-        res = $generatorCommon.builder();
-
-    // Generate cache type metadata configs.
-    if (metadatas && metadatas.length > 0) {
-        $generatorJava.declareVariable(res, 'types', 'java.util.Collection', 'java.util.ArrayList', 'org.apache.ignite.cache.CacheTypeMetadata');
-
-        _.forEach(metadatas, function (meta) {
-            $generatorJava.cacheMetadata(meta, res);
-        });
-
-        res.line(varName + '.setTypeMetadata(types);');
-
-        res.needEmptyLine = true;
-
-        $generatorJava.declareVariable(res, 'queryEntities', 'java.util.Collection', 'java.util.ArrayList', 'org.apache.ignite.cache.store.QueryEntity');
-
-        _.forEach(metadatas, function (meta) {
-            $generatorJava.cacheQueryMetadata(meta, res);
-        });
-
-        res.line(varName + '.setQueryEntities(queryEntities);');
-
-        res.needEmptyLine = true;
-    }
-
-    return res;
-};
-
-// Generate cache configs.
-$generatorJava.cache = function(cache, varName, res) {
-    if (!res)
-        res = $generatorCommon.builder();
-
-    $generatorJava.cacheGeneral(cache, varName, res);
-
-    $generatorJava.cacheMemory(cache, varName, res);
-
-    $generatorJava.cacheQuery(cache, varName, res);
-
-    $generatorJava.cacheStore(cache, varName, res);
-
-    $generatorJava.cacheConcurrency(cache, varName, res);
-
-    $generatorJava.cacheRebalance(cache, varName, res);
-
-    $generatorJava.cacheServerNearCache(cache, varName, res);
-
-    $generatorJava.cacheStatistics(cache, varName, res);
-
-    $generatorJava.cacheMetadatas(cache.metadatas, varName, res);
-};
-
-// Generate cluster caches.
-$generatorJava.clusterCaches = function (caches, igfss, res) {
-    function clusterCache(res, cache, names) {
-        res.emptyLineIfNeeded();
-
-        var cacheName = $commonUtils.toJavaName('cache', cache.name);
-
-        $generatorJava.declareVariable(res, cacheName, 'org.apache.ignite.configuration.CacheConfiguration');
-
-        $generatorJava.cache(cache, cacheName, res);
-
-        names.push(cacheName);
-
-        res.needEmptyLine = true;
-    }
-
-    if (!res)
-        res = $generatorCommon.builder();
-
-    var names = [];
-
-    if (caches && caches.length > 0) {
-        res.emptyLineIfNeeded();
-
-        _.forEach(caches, function (cache) {
-            clusterCache(res, cache, names);
-        });
-
-        res.needEmptyLine = true;
-    }
-
-    if (igfss && igfss.length > 0) {
-        res.emptyLineIfNeeded();
-
-        _.forEach(igfss, function (igfs) {
-            clusterCache(res, $generatorCommon.igfsDataCache(igfs), names);
-            clusterCache(res, $generatorCommon.igfsMetaCache(igfs), names);
-        });
-
-        res.needEmptyLine = true;
-    }
-
-    if (names.length > 0) {
-        res.line('cfg.setCacheConfiguration(' + names.join(', ') + ');');
-
-        res.needEmptyLine = true;
-    }
-
-    return res;
-};
-
-/**
- * Generate java class code.
- *
- * @param meta Metadata object.
- * @param key If 'true' then key class should be generated.
- * @param pkg Package name.
- * @param useConstructor If 'true' then empty and full constructors should be generated.
- * @param includeKeyFields If 'true' then include key fields into value POJO.
- * @param res Resulting output with generated code.
- */
-$generatorJava.javaClassCode = function (meta, key, pkg, useConstructor, includeKeyFields, res) {
-    if (!res)
-        res = $generatorCommon.builder();
-
-    var type = (key ? meta.keyType : meta.valueType);
-    type = type.substring(type.lastIndexOf('.') + 1);
-
-    // Class comment.
-    res.line('/**');
-    res.line(' * ' + type + ' definition.');
-    res.line(' *');
-    res.line(' * ' + $generatorCommon.mainComment());
-    res.line(' */');
-
-    res.startBlock('public class ' + type + ' implements ' + res.importClass('java.io.Serializable') + ' {');
-
-    res.line('/** */');
-    res.line('private static final long serialVersionUID = 0L;');
-    res.needEmptyLine = true;
-
-    var allFields = (key || includeKeyFields) ? meta.keyFields.slice() : [];
-
-    if (!key)
-        _.forEach(meta.valueFields, function (valFld) {
-            if (_.findIndex(allFields, function(fld) {
-                return fld.javaName == valFld.javaName;
-            }) < 0)
-                allFields.push(valFld);
-        });
-
-    // Generate allFields declaration.
-    _.forEach(allFields, function (field) {
-        var fldName = field.javaName;
-
-        res.line('/** Value for ' + fldName + '. */');
-
-        res.line('private ' + res.importClass(field.javaType) + ' ' + fldName + ';');
-
-        res.needEmptyLine = true;
-    });
-
-    // Generate constructors.
-    if (useConstructor) {
-        res.line('/**');
-        res.line(' * Empty constructor.');
-        res.line(' */');
-        res.startBlock('public ' + type + '() {');
-        res.line('// No-op.');
-        res.endBlock('}');
-
-        res.needEmptyLine = true;
-
-        res.line('/**');
-        res.line(' * Full constructor.');
-        res.line(' */');
-        res.startBlock('public ' + type + '(');
-
-        _.forEach(allFields, function(field) {
-            res.line(res.importClass(field.javaType) + ' ' + field.javaName + (fldIx < allFields.length - 1 ? ',' : ''))
-        });
-
-        res.endBlock(') {');
-
-        res.startBlock();
-
-        _.forEach(allFields, function (field) {
-            res.line('this.' + field.javaName +' = ' + field.javaName + ';');
-        });
-
-        res.endBlock('}');
-
-        res.needEmptyLine = true;
-    }
-
-    // Generate getters and setters methods.
-    _.forEach(allFields, function (field) {
-        var fldName = field.javaName;
-
-        var fldType = res.importClass(field.javaType);
-
-        res.line('/**');
-        res.line(' * Gets ' + fldName + '.');
-        res.line(' *');
-        res.line(' * @return Value for ' + fldName + '.');
-        res.line(' */');
-        res.startBlock('public ' + fldType + ' ' + $commonUtils.toJavaName('get', fldName) + '() {');
-        res.line('return ' + fldName + ';');
-        res.endBlock('}');
-
-        res.needEmptyLine = true;
-
-        res.line('/**');
-        res.line(' * Sets ' + fldName + '.');
-        res.line(' *');
-        res.line(' * @param ' + fldName + ' New value for ' + fldName + '.');
-        res.line(' */');
-        res.startBlock('public void ' + $commonUtils.toJavaName('set', fldName) + '(' + fldType + ' ' + fldName + ') {');
-        res.line('this.' + fldName + ' = ' + fldName + ';');
-        res.endBlock('}');
-
-        res.needEmptyLine = true;
-    });
-
-    // Generate equals() method.
-    res.line('/** {@inheritDoc} */');
-    res.startBlock('@Override public boolean equals(Object o) {');
-    res.startBlock('if (this == o)');
-    res.line('return true;');
-    res.endBlock();
-    res.append('');
-
-    res.startBlock('if (!(o instanceof ' + type + '))');
-    res.line('return false;');
-    res.endBlock();
-
-    res.needEmptyLine = true;
-
-    res.line(type + ' that = (' + type + ')o;');
-
-    _.forEach(allFields, function (field) {
-        res.needEmptyLine = true;
-
-        var javaName = field.javaName;
-
-        res.startBlock('if (' + javaName + ' != null ? !' + javaName + '.equals(that.' + javaName + ') : that.' + javaName + ' != null)');
-
-        res.line('return false;');
-        res.endBlock()
-    });
-
-    res.needEmptyLine = true;
-
-    res.line('return true;');
-    res.endBlock('}');
-
-    res.needEmptyLine = true;
-
-    // Generate hashCode() method.
-    res.line('/** {@inheritDoc} */');
-    res.startBlock('@Override public int hashCode() {');
-
-    var first = true;
-
-    _.forEach(allFields, function (field) {
-        var javaName = field.javaName;
-
-        if (!first)
-            res.needEmptyLine = true;
-
-        res.line(first ? 'int res = ' + javaName + ' != null ? ' + javaName + '.hashCode() : 0;'
-            : 'res = 31 * res + (' + javaName + ' != null ? ' + javaName + '.hashCode() : 0);');
-
-        first = false;
-    });
-
-    res.needEmptyLine = true;
-    res.line('return res;');
-    res.endBlock('}');
-    res.needEmptyLine = true;
-
-    // Generate toString() method.
-    res.line('/** {@inheritDoc} */');
-    res.startBlock('@Override public String toString() {');
-
-    if (allFields.length > 0) {
-        field = allFields[0];
-
-        res.startBlock('return \"' + type + ' [' + field.javaName + '=\" + ' + field.javaName + ' +', type);
-
-        for (fldIx = 1; fldIx < allFields.length; fldIx ++) {
-            field = allFields[fldIx];
-
-            var javaName = field.javaName;
-
-            res.line('\", ' + javaName + '=\" + ' + field.javaName + ' +');
-        }
-    }
-
-    res.line('\']\';');
-    res.endBlock();
-    res.endBlock('}');
-
-    res.endBlock('}');
-
-    return 'package ' + pkg + ';' + '\n\n' + res.generateImports() + '\n\n' + res.asString();
-};
-
-/**
- * Generate source code for type by its metadata.
- *
- * @param caches List of caches to generate POJOs for.
- * @param useConstructor If 'true' then generate constructors.
- * @param includeKeyFields If 'true' then include key fields into value POJO.
- */
-$generatorJava.pojos = function (caches, useConstructor, includeKeyFields) {
-    var metadataNames = [];
-
-    $generatorJava.metadatas = [];
-
-    _.forEach(caches, function(cache) {
-        _.forEach(cache.metadatas, function(meta) {
-            // Skip already generated classes.
-            if (metadataNames.indexOf(meta.valueType) < 0) {
-                // Skip metadata without value fields.
-                if ($commonUtils.isDefined(meta.valueFields) && meta.valueFields.length > 0) {
-                    var metadata = {};
-
-                    // Key class generation only if key is not build in java class.
-                    if ($commonUtils.isDefined(meta.keyFields) && meta.keyFields.length > 0) {
-                        metadata.keyType = meta.keyType;
-                        metadata.keyClass = $generatorJava.javaClassCode(meta, true,
-                            meta.keyType.substring(0, meta.keyType.lastIndexOf('.')), useConstructor, includeKeyFields);
-                    }
-
-                    metadata.valueType = meta.valueType;
-                    metadata.valueClass = $generatorJava.javaClassCode(meta, false,
-                        meta.valueType.substring(0, meta.valueType.lastIndexOf('.')), useConstructor, includeKeyFields);
-
-                    $generatorJava.metadatas.push(metadata);
-                }
-
-                metadataNames.push(meta.valueType);
-            }
-        });
-    });
-};
-
-/**
- * @param type Full type name.
- * @return Field java type name.
- */
-$generatorJava.javaTypeName = function(type) {
-    var ix = $generatorJava.javaBuildInClasses.indexOf(type);
-
-    var resType = ix >= 0 ? $generatorJava.javaBuildInFullNameClasses[ix] : type;
-
-    return resType.indexOf("java.lang.") >= 0 ? resType.substring(10) : resType;
-};
-
-/**
- * Java code generator for cluster's SSL configuration.
- *
- * @param cluster Cluster to get SSL configuration.
- * @param res Optional configuration presentation builder object.
- * @returns Configuration presentation builder object
- */
-$generatorJava.clusterSsl = function(cluster, res) {
-    if (!res)
-        res = $generatorCommon.builder();
-
-    if (cluster.sslEnabled && $commonUtils.isDefined(cluster.sslContextFactory)) {
-
-        cluster.sslContextFactory.keyStorePassword = $commonUtils.isDefinedAndNotEmpty(cluster.sslContextFactory.keyStoreFilePath) ?
-            'props.getProperty("ssl.key.storage.password").toCharArray()' : undefined;
-
-        cluster.sslContextFactory.trustStorePassword = $commonUtils.isDefinedAndNotEmpty(cluster.sslContextFactory.trustStoreFilePath) ?
-            'props.getProperty("ssl.trust.storage.password").toCharArray()' : undefined;
-
-        var propsDesc = $commonUtils.isDefinedAndNotEmpty(cluster.sslContextFactory.trustManagers) ?
-            $generatorCommon.SSL_CONFIGURATION_TRUST_MANAGER_FACTORY.fields :
-            $generatorCommon.SSL_CONFIGURATION_TRUST_FILE_FACTORY.fields;
-
-        $generatorJava.beanProperty(res, 'cfg', cluster.sslContextFactory, 'sslContextFactory', 'sslContextFactory',
-            'org.apache.ignite.ssl.SslContextFactory', propsDesc, true);
-
-        res.needEmptyLine = true;
-    }
-
-    return res;
-};
-
-/**
- * Java code generator for cluster's IGFS configurations.
- *
- * @param igfss List of configured IGFS.
- * @param varName Name of IGFS configuration variable.
- * @param res Optional configuration presentation builder object.
- * @returns Configuration presentation builder object.
- */
-$generatorJava.igfss = function(igfss, varName, res) {
-    if (!res)
-        res = $generatorCommon.builder();
-
-    if ($commonUtils.isDefinedAndNotEmpty(igfss)) {
-        res.emptyLineIfNeeded();
-
-        var arrayName = 'fileSystems';
-        var igfsInst = 'igfs';
-
-        res.line(res.importClass('org.apache.ignite.configuration.FileSystemConfiguration') + '[] ' + arrayName + ' = new FileSystemConfiguration[' + igfss.length + '];');
-
-        _.forEach(igfss, function(igfs, ix) {
-            $generatorJava.declareVariable(res, igfsInst, 'org.apache.ignite.configuration.FileSystemConfiguration');
-
-            $generatorJava.igfsGeneral(igfs, igfsInst, res);
-            $generatorJava.igfsIPC(igfs, igfsInst, res);
-            $generatorJava.igfsFragmentizer(igfs, igfsInst, res);
-            $generatorJava.igfsDualMode(igfs, igfsInst, res);
-            $generatorJava.igfsSecondFS(igfs, igfsInst, res);
-            $generatorJava.igfsMisc(igfs, igfsInst, res);
-
-            res.line(arrayName + '[' + ix + '] = ' + igfsInst + ';');
-
-            res.needEmptyLine = true;
-        });
-
-        res.line(varName + '.' + 'setFileSystemConfiguration(' + arrayName + ');');
-
-        res.needEmptyLine = true;
-    }
-
-    return res;
-};
-
-/**
- * Java code generator for IGFS IPC configuration.
- *
- * @param igfs Configured IGFS.
- * @param varName Name of IGFS configuration variable.
- * @param res Optional configuration presentation builder object.
- * @returns Configuration presentation builder object.
- */
-$generatorJava.igfsIPC = function(igfs, varName, res) {
-    if (!res)
-        res = $generatorCommon.builder();
-
-    if (igfs.ipcEndpointEnabled) {
-        var desc = $generatorCommon.IGFS_IPC_CONFIGURATION;
-
-        $generatorJava.beanProperty(res, varName, igfs.ipcEndpointConfiguration, 'ipcEndpointConfiguration', 'ipcEndpointCfg',
-            desc.className, desc.fields, true);
-
-        res.needEmptyLine = true;
-    }
-
-    return res;
-};
-
-/**
- * Java code generator for IGFS fragmentizer configuration.
- *
- * @param igfs Configured IGFS.
- * @param varName Name of IGFS configuration variable.
- * @param res Optional configuration presentation builder object.
- * @returns Configuration presentation builder object.
- */
-$generatorJava.igfsFragmentizer = function(igfs, varName, res) {
-    if (!res)
-        res = $generatorCommon.builder();
-
-    if (igfs.fragmentizerEnabled) {
-        $generatorJava.property(res, varName, igfs, 'fragmentizerConcurrentFiles', null, null, 0);
-        $generatorJava.property(res, varName, igfs, 'fragmentizerThrottlingBlockLength', null, null, 16777216);
-        $generatorJava.property(res, varName, igfs, 'fragmentizerThrottlingDelay', null, null, 200);
-
-        res.needEmptyLine = true;
-    }
-    else
-        $generatorJava.property(res, varName, igfs, 'fragmentizerEnabled');
-
-    return res;
-};
-
-/**
- * Java code generator for IGFS dual mode configuration.
- *
- * @param igfs Configured IGFS.
- * @param varName Name of IGFS configuration variable.
- * @param res Optional configuration presentation builder object.
- * @returns Configuration presentation builder object.
- */
-$generatorJava.igfsDualMode = function(igfs, varName, res) {
-    if (!res)
-        res = $generatorCommon.builder();
-
-    $generatorJava.property(res, varName, igfs, 'dualModeMaxPendingPutsSize', null, null, 0);
-
-    if ($commonUtils.isDefinedAndNotEmpty(igfs.dualModePutExecutorService))
-        res.line(varName + '.' + $generatorJava.setterName('dualModePutExecutorService') + '(new ' + res.importClass(igfs.dualModePutExecutorService) + '());');
-
-    $generatorJava.property(res, varName, igfs, 'dualModePutExecutorServiceShutdown', null, null, false);
-
-    res.needEmptyLine = true;
-
-    return res;
-};
-
-$generatorJava.igfsSecondFS = function(igfs, varName, res) {
-    if (!res)
-        res = $generatorCommon.builder();
-
-    if (igfs.secondaryFileSystemEnabled) {
-        var secondFs = igfs.secondaryFileSystem || {};
-
-        var uriDefined = $commonUtils.isDefinedAndNotEmpty(secondFs.uri);
-        var nameDefined = $commonUtils.isDefinedAndNotEmpty(secondFs.userName);
-        var cfgDefined = $commonUtils.isDefinedAndNotEmpty(secondFs.cfgPath);
-
-        res.line(varName + '.setSecondaryFileSystem(new ' +
-            res.importClass('org.apache.ignite.hadoop.fs.IgniteHadoopIgfsSecondaryFileSystem') + '(' +
-                (uriDefined ? '"' + secondFs.uri + '"' : 'null') +
-                (cfgDefined || nameDefined ? (cfgDefined ? ', "' + secondFs.cfgPath + '"' : ', null') : '') +
-                (nameDefined ? ', "' + secondFs.userName + '"' : '') +
-            '));');
-
-        res.needEmptyLine = true;
-    }
-
-    return res;
-};
-
-/**
- * Java code generator for IGFS general configuration.
- *
- * @param igfs Configured IGFS.
- * @param varName Name of IGFS configuration variable.
- * @param res Optional configuration presentation builder object.
- * @returns Configuration presentation builder object.
- */
-$generatorJava.igfsGeneral = function(igfs, varName, res) {
-    if (!res)
-        res = $generatorCommon.builder();
-
-    if ($commonUtils.isDefinedAndNotEmpty(igfs.name)) {
-        igfs.dataCacheName = $generatorCommon.igfsDataCache(igfs).name;
-        igfs.metaCacheName = $generatorCommon.igfsMetaCache(igfs).name;
-
-        $generatorJava.property(res, varName, igfs, 'name');
-        $generatorJava.property(res, varName, igfs, 'dataCacheName');
-        $generatorJava.property(res, varName, igfs, 'metaCacheName');
-
-        res.needEmptyLine = true;
-    }
-
-    return res;
-};
-
-/**
- * Java code generator for IGFS misc configuration.
- *
- * @param igfs Configured IGFS.
- * @param varName Name of IGFS configuration variable.
- * @param res Optional configuration presentation builder object.
- * @returns Configuration presentation builder object.
- */
-$generatorJava.igfsMisc = function(igfs, varName, res) {
-    if (!res)
-        res = $generatorCommon.builder();
-
-    $generatorJava.property(res, varName, igfs, 'blockSize', null, null, 65536);
-    $generatorJava.property(res, varName, igfs, 'streamBufferSize', null, null, 65536);
-    $generatorJava.property(res, varName, igfs, 'defaultMode', res.importClass('org.apache.ignite.igfs.IgfsMode'), undefined, "DUAL_ASYNC");
-    $generatorJava.property(res, varName, igfs, 'maxSpaceSize', null, null, 0);
-    $generatorJava.property(res, varName, igfs, 'maximumTaskRangeLength', null, null, 0);
-    $generatorJava.property(res, varName, igfs, 'managementPort', null, null, 11400);
-
-    if (igfs.pathModes && igfs.pathModes.length > 0) {
-        res.needEmptyLine = true;
-
-        $generatorJava.declareVariable(res, 'pathModes', 'java.util.Map', 'java.util.HashMap', 'String', 'org.apache.ignite.igfs.IgfsMode');
-
-        _.forEach(igfs.pathModes, function (pair) {
-            res.line('pathModes.put("' + pair.path + '", IgfsMode.' + pair.mode +');');
-        });
-
-        res.needEmptyLine = true;
-
-        res.line(varName + '.setPathModes(pathModes);');
-    }
-
-    $generatorJava.property(res, varName, igfs, 'perNodeBatchSize', null, null, 100);
-    $generatorJava.property(res, varName, igfs, 'perNodeParallelBatchCount', null, null, 8);
-    $generatorJava.property(res, varName, igfs, 'prefetchBlocks', null, null, 0);
-    $generatorJava.property(res, varName, igfs, 'sequentialReadsBeforePrefetch', null, null, 0);
-    $generatorJava.property(res, varName, igfs, 'trashPurgeTimeout', null, null, 1000);
-
-    res.needEmptyLine = true;
-
-    return res;
-};
-
-/**
- * Function to generate java code for cluster configuration.
- *
- * @param cluster Cluster to process.
- * @param javaClass Class name for generate factory class otherwise generate code snippet.
- * @param clientNearCfg Near cache configuration for client node.
- */
-$generatorJava.cluster = function (cluster, javaClass, clientNearCfg) {
-    var res = $generatorCommon.builder();
-
-    if (cluster) {
-        if (javaClass) {
-            res.line('/**');
-            res.line(' * ' + $generatorCommon.mainComment());
-            res.line(' */');
-            res.startBlock('public class ' + javaClass + ' {');
-            res.line('/**');
-            res.line(' * Configure grid.');
-            res.line(' *');
-            res.line(' * @return Ignite configuration.');
-            res.line(' * @throws Exception If failed to construct Ignite configuration instance.');
-            res.line(' */');
-            res.startBlock('public static IgniteConfiguration createConfiguration() throws Exception {');
-        }
-
-        var haveDS = _.findIndex(cluster.caches, function(cache) {
-            if (cache.cacheStoreFactory && cache.cacheStoreFactory.kind) {
-                var factory = cache.cacheStoreFactory[cache.cacheStoreFactory.kind];
-
-                if (factory && factory.dialect)
-                    return true;
-            }
-
-            return false;
-        }) >= 0;
-
-        if (haveDS || cluster.sslEnabled) {
-            res.line(res.importClass('java.net.URL') + ' res = IgniteConfiguration.class.getResource("/secret.properties");');
-
-            res.needEmptyLine = true;
-
-            res.line(res.importClass('java.io.File') + ' propsFile = new File(res.toURI());');
-
-            res.needEmptyLine = true;
-
-            res.line(res.importClass('java.util.Properties') + ' props = new Properties();');
-
-            res.needEmptyLine = true;
-
-            res.startBlock('try (' + res.importClass('java.io.InputStream') + ' in = new ' + res.importClass('java.io.FileInputStream') + '(propsFile)) {');
-            res.line('props.load(in);');
-            res.endBlock('}');
-
-            res.needEmptyLine = true;
-        }
-
-        $generatorJava.clusterGeneral(cluster, clientNearCfg, res);
-
-        $generatorJava.clusterAtomics(cluster, res);
-
-        $generatorJava.clusterCommunication(cluster, res);
-
-        $generatorJava.clusterConnector(cluster, res);
-
-        $generatorJava.clusterDeployment(cluster, res);
-
-        $generatorJava.clusterEvents(cluster, res);
-
-        $generatorJava.clusterMarshaller(cluster, res);
-
-        $generatorJava.clusterMetrics(cluster, res);
-
-        $generatorJava.clusterSwap(cluster, res);
-
-        $generatorJava.clusterTime(cluster, res);
-
-        $generatorJava.clusterPools(cluster, res);
-
-        $generatorJava.clusterTransactions(cluster, res);
-
-        $generatorJava.clusterCaches(cluster.caches, cluster.igfss, res);
-
-        $generatorJava.clusterSsl(cluster, res);
-
-        $generatorJava.igfss(cluster.igfss, 'cfg', res);
-
-        if (javaClass) {
-            res.importClass('org.apache.ignite.Ignite');
-            res.importClass('org.apache.ignite.Ignition');
-
-            res.line('return cfg;');
-            res.endBlock('}');
-
-            res.needEmptyLine = true;
-
-            res.line('/**');
-            res.line(' * Sample usage of ' + javaClass + '.');
-            res.line(' *');
-            res.line(' * @param args Command line arguments, none required.');
-            res.line(' * @throws Exception If sample execution failed.');
-            res.line(' */');
-
-            res.startBlock('public static void main(String[] args) throws Exception {');
-            res.startBlock('try (Ignite ignite = Ignition.start(' + javaClass + '.createConfiguration())) {');
-            res.line('System.out.println("Write some code here...");');
-            res.endBlock('}');
-            res.endBlock('}');
-
-            res.endBlock('}');
-
-            return res.generateImports() + '\n\n' + res.asString();
-        }
-    }
-
-    return res.asString();
-};
-
-// For server side we should export Java code generation entry point.
-if (typeof window === 'undefined') {
-    module.exports = $generatorJava;
-}


[3/7] ignite git commit: IGNITE-1857 Generate configuration zip on client side.

Posted by an...@apache.org.
http://git-wip-us.apache.org/repos/asf/ignite/blob/ce945056/modules/control-center-web/src/main/js/public/js/jszip.min.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/public/js/jszip.min.js b/modules/control-center-web/src/main/js/public/js/jszip.min.js
new file mode 100644
index 0000000..bbf06cb
--- /dev/null
+++ b/modules/control-center-web/src/main/js/public/js/jszip.min.js
@@ -0,0 +1,14 @@
+/*!
+
+ JSZip - A Javascript class for generating and reading zip files
+ <http://stuartk.com/jszip>
+
+ (c) 2009-2014 Stuart Knightley <stuart [at] stuartk.com>
+ Dual licenced under the MIT license or GPLv3. See https://raw.github.com/Stuk/jszip/master/LICENSE.markdown.
+
+ JSZip uses the library pako released under the MIT license :
+ https://github.com/nodeca/pako/blob/master/LICENSE
+ */
+!function(a){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=a();else if("function"==typeof define&&define.amd)define([],a);else{var b;"undefined"!=typeof window?b=window:"undefined"!=typeof global?b=global:"undefined"!=typeof self&&(b=self),b.JSZip=a()}}(function(){return function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);throw new Error("Cannot find module '"+g+"'")}var j=c[g]={exports:{}};b[g][0].call(j.exports,function(a){var c=b[g][1][a];return e(c?c:a)},j,j.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g<d.length;g++)e(d[g]);return e}({1:[function(a,b,c){"use strict";var d="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";c.encode=function(a){for(var b,c,e,f,g,h,i,j="",k=0;k<a.length;)b=a.charCodeAt(k++),c=a.charCodeAt(k++),e=a.charCodeAt(k++),f=b>>2,g=(3&b)<<4|c>>4,h=(15&c)<<2|e>>6,i=63&e,isNaN(c)?h=i=64:isN
 aN(e)&&(i=64),j=j+d.charAt(f)+d.charAt(g)+d.charAt(h)+d.charAt(i);return j},c.decode=function(a){var b,c,e,f,g,h,i,j="",k=0;for(a=a.replace(/[^A-Za-z0-9\+\/\=]/g,"");k<a.length;)f=d.indexOf(a.charAt(k++)),g=d.indexOf(a.charAt(k++)),h=d.indexOf(a.charAt(k++)),i=d.indexOf(a.charAt(k++)),b=f<<2|g>>4,c=(15&g)<<4|h>>2,e=(3&h)<<6|i,j+=String.fromCharCode(b),64!=h&&(j+=String.fromCharCode(c)),64!=i&&(j+=String.fromCharCode(e));return j}},{}],2:[function(a,b){"use strict";function c(){this.compressedSize=0,this.uncompressedSize=0,this.crc32=0,this.compressionMethod=null,this.compressedContent=null}c.prototype={getContent:function(){return null},getCompressedContent:function(){return null}},b.exports=c},{}],3:[function(a,b,c){"use strict";c.STORE={magic:"\x00\x00",compress:function(a){return a},uncompress:function(a){return a},compressInputType:null,uncompressInputType:null},c.DEFLATE=a("./flate")},{"./flate":8}],4:[function(a,b){"use strict";var c=a("./utils"),d=[0,1996959894,3993919788,256
 7524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,
 1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,32689355
 91,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117];b.exports=function(a,b){if("undefined"==typeof a||!a.length)return 0;var e="string"!==c.getTypeOf(a);"undefined"==typeof b&&(b=0);var f=0,g=0,h=0;b=-1^b;for(var i=0,j=a.length;j>i;i++)h=e?a[i]:a.charCodeAt(i),g=255&(b^h),f=d[g],b=b>>>8^f;return-1^b}},{"./utils":21}],5:[funct
 ion(a,b){"use strict";function c(){this.data=null,this.length=0,this.index=0}var d=a("./utils");c.prototype={checkOffset:function(a){this.checkIndex(this.index+a)},checkIndex:function(a){if(this.length<a||0>a)throw new Error("End of data reached (data length = "+this.length+", asked index = "+a+"). Corrupted zip ?")},setIndex:function(a){this.checkIndex(a),this.index=a},skip:function(a){this.setIndex(this.index+a)},byteAt:function(){},readInt:function(a){var b,c=0;for(this.checkOffset(a),b=this.index+a-1;b>=this.index;b--)c=(c<<8)+this.byteAt(b);return this.index+=a,c},readString:function(a){return d.transformTo("string",this.readData(a))},readData:function(){},lastIndexOfSignature:function(){},readDate:function(){var a=this.readInt(4);return new Date((a>>25&127)+1980,(a>>21&15)-1,a>>16&31,a>>11&31,a>>5&63,(31&a)<<1)}},b.exports=c},{"./utils":21}],6:[function(a,b,c){"use strict";c.base64=!1,c.binary=!1,c.dir=!1,c.createFolders=!1,c.date=null,c.compression=null,c.compressionOptions=n
 ull,c.comment=null,c.unixPermissions=null,c.dosPermissions=null},{}],7:[function(a,b,c){"use strict";var d=a("./utils");c.string2binary=function(a){return d.string2binary(a)},c.string2Uint8Array=function(a){return d.transformTo("uint8array",a)},c.uint8Array2String=function(a){return d.transformTo("string",a)},c.string2Blob=function(a){var b=d.transformTo("arraybuffer",a);return d.arrayBuffer2Blob(b)},c.arrayBuffer2Blob=function(a){return d.arrayBuffer2Blob(a)},c.transformTo=function(a,b){return d.transformTo(a,b)},c.getTypeOf=function(a){return d.getTypeOf(a)},c.checkSupport=function(a){return d.checkSupport(a)},c.MAX_VALUE_16BITS=d.MAX_VALUE_16BITS,c.MAX_VALUE_32BITS=d.MAX_VALUE_32BITS,c.pretty=function(a){return d.pretty(a)},c.findCompression=function(a){return d.findCompression(a)},c.isRegExp=function(a){return d.isRegExp(a)}},{"./utils":21}],8:[function(a,b,c){"use strict";var d="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Uint32Array,e=a(
 "pako");c.uncompressInputType=d?"uint8array":"array",c.compressInputType=d?"uint8array":"array",c.magic="\b\x00",c.compress=function(a,b){return e.deflateRaw(a,{level:b.level||-1})},c.uncompress=function(a){return e.inflateRaw(a)}},{pako:24}],9:[function(a,b){"use strict";function c(a,b){return this instanceof c?(this.files={},this.comment=null,this.root="",a&&this.load(a,b),void(this.clone=function(){var a=new c;for(var b in this)"function"!=typeof this[b]&&(a[b]=this[b]);return a})):new c(a,b)}var d=a("./base64");c.prototype=a("./object"),c.prototype.load=a("./load"),c.support=a("./support"),c.defaults=a("./defaults"),c.utils=a("./deprecatedPublicUtils"),c.base64={encode:function(a){return d.encode(a)},decode:function(a){return d.decode(a)}},c.compressions=a("./compressions"),b.exports=c},{"./base64":1,"./compressions":3,"./defaults":6,"./deprecatedPublicUtils":7,"./load":10,"./object":13,"./support":17}],10:[function(a,b){"use strict";var c=a("./base64"),d=a("./zipEntries");b.exp
 orts=function(a,b){var e,f,g,h;for(b=b||{},b.base64&&(a=c.decode(a)),f=new d(a,b),e=f.files,g=0;g<e.length;g++)h=e[g],this.file(h.fileName,h.decompressed,{binary:!0,optimizedBinaryString:!0,date:h.date,dir:h.dir,comment:h.fileComment.length?h.fileComment:null,unixPermissions:h.unixPermissions,dosPermissions:h.dosPermissions,createFolders:b.createFolders});return f.zipComment.length&&(this.comment=f.zipComment),this}},{"./base64":1,"./zipEntries":22}],11:[function(a,b){(function(a){"use strict";b.exports=function(b,c){return new a(b,c)},b.exports.test=function(b){return a.isBuffer(b)}}).call(this,"undefined"!=typeof Buffer?Buffer:void 0)},{}],12:[function(a,b){"use strict";function c(a){this.data=a,this.length=this.data.length,this.index=0}var d=a("./uint8ArrayReader");c.prototype=new d,c.prototype.readData=function(a){this.checkOffset(a);var b=this.data.slice(this.index,this.index+a);return this.index+=a,b},b.exports=c},{"./uint8ArrayReader":18}],13:[function(a,b){"use strict";var c
 =a("./support"),d=a("./utils"),e=a("./crc32"),f=a("./signature"),g=a("./defaults"),h=a("./base64"),i=a("./compressions"),j=a("./compressedObject"),k=a("./nodeBuffer"),l=a("./utf8"),m=a("./stringWriter"),n=a("./uint8ArrayWriter"),o=function(a){if(a._data instanceof j&&(a._data=a._data.getContent(),a.options.binary=!0,a.options.base64=!1,"uint8array"===d.getTypeOf(a._data))){var b=a._data;a._data=new Uint8Array(b.length),0!==b.length&&a._data.set(b,0)}return a._data},p=function(a){var b=o(a),e=d.getTypeOf(b);return"string"===e?!a.options.binary&&c.nodebuffer?k(b,"utf-8"):a.asBinary():b},q=function(a){var b=o(this);return null===b||"undefined"==typeof b?"":(this.options.base64&&(b=h.decode(b)),b=a&&this.options.binary?D.utf8decode(b):d.transformTo("string",b),a||this.options.binary||(b=d.transformTo("string",D.utf8encode(b))),b)},r=function(a,b,c){this.name=a,this.dir=c.dir,this.date=c.date,this.comment=c.comment,this.unixPermissions=c.unixPermissions,this.dosPermissions=c.dosPermissio
 ns,this._data=b,this.options=c,this._initialMetadata={dir:c.dir,date:c.date}};r.prototype={asText:function(){return q.call(this,!0)},asBinary:function(){return q.call(this,!1)},asNodeBuffer:function(){var a=p(this);return d.transformTo("nodebuffer",a)},asUint8Array:function(){var a=p(this);return d.transformTo("uint8array",a)},asArrayBuffer:function(){return this.asUint8Array().buffer}};var s=function(a,b){var c,d="";for(c=0;b>c;c++)d+=String.fromCharCode(255&a),a>>>=8;return d},t=function(){var a,b,c={};for(a=0;a<arguments.length;a++)for(b in arguments[a])arguments[a].hasOwnProperty(b)&&"undefined"==typeof c[b]&&(c[b]=arguments[a][b]);return c},u=function(a){return a=a||{},a.base64!==!0||null!==a.binary&&void 0!==a.binary||(a.binary=!0),a=t(a,g),a.date=a.date||new Date,null!==a.compression&&(a.compression=a.compression.toUpperCase()),a},v=function(a,b,c){var e,f=d.getTypeOf(b);if(c=u(c),"string"==typeof c.unixPermissions&&(c.unixPermissions=parseInt(c.unixPermissions,8)),c.unixPerm
 issions&&16384&c.unixPermissions&&(c.dir=!0),c.dosPermissions&&16&c.dosPermissions&&(c.dir=!0),c.dir&&(a=x(a)),c.createFolders&&(e=w(a))&&y.call(this,e,!0),c.dir||null===b||"undefined"==typeof b)c.base64=!1,c.binary=!1,b=null,f=null;else if("string"===f)c.binary&&!c.base64&&c.optimizedBinaryString!==!0&&(b=d.string2binary(b));else{if(c.base64=!1,c.binary=!0,!(f||b instanceof j))throw new Error("The data of '"+a+"' is in an unsupported format !");"arraybuffer"===f&&(b=d.transformTo("uint8array",b))}var g=new r(a,b,c);return this.files[a]=g,g},w=function(a){"/"==a.slice(-1)&&(a=a.substring(0,a.length-1));var b=a.lastIndexOf("/");return b>0?a.substring(0,b):""},x=function(a){return"/"!=a.slice(-1)&&(a+="/"),a},y=function(a,b){return b="undefined"!=typeof b?b:!1,a=x(a),this.files[a]||v.call(this,a,null,{dir:!0,createFolders:b}),this.files[a]},z=function(a,b,c){var f,g=new j;return a._data instanceof j?(g.uncompressedSize=a._data.uncompressedSize,g.crc32=a._data.crc32,0===g.uncompressedS
 ize||a.dir?(b=i.STORE,g.compressedContent="",g.crc32=0):a._data.compressionMethod===b.magic?g.compressedContent=a._data.getCompressedContent():(f=a._data.getContent(),g.compressedContent=b.compress(d.transformTo(b.compressInputType,f),c))):(f=p(a),(!f||0===f.length||a.dir)&&(b=i.STORE,f=""),g.uncompressedSize=f.length,g.crc32=e(f),g.compressedContent=b.compress(d.transformTo(b.compressInputType,f),c)),g.compressedSize=g.compressedContent.length,g.compressionMethod=b.magic,g},A=function(a,b){var c=a;return a||(c=b?16893:33204),(65535&c)<<16},B=function(a){return 63&(a||0)},C=function(a,b,c,g,h){var i,j,k,m,n=(c.compressedContent,d.transformTo("string",l.utf8encode(b.name))),o=b.comment||"",p=d.transformTo("string",l.utf8encode(o)),q=n.length!==b.name.length,r=p.length!==o.length,t=b.options,u="",v="",w="";k=b._initialMetadata.dir!==b.dir?b.dir:t.dir,m=b._initialMetadata.date!==b.date?b.date:t.date;var x=0,y=0;k&&(x|=16),"UNIX"===h?(y=798,x|=A(b.unixPermissions,k)):(y=20,x|=B(b.dosPer
 missions,k)),i=m.getHours(),i<<=6,i|=m.getMinutes(),i<<=5,i|=m.getSeconds()/2,j=m.getFullYear()-1980,j<<=4,j|=m.getMonth()+1,j<<=5,j|=m.getDate(),q&&(v=s(1,1)+s(e(n),4)+n,u+="up"+s(v.length,2)+v),r&&(w=s(1,1)+s(this.crc32(p),4)+p,u+="uc"+s(w.length,2)+w);var z="";z+="\n\x00",z+=q||r?"\x00\b":"\x00\x00",z+=c.compressionMethod,z+=s(i,2),z+=s(j,2),z+=s(c.crc32,4),z+=s(c.compressedSize,4),z+=s(c.uncompressedSize,4),z+=s(n.length,2),z+=s(u.length,2);var C=f.LOCAL_FILE_HEADER+z+n+u,D=f.CENTRAL_FILE_HEADER+s(y,2)+z+s(p.length,2)+"\x00\x00\x00\x00"+s(x,4)+s(g,4)+n+u+p;return{fileRecord:C,dirRecord:D,compressedObject:c}},D={load:function(){throw new Error("Load method is not defined. Is the file jszip-load.js included ?")},filter:function(a){var b,c,d,e,f=[];for(b in this.files)this.files.hasOwnProperty(b)&&(d=this.files[b],e=new r(d.name,d._data,t(d.options)),c=b.slice(this.root.length,b.length),b.slice(0,this.root.length)===this.root&&a(c,e)&&f.push(e));return f},file:function(a,b,c){if(1=
 ==arguments.length){if(d.isRegExp(a)){var e=a;return this.filter(function(a,b){return!b.dir&&e.test(a)})}return this.filter(function(b,c){return!c.dir&&b===a})[0]||null}return a=this.root+a,v.call(this,a,b,c),this},folder:function(a){if(!a)return this;if(d.isRegExp(a))return this.filter(function(b,c){return c.dir&&a.test(b)});var b=this.root+a,c=y.call(this,b),e=this.clone();return e.root=c.name,e},remove:function(a){a=this.root+a;var b=this.files[a];if(b||("/"!=a.slice(-1)&&(a+="/"),b=this.files[a]),b&&!b.dir)delete this.files[a];else for(var c=this.filter(function(b,c){return c.name.slice(0,a.length)===a}),d=0;d<c.length;d++)delete this.files[c[d].name];return this},generate:function(a){a=t(a||{},{base64:!0,compression:"STORE",compressionOptions:null,type:"base64",platform:"DOS",comment:null,mimeType:"application/zip"}),d.checkSupport(a.type),("darwin"===a.platform||"freebsd"===a.platform||"linux"===a.platform||"sunos"===a.platform)&&(a.platform="UNIX"),"win32"===a.platform&&(a.pl
 atform="DOS");var b,c,e=[],g=0,j=0,k=d.transformTo("string",this.utf8encode(a.comment||this.comment||""));for(var l in this.files)if(this.files.hasOwnProperty(l)){var o=this.files[l],p=o.options.compression||a.compression.toUpperCase(),q=i[p];if(!q)throw new Error(p+" is not a valid compression method !");var r=o.options.compressionOptions||a.compressionOptions||{},u=z.call(this,o,q,r),v=C.call(this,l,o,u,g,a.platform);g+=v.fileRecord.length+u.compressedSize,j+=v.dirRecord.length,e.push(v)}var w="";w=f.CENTRAL_DIRECTORY_END+"\x00\x00\x00\x00"+s(e.length,2)+s(e.length,2)+s(j,4)+s(g,4)+s(k.length,2)+k;var x=a.type.toLowerCase();for(b="uint8array"===x||"arraybuffer"===x||"blob"===x||"nodebuffer"===x?new n(g+j+w.length):new m(g+j+w.length),c=0;c<e.length;c++)b.append(e[c].fileRecord),b.append(e[c].compressedObject.compressedContent);for(c=0;c<e.length;c++)b.append(e[c].dirRecord);b.append(w);var y=b.finalize();switch(a.type.toLowerCase()){case"uint8array":case"arraybuffer":case"nodebuff
 er":return d.transformTo(a.type.toLowerCase(),y);case"blob":return d.arrayBuffer2Blob(d.transformTo("arraybuffer",y),a.mimeType);case"base64":return a.base64?h.encode(y):y;default:return y}},crc32:function(a,b){return e(a,b)},utf8encode:function(a){return d.transformTo("string",l.utf8encode(a))},utf8decode:function(a){return l.utf8decode(a)}};b.exports=D},{"./base64":1,"./compressedObject":2,"./compressions":3,"./crc32":4,"./defaults":6,"./nodeBuffer":11,"./signature":14,"./stringWriter":16,"./support":17,"./uint8ArrayWriter":19,"./utf8":20,"./utils":21}],14:[function(a,b,c){"use strict";c.LOCAL_FILE_HEADER="PK",c.CENTRAL_FILE_HEADER="PK",c.CENTRAL_DIRECTORY_END="PK",c.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK",c.ZIP64_CENTRAL_DIRECTORY_END="PK",c.DATA_DESCRIPTOR="PK\b"},{}],15:[function(a,b){"use strict";function c(a,b){this.data=a,b||(this.data=e.string2binary(this.data)),this.length=this.data.length,this.index=0}var d=a("./dataReader"),e=a("./utils");c.prototype=new d,c.prot
 otype.byteAt=function(a){return this.data.charCodeAt(a)},c.prototype.lastIndexOfSignature=function(a){return this.data.lastIndexOf(a)},c.prototype.readData=function(a){this.checkOffset(a);var b=this.data.slice(this.index,this.index+a);return this.index+=a,b},b.exports=c},{"./dataReader":5,"./utils":21}],16:[function(a,b){"use strict";var c=a("./utils"),d=function(){this.data=[]};d.prototype={append:function(a){a=c.transformTo("string",a),this.data.push(a)},finalize:function(){return this.data.join("")}},b.exports=d},{"./utils":21}],17:[function(a,b,c){(function(a){"use strict";if(c.base64=!0,c.array=!0,c.string=!0,c.arraybuffer="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array,c.nodebuffer="undefined"!=typeof a,c.uint8array="undefined"!=typeof Uint8Array,"undefined"==typeof ArrayBuffer)c.blob=!1;else{var b=new ArrayBuffer(0);try{c.blob=0===new Blob([b],{type:"application/zip"}).size}catch(d){try{var e=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder|
 |window.MSBlobBuilder,f=new e;f.append(b),c.blob=0===f.getBlob("application/zip").size}catch(d){c.blob=!1}}}}).call(this,"undefined"!=typeof Buffer?Buffer:void 0)},{}],18:[function(a,b){"use strict";function c(a){a&&(this.data=a,this.length=this.data.length,this.index=0)}var d=a("./dataReader");c.prototype=new d,c.prototype.byteAt=function(a){return this.data[a]},c.prototype.lastIndexOfSignature=function(a){for(var b=a.charCodeAt(0),c=a.charCodeAt(1),d=a.charCodeAt(2),e=a.charCodeAt(3),f=this.length-4;f>=0;--f)if(this.data[f]===b&&this.data[f+1]===c&&this.data[f+2]===d&&this.data[f+3]===e)return f;return-1},c.prototype.readData=function(a){if(this.checkOffset(a),0===a)return new Uint8Array(0);var b=this.data.subarray(this.index,this.index+a);return this.index+=a,b},b.exports=c},{"./dataReader":5}],19:[function(a,b){"use strict";var c=a("./utils"),d=function(a){this.data=new Uint8Array(a),this.index=0};d.prototype={append:function(a){0!==a.length&&(a=c.transformTo("uint8array",a),thi
 s.data.set(a,this.index),this.index+=a.length)},finalize:function(){return this.data}},b.exports=d},{"./utils":21}],20:[function(a,b,c){"use strict";for(var d=a("./utils"),e=a("./support"),f=a("./nodeBuffer"),g=new Array(256),h=0;256>h;h++)g[h]=h>=252?6:h>=248?5:h>=240?4:h>=224?3:h>=192?2:1;g[254]=g[254]=1;var i=function(a){var b,c,d,f,g,h=a.length,i=0;for(f=0;h>f;f++)c=a.charCodeAt(f),55296===(64512&c)&&h>f+1&&(d=a.charCodeAt(f+1),56320===(64512&d)&&(c=65536+(c-55296<<10)+(d-56320),f++)),i+=128>c?1:2048>c?2:65536>c?3:4;for(b=e.uint8array?new Uint8Array(i):new Array(i),g=0,f=0;i>g;f++)c=a.charCodeAt(f),55296===(64512&c)&&h>f+1&&(d=a.charCodeAt(f+1),56320===(64512&d)&&(c=65536+(c-55296<<10)+(d-56320),f++)),128>c?b[g++]=c:2048>c?(b[g++]=192|c>>>6,b[g++]=128|63&c):65536>c?(b[g++]=224|c>>>12,b[g++]=128|c>>>6&63,b[g++]=128|63&c):(b[g++]=240|c>>>18,b[g++]=128|c>>>12&63,b[g++]=128|c>>>6&63,b[g++]=128|63&c);return b},j=function(a,b){var c;for(b=b||a.length,b>a.length&&(b=a.length),c=b-1;c>=
 0&&128===(192&a[c]);)c--;return 0>c?b:0===c?b:c+g[a[c]]>b?c:b},k=function(a){var b,c,e,f,h=a.length,i=new Array(2*h);for(c=0,b=0;h>b;)if(e=a[b++],128>e)i[c++]=e;else if(f=g[e],f>4)i[c++]=65533,b+=f-1;else{for(e&=2===f?31:3===f?15:7;f>1&&h>b;)e=e<<6|63&a[b++],f--;f>1?i[c++]=65533:65536>e?i[c++]=e:(e-=65536,i[c++]=55296|e>>10&1023,i[c++]=56320|1023&e)}return i.length!==c&&(i.subarray?i=i.subarray(0,c):i.length=c),d.applyFromCharCode(i)};c.utf8encode=function(a){return e.nodebuffer?f(a,"utf-8"):i(a)},c.utf8decode=function(a){if(e.nodebuffer)return d.transformTo("nodebuffer",a).toString("utf-8");a=d.transformTo(e.uint8array?"uint8array":"array",a);for(var b=[],c=0,f=a.length,g=65536;f>c;){var h=j(a,Math.min(c+g,f));b.push(e.uint8array?k(a.subarray(c,h)):k(a.slice(c,h))),c=h}return b.join("")}},{"./nodeBuffer":11,"./support":17,"./utils":21}],21:[function(a,b,c){"use strict";function d(a){return a}function e(a,b){for(var c=0;c<a.length;++c)b[c]=255&a.charCodeAt(c);return b}function f(a){
 var b=65536,d=[],e=a.length,f=c.getTypeOf(a),g=0,h=!0;try{switch(f){case"uint8array":String.fromCharCode.apply(null,new Uint8Array(0));break;case"nodebuffer":String.fromCharCode.apply(null,j(0))}}catch(i){h=!1}if(!h){for(var k="",l=0;l<a.length;l++)k+=String.fromCharCode(a[l]);return k}for(;e>g&&b>1;)try{d.push("array"===f||"nodebuffer"===f?String.fromCharCode.apply(null,a.slice(g,Math.min(g+b,e))):String.fromCharCode.apply(null,a.subarray(g,Math.min(g+b,e)))),g+=b}catch(i){b=Math.floor(b/2)}return d.join("")}function g(a,b){for(var c=0;c<a.length;c++)b[c]=a[c];return b}var h=a("./support"),i=a("./compressions"),j=a("./nodeBuffer");c.string2binary=function(a){for(var b="",c=0;c<a.length;c++)b+=String.fromCharCode(255&a.charCodeAt(c));return b},c.arrayBuffer2Blob=function(a,b){c.checkSupport("blob"),b=b||"application/zip";try{return new Blob([a],{type:b})}catch(d){try{var e=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder,f=new e;return f.appe
 nd(a),f.getBlob(b)}catch(d){throw new Error("Bug : can't construct the Blob.")}}},c.applyFromCharCode=f;var k={};k.string={string:d,array:function(a){return e(a,new Array(a.length))},arraybuffer:function(a){return k.string.uint8array(a).buffer},uint8array:function(a){return e(a,new Uint8Array(a.length))},nodebuffer:function(a){return e(a,j(a.length))}},k.array={string:f,array:d,arraybuffer:function(a){return new Uint8Array(a).buffer},uint8array:function(a){return new Uint8Array(a)},nodebuffer:function(a){return j(a)}},k.arraybuffer={string:function(a){return f(new Uint8Array(a))},array:function(a){return g(new Uint8Array(a),new Array(a.byteLength))},arraybuffer:d,uint8array:function(a){return new Uint8Array(a)},nodebuffer:function(a){return j(new Uint8Array(a))}},k.uint8array={string:f,array:function(a){return g(a,new Array(a.length))},arraybuffer:function(a){return a.buffer},uint8array:d,nodebuffer:function(a){return j(a)}},k.nodebuffer={string:f,array:function(a){return g(a,new Ar
 ray(a.length))},arraybuffer:function(a){return k.nodebuffer.uint8array(a).buffer},uint8array:function(a){return g(a,new Uint8Array(a.length))},nodebuffer:d},c.transformTo=function(a,b){if(b||(b=""),!a)return b;c.checkSupport(a);var d=c.getTypeOf(b),e=k[d][a](b);return e},c.getTypeOf=function(a){return"string"==typeof a?"string":"[object Array]"===Object.prototype.toString.call(a)?"array":h.nodebuffer&&j.test(a)?"nodebuffer":h.uint8array&&a instanceof Uint8Array?"uint8array":h.arraybuffer&&a instanceof ArrayBuffer?"arraybuffer":void 0},c.checkSupport=function(a){var b=h[a.toLowerCase()];if(!b)throw new Error(a+" is not supported by this browser")},c.MAX_VALUE_16BITS=65535,c.MAX_VALUE_32BITS=-1,c.pretty=function(a){var b,c,d="";for(c=0;c<(a||"").length;c++)b=a.charCodeAt(c),d+="\\x"+(16>b?"0":"")+b.toString(16).toUpperCase();return d},c.findCompression=function(a){for(var b in i)if(i.hasOwnProperty(b)&&i[b].magic===a)return i[b];return null},c.isRegExp=function(a){return"[object RegEx
 p]"===Object.prototype.toString.call(a)}},{"./compressions":3,"./nodeBuffer":11,"./support":17}],22:[function(a,b){"use strict";function c(a,b){this.files=[],this.loadOptions=b,a&&this.load(a)}var d=a("./stringReader"),e=a("./nodeBufferReader"),f=a("./uint8ArrayReader"),g=a("./utils"),h=a("./signature"),i=a("./zipEntry"),j=a("./support"),k=a("./object");c.prototype={checkSignature:function(a){var b=this.reader.readString(4);if(b!==a)throw new Error("Corrupted zip or bug : unexpected signature ("+g.pretty(b)+", expected "+g.pretty(a)+")")},readBlockEndOfCentral:function(){this.diskNumber=this.reader.readInt(2),this.diskWithCentralDirStart=this.reader.readInt(2),this.centralDirRecordsOnThisDisk=this.reader.readInt(2),this.centralDirRecords=this.reader.readInt(2),this.centralDirSize=this.reader.readInt(4),this.centralDirOffset=this.reader.readInt(4),this.zipCommentLength=this.reader.readInt(2),this.zipComment=this.reader.readString(this.zipCommentLength),this.zipComment=k.utf8decode(th
 is.zipComment)},readBlockZip64EndOfCentral:function(){this.zip64EndOfCentralSize=this.reader.readInt(8),this.versionMadeBy=this.reader.readString(2),this.versionNeeded=this.reader.readInt(2),this.diskNumber=this.reader.readInt(4),this.diskWithCentralDirStart=this.reader.readInt(4),this.centralDirRecordsOnThisDisk=this.reader.readInt(8),this.centralDirRecords=this.reader.readInt(8),this.centralDirSize=this.reader.readInt(8),this.centralDirOffset=this.reader.readInt(8),this.zip64ExtensibleData={};for(var a,b,c,d=this.zip64EndOfCentralSize-44,e=0;d>e;)a=this.reader.readInt(2),b=this.reader.readInt(4),c=this.reader.readString(b),this.zip64ExtensibleData[a]={id:a,length:b,value:c}},readBlockZip64EndOfCentralLocator:function(){if(this.diskWithZip64CentralDirStart=this.reader.readInt(4),this.relativeOffsetEndOfZip64CentralDir=this.reader.readInt(8),this.disksCount=this.reader.readInt(4),this.disksCount>1)throw new Error("Multi-volumes zip are not supported")},readLocalFiles:function(){var 
 a,b;for(a=0;a<this.files.length;a++)b=this.files[a],this.reader.setIndex(b.localHeaderOffset),this.checkSignature(h.LOCAL_FILE_HEADER),b.readLocalPart(this.reader),b.handleUTF8(),b.processAttributes()},readCentralDir:function(){var a;for(this.reader.setIndex(this.centralDirOffset);this.reader.readString(4)===h.CENTRAL_FILE_HEADER;)a=new i({zip64:this.zip64},this.loadOptions),a.readCentralPart(this.reader),this.files.push(a)},readEndOfCentral:function(){var a=this.reader.lastIndexOfSignature(h.CENTRAL_DIRECTORY_END);if(-1===a){var b=!0;try{this.reader.setIndex(0),this.checkSignature(h.LOCAL_FILE_HEADER),b=!1}catch(c){}throw new Error(b?"Can't find end of central directory : is this a zip file ? If it is, see http://stuk.github.io/jszip/documentation/howto/read_zip.html":"Corrupted zip : can't find end of central directory")}if(this.reader.setIndex(a),this.checkSignature(h.CENTRAL_DIRECTORY_END),this.readBlockEndOfCentral(),this.diskNumber===g.MAX_VALUE_16BITS||this.diskWithCentralDir
 Start===g.MAX_VALUE_16BITS||this.centralDirRecordsOnThisDisk===g.MAX_VALUE_16BITS||this.centralDirRecords===g.MAX_VALUE_16BITS||this.centralDirSize===g.MAX_VALUE_32BITS||this.centralDirOffset===g.MAX_VALUE_32BITS){if(this.zip64=!0,a=this.reader.lastIndexOfSignature(h.ZIP64_CENTRAL_DIRECTORY_LOCATOR),-1===a)throw new Error("Corrupted zip : can't find the ZIP64 end of central directory locator");this.reader.setIndex(a),this.checkSignature(h.ZIP64_CENTRAL_DIRECTORY_LOCATOR),this.readBlockZip64EndOfCentralLocator(),this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir),this.checkSignature(h.ZIP64_CENTRAL_DIRECTORY_END),this.readBlockZip64EndOfCentral()}},prepareReader:function(a){var b=g.getTypeOf(a);this.reader="string"!==b||j.uint8array?"nodebuffer"===b?new e(a):new f(g.transformTo("uint8array",a)):new d(a,this.loadOptions.optimizedBinaryString)},load:function(a){this.prepareReader(a),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}},b.exports=c},{"./nodeBuf
 ferReader":12,"./object":13,"./signature":14,"./stringReader":15,"./support":17,"./uint8ArrayReader":18,"./utils":21,"./zipEntry":23}],23:[function(a,b){"use strict";function c(a,b){this.options=a,this.loadOptions=b}var d=a("./stringReader"),e=a("./utils"),f=a("./compressedObject"),g=a("./object"),h=0,i=3;c.prototype={isEncrypted:function(){return 1===(1&this.bitFlag)},useUTF8:function(){return 2048===(2048&this.bitFlag)},prepareCompressedContent:function(a,b,c){return function(){var d=a.index;a.setIndex(b);var e=a.readData(c);return a.setIndex(d),e}},prepareContent:function(a,b,c,d,f){return function(){var a=e.transformTo(d.uncompressInputType,this.getCompressedContent()),b=d.uncompress(a);if(b.length!==f)throw new Error("Bug : uncompressed data size mismatch");return b}},readLocalPart:function(a){var b,c;if(a.skip(22),this.fileNameLength=a.readInt(2),c=a.readInt(2),this.fileName=a.readString(this.fileNameLength),a.skip(c),-1==this.compressedSize||-1==this.uncompressedSize)throw ne
 w Error("Bug or corrupted zip : didn't get enough informations from the central directory (compressedSize == -1 || uncompressedSize == -1)");if(b=e.findCompression(this.compressionMethod),null===b)throw new Error("Corrupted zip : compression "+e.pretty(this.compressionMethod)+" unknown (inner file : "+this.fileName+")");if(this.decompressed=new f,this.decompressed.compressedSize=this.compressedSize,this.decompressed.uncompressedSize=this.uncompressedSize,this.decompressed.crc32=this.crc32,this.decompressed.compressionMethod=this.compressionMethod,this.decompressed.getCompressedContent=this.prepareCompressedContent(a,a.index,this.compressedSize,b),this.decompressed.getContent=this.prepareContent(a,a.index,this.compressedSize,b,this.uncompressedSize),this.loadOptions.checkCRC32&&(this.decompressed=e.transformTo("string",this.decompressed.getContent()),g.crc32(this.decompressed)!==this.crc32))throw new Error("Corrupted zip : CRC32 mismatch")},readCentralPart:function(a){if(this.version
 MadeBy=a.readInt(2),this.versionNeeded=a.readInt(2),this.bitFlag=a.readInt(2),this.compressionMethod=a.readString(2),this.date=a.readDate(),this.crc32=a.readInt(4),this.compressedSize=a.readInt(4),this.uncompressedSize=a.readInt(4),this.fileNameLength=a.readInt(2),this.extraFieldsLength=a.readInt(2),this.fileCommentLength=a.readInt(2),this.diskNumberStart=a.readInt(2),this.internalFileAttributes=a.readInt(2),this.externalFileAttributes=a.readInt(4),this.localHeaderOffset=a.readInt(4),this.isEncrypted())throw new Error("Encrypted zip are not supported");this.fileName=a.readString(this.fileNameLength),this.readExtraFields(a),this.parseZIP64ExtraField(a),this.fileComment=a.readString(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var a=this.versionMadeBy>>8;this.dir=16&this.externalFileAttributes?!0:!1,a===h&&(this.dosPermissions=63&this.externalFileAttributes),a===i&&(this.unixPermissions=this.externalFileAttributes>>16&65535),
 this.dir||"/"!==this.fileName.slice(-1)||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var a=new d(this.extraFields[1].value);this.uncompressedSize===e.MAX_VALUE_32BITS&&(this.uncompressedSize=a.readInt(8)),this.compressedSize===e.MAX_VALUE_32BITS&&(this.compressedSize=a.readInt(8)),this.localHeaderOffset===e.MAX_VALUE_32BITS&&(this.localHeaderOffset=a.readInt(8)),this.diskNumberStart===e.MAX_VALUE_32BITS&&(this.diskNumberStart=a.readInt(4))}},readExtraFields:function(a){var b,c,d,e=a.index;for(this.extraFields=this.extraFields||{};a.index<e+this.extraFieldsLength;)b=a.readInt(2),c=a.readInt(2),d=a.readString(c),this.extraFields[b]={id:b,length:c,value:d}},handleUTF8:function(){if(this.useUTF8())this.fileName=g.utf8decode(this.fileName),this.fileComment=g.utf8decode(this.fileComment);else{var a=this.findExtraFieldUnicodePath();null!==a&&(this.fileName=a);var b=this.findExtraFieldUnicodeComment();null!==b&&(this.fileComment=b)}},findExtraFieldUnicodePath:func
 tion(){var a=this.extraFields[28789];if(a){var b=new d(a.value);return 1!==b.readInt(1)?null:g.crc32(this.fileName)!==b.readInt(4)?null:g.utf8decode(b.readString(a.length-5))
+}return null},findExtraFieldUnicodeComment:function(){var a=this.extraFields[25461];if(a){var b=new d(a.value);return 1!==b.readInt(1)?null:g.crc32(this.fileComment)!==b.readInt(4)?null:g.utf8decode(b.readString(a.length-5))}return null}},b.exports=c},{"./compressedObject":2,"./object":13,"./stringReader":15,"./utils":21}],24:[function(a,b){"use strict";var c=a("./lib/utils/common").assign,d=a("./lib/deflate"),e=a("./lib/inflate"),f=a("./lib/zlib/constants"),g={};c(g,d,e,f),b.exports=g},{"./lib/deflate":25,"./lib/inflate":26,"./lib/utils/common":27,"./lib/zlib/constants":30}],25:[function(a,b,c){"use strict";function d(a,b){var c=new s(b);if(c.push(a,!0),c.err)throw c.msg;return c.result}function e(a,b){return b=b||{},b.raw=!0,d(a,b)}function f(a,b){return b=b||{},b.gzip=!0,d(a,b)}var g=a("./zlib/deflate.js"),h=a("./utils/common"),i=a("./utils/strings"),j=a("./zlib/messages"),k=a("./zlib/zstream"),l=0,m=4,n=0,o=1,p=-1,q=0,r=8,s=function(a){this.options=h.assign({level:p,method:r,chu
 nkSize:16384,windowBits:15,memLevel:8,strategy:q,to:""},a||{});var b=this.options;b.raw&&b.windowBits>0?b.windowBits=-b.windowBits:b.gzip&&b.windowBits>0&&b.windowBits<16&&(b.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new k,this.strm.avail_out=0;var c=g.deflateInit2(this.strm,b.level,b.method,b.windowBits,b.memLevel,b.strategy);if(c!==n)throw new Error(j[c]);b.header&&g.deflateSetHeader(this.strm,b.header)};s.prototype.push=function(a,b){var c,d,e=this.strm,f=this.options.chunkSize;if(this.ended)return!1;d=b===~~b?b:b===!0?m:l,e.input="string"==typeof a?i.string2buf(a):a,e.next_in=0,e.avail_in=e.input.length;do{if(0===e.avail_out&&(e.output=new h.Buf8(f),e.next_out=0,e.avail_out=f),c=g.deflate(e,d),c!==o&&c!==n)return this.onEnd(c),this.ended=!0,!1;(0===e.avail_out||0===e.avail_in&&d===m)&&this.onData("string"===this.options.to?i.buf2binstring(h.shrinkBuf(e.output,e.next_out)):h.shrinkBuf(e.output,e.next_out))}while((e.avail_in>0||0===e.avail_out)&
 &c!==o);return d===m?(c=g.deflateEnd(this.strm),this.onEnd(c),this.ended=!0,c===n):!0},s.prototype.onData=function(a){this.chunks.push(a)},s.prototype.onEnd=function(a){a===n&&(this.result="string"===this.options.to?this.chunks.join(""):h.flattenChunks(this.chunks)),this.chunks=[],this.err=a,this.msg=this.strm.msg},c.Deflate=s,c.deflate=d,c.deflateRaw=e,c.gzip=f},{"./utils/common":27,"./utils/strings":28,"./zlib/deflate.js":32,"./zlib/messages":37,"./zlib/zstream":39}],26:[function(a,b,c){"use strict";function d(a,b){var c=new m(b);if(c.push(a,!0),c.err)throw c.msg;return c.result}function e(a,b){return b=b||{},b.raw=!0,d(a,b)}var f=a("./zlib/inflate.js"),g=a("./utils/common"),h=a("./utils/strings"),i=a("./zlib/constants"),j=a("./zlib/messages"),k=a("./zlib/zstream"),l=a("./zlib/gzheader"),m=function(a){this.options=g.assign({chunkSize:16384,windowBits:0,to:""},a||{});var b=this.options;b.raw&&b.windowBits>=0&&b.windowBits<16&&(b.windowBits=-b.windowBits,0===b.windowBits&&(b.windowB
 its=-15)),!(b.windowBits>=0&&b.windowBits<16)||a&&a.windowBits||(b.windowBits+=32),b.windowBits>15&&b.windowBits<48&&0===(15&b.windowBits)&&(b.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new k,this.strm.avail_out=0;var c=f.inflateInit2(this.strm,b.windowBits);if(c!==i.Z_OK)throw new Error(j[c]);this.header=new l,f.inflateGetHeader(this.strm,this.header)};m.prototype.push=function(a,b){var c,d,e,j,k,l=this.strm,m=this.options.chunkSize;if(this.ended)return!1;d=b===~~b?b:b===!0?i.Z_FINISH:i.Z_NO_FLUSH,l.input="string"==typeof a?h.binstring2buf(a):a,l.next_in=0,l.avail_in=l.input.length;do{if(0===l.avail_out&&(l.output=new g.Buf8(m),l.next_out=0,l.avail_out=m),c=f.inflate(l,i.Z_NO_FLUSH),c!==i.Z_STREAM_END&&c!==i.Z_OK)return this.onEnd(c),this.ended=!0,!1;l.next_out&&(0===l.avail_out||c===i.Z_STREAM_END||0===l.avail_in&&d===i.Z_FINISH)&&("string"===this.options.to?(e=h.utf8border(l.output,l.next_out),j=l.next_out-e,k=h.buf2string(l.output,e),l.next_out
 =j,l.avail_out=m-j,j&&g.arraySet(l.output,l.output,e,j,0),this.onData(k)):this.onData(g.shrinkBuf(l.output,l.next_out)))}while(l.avail_in>0&&c!==i.Z_STREAM_END);return c===i.Z_STREAM_END&&(d=i.Z_FINISH),d===i.Z_FINISH?(c=f.inflateEnd(this.strm),this.onEnd(c),this.ended=!0,c===i.Z_OK):!0},m.prototype.onData=function(a){this.chunks.push(a)},m.prototype.onEnd=function(a){a===i.Z_OK&&(this.result="string"===this.options.to?this.chunks.join(""):g.flattenChunks(this.chunks)),this.chunks=[],this.err=a,this.msg=this.strm.msg},c.Inflate=m,c.inflate=d,c.inflateRaw=e,c.ungzip=d},{"./utils/common":27,"./utils/strings":28,"./zlib/constants":30,"./zlib/gzheader":33,"./zlib/inflate.js":35,"./zlib/messages":37,"./zlib/zstream":39}],27:[function(a,b,c){"use strict";var d="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;c.assign=function(a){for(var b=Array.prototype.slice.call(arguments,1);b.length;){var c=b.shift();if(c){if("object"!=typeof c)throw new 
 TypeError(c+"must be non-object");for(var d in c)c.hasOwnProperty(d)&&(a[d]=c[d])}}return a},c.shrinkBuf=function(a,b){return a.length===b?a:a.subarray?a.subarray(0,b):(a.length=b,a)};var e={arraySet:function(a,b,c,d,e){if(b.subarray&&a.subarray)return void a.set(b.subarray(c,c+d),e);for(var f=0;d>f;f++)a[e+f]=b[c+f]},flattenChunks:function(a){var b,c,d,e,f,g;for(d=0,b=0,c=a.length;c>b;b++)d+=a[b].length;for(g=new Uint8Array(d),e=0,b=0,c=a.length;c>b;b++)f=a[b],g.set(f,e),e+=f.length;return g}},f={arraySet:function(a,b,c,d,e){for(var f=0;d>f;f++)a[e+f]=b[c+f]},flattenChunks:function(a){return[].concat.apply([],a)}};c.setTyped=function(a){a?(c.Buf8=Uint8Array,c.Buf16=Uint16Array,c.Buf32=Int32Array,c.assign(c,e)):(c.Buf8=Array,c.Buf16=Array,c.Buf32=Array,c.assign(c,f))},c.setTyped(d)},{}],28:[function(a,b,c){"use strict";function d(a,b){if(65537>b&&(a.subarray&&g||!a.subarray&&f))return String.fromCharCode.apply(null,e.shrinkBuf(a,b));for(var c="",d=0;b>d;d++)c+=String.fromCharCode(a[
 d]);return c}var e=a("./common"),f=!0,g=!0;try{String.fromCharCode.apply(null,[0])}catch(h){f=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(h){g=!1}for(var i=new e.Buf8(256),j=0;256>j;j++)i[j]=j>=252?6:j>=248?5:j>=240?4:j>=224?3:j>=192?2:1;i[254]=i[254]=1,c.string2buf=function(a){var b,c,d,f,g,h=a.length,i=0;for(f=0;h>f;f++)c=a.charCodeAt(f),55296===(64512&c)&&h>f+1&&(d=a.charCodeAt(f+1),56320===(64512&d)&&(c=65536+(c-55296<<10)+(d-56320),f++)),i+=128>c?1:2048>c?2:65536>c?3:4;for(b=new e.Buf8(i),g=0,f=0;i>g;f++)c=a.charCodeAt(f),55296===(64512&c)&&h>f+1&&(d=a.charCodeAt(f+1),56320===(64512&d)&&(c=65536+(c-55296<<10)+(d-56320),f++)),128>c?b[g++]=c:2048>c?(b[g++]=192|c>>>6,b[g++]=128|63&c):65536>c?(b[g++]=224|c>>>12,b[g++]=128|c>>>6&63,b[g++]=128|63&c):(b[g++]=240|c>>>18,b[g++]=128|c>>>12&63,b[g++]=128|c>>>6&63,b[g++]=128|63&c);return b},c.buf2binstring=function(a){return d(a,a.length)},c.binstring2buf=function(a){for(var b=new e.Buf8(a.length),c=0,d=b.length;d>c;c++)
 b[c]=a.charCodeAt(c);return b},c.buf2string=function(a,b){var c,e,f,g,h=b||a.length,j=new Array(2*h);for(e=0,c=0;h>c;)if(f=a[c++],128>f)j[e++]=f;else if(g=i[f],g>4)j[e++]=65533,c+=g-1;else{for(f&=2===g?31:3===g?15:7;g>1&&h>c;)f=f<<6|63&a[c++],g--;g>1?j[e++]=65533:65536>f?j[e++]=f:(f-=65536,j[e++]=55296|f>>10&1023,j[e++]=56320|1023&f)}return d(j,e)},c.utf8border=function(a,b){var c;for(b=b||a.length,b>a.length&&(b=a.length),c=b-1;c>=0&&128===(192&a[c]);)c--;return 0>c?b:0===c?b:c+i[a[c]]>b?c:b}},{"./common":27}],29:[function(a,b){"use strict";function c(a,b,c,d){for(var e=65535&a|0,f=a>>>16&65535|0,g=0;0!==c;){g=c>2e3?2e3:c,c-=g;do e=e+b[d++]|0,f=f+e|0;while(--g);e%=65521,f%=65521}return e|f<<16|0}b.exports=c},{}],30:[function(a,b){b.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_
 DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],31:[function(a,b){"use strict";function c(){for(var a,b=[],c=0;256>c;c++){a=c;for(var d=0;8>d;d++)a=1&a?3988292384^a>>>1:a>>>1;b[c]=a}return b}function d(a,b,c,d){var f=e,g=d+c;a=-1^a;for(var h=d;g>h;h++)a=a>>>8^f[255&(a^b[h])];return-1^a}var e=c();b.exports=d},{}],32:[function(a,b,c){"use strict";function d(a,b){return a.msg=G[b],b}function e(a){return(a<<1)-(a>4?9:0)}function f(a){for(var b=a.length;--b>=0;)a[b]=0}function g(a){var b=a.state,c=b.pending;c>a.avail_out&&(c=a.avail_out),0!==c&&(C.arraySet(a.output,b.pending_buf,b.pending_out,c,a.next_out),a.next_out+=c,b.pending_out+=c,a.total_out+=c,a.avail_out-=c,b.pending-=c,0===b.pending&&(b.pending_out=0))}function h(a,b){D._tr_flush_block(a,a.block_start>=0?a.block_start:-1,a.strstart-a.block_start,b),a.block_start=a.strstart,g(a.strm)}function i(a,b){a.pending_buf[a.pending++]=b}functio
 n j(a,b){a.pending_buf[a.pending++]=b>>>8&255,a.pending_buf[a.pending++]=255&b}function k(a,b,c,d){var e=a.avail_in;return e>d&&(e=d),0===e?0:(a.avail_in-=e,C.arraySet(b,a.input,a.next_in,e,c),1===a.state.wrap?a.adler=E(a.adler,b,e,c):2===a.state.wrap&&(a.adler=F(a.adler,b,e,c)),a.next_in+=e,a.total_in+=e,e)}function l(a,b){var c,d,e=a.max_chain_length,f=a.strstart,g=a.prev_length,h=a.nice_match,i=a.strstart>a.w_size-jb?a.strstart-(a.w_size-jb):0,j=a.window,k=a.w_mask,l=a.prev,m=a.strstart+ib,n=j[f+g-1],o=j[f+g];a.prev_length>=a.good_match&&(e>>=2),h>a.lookahead&&(h=a.lookahead);do if(c=b,j[c+g]===o&&j[c+g-1]===n&&j[c]===j[f]&&j[++c]===j[f+1]){f+=2,c++;do;while(j[++f]===j[++c]&&j[++f]===j[++c]&&j[++f]===j[++c]&&j[++f]===j[++c]&&j[++f]===j[++c]&&j[++f]===j[++c]&&j[++f]===j[++c]&&j[++f]===j[++c]&&m>f);if(d=ib-(m-f),f=m-ib,d>g){if(a.match_start=b,g=d,d>=h)break;n=j[f+g-1],o=j[f+g]}}while((b=l[b&k])>i&&0!==--e);return g<=a.lookahead?g:a.lookahead}function m(a){var b,c,d,e,f,g=a.w_size;d
 o{if(e=a.window_size-a.lookahead-a.strstart,a.strstart>=g+(g-jb)){C.arraySet(a.window,a.window,g,g,0),a.match_start-=g,a.strstart-=g,a.block_start-=g,c=a.hash_size,b=c;do d=a.head[--b],a.head[b]=d>=g?d-g:0;while(--c);c=g,b=c;do d=a.prev[--b],a.prev[b]=d>=g?d-g:0;while(--c);e+=g}if(0===a.strm.avail_in)break;if(c=k(a.strm,a.window,a.strstart+a.lookahead,e),a.lookahead+=c,a.lookahead+a.insert>=hb)for(f=a.strstart-a.insert,a.ins_h=a.window[f],a.ins_h=(a.ins_h<<a.hash_shift^a.window[f+1])&a.hash_mask;a.insert&&(a.ins_h=(a.ins_h<<a.hash_shift^a.window[f+hb-1])&a.hash_mask,a.prev[f&a.w_mask]=a.head[a.ins_h],a.head[a.ins_h]=f,f++,a.insert--,!(a.lookahead+a.insert<hb)););}while(a.lookahead<jb&&0!==a.strm.avail_in)}function n(a,b){var c=65535;for(c>a.pending_buf_size-5&&(c=a.pending_buf_size-5);;){if(a.lookahead<=1){if(m(a),0===a.lookahead&&b===H)return sb;if(0===a.lookahead)break}a.strstart+=a.lookahead,a.lookahead=0;var d=a.block_start+c;if((0===a.strstart||a.strstart>=d)&&(a.lookahead=a.st
 rstart-d,a.strstart=d,h(a,!1),0===a.strm.avail_out))return sb;if(a.strstart-a.block_start>=a.w_size-jb&&(h(a,!1),0===a.strm.avail_out))return sb}return a.insert=0,b===K?(h(a,!0),0===a.strm.avail_out?ub:vb):a.strstart>a.block_start&&(h(a,!1),0===a.strm.avail_out)?sb:sb}function o(a,b){for(var c,d;;){if(a.lookahead<jb){if(m(a),a.lookahead<jb&&b===H)return sb;if(0===a.lookahead)break}if(c=0,a.lookahead>=hb&&(a.ins_h=(a.ins_h<<a.hash_shift^a.window[a.strstart+hb-1])&a.hash_mask,c=a.prev[a.strstart&a.w_mask]=a.head[a.ins_h],a.head[a.ins_h]=a.strstart),0!==c&&a.strstart-c<=a.w_size-jb&&(a.match_length=l(a,c)),a.match_length>=hb)if(d=D._tr_tally(a,a.strstart-a.match_start,a.match_length-hb),a.lookahead-=a.match_length,a.match_length<=a.max_lazy_match&&a.lookahead>=hb){a.match_length--;do a.strstart++,a.ins_h=(a.ins_h<<a.hash_shift^a.window[a.strstart+hb-1])&a.hash_mask,c=a.prev[a.strstart&a.w_mask]=a.head[a.ins_h],a.head[a.ins_h]=a.strstart;while(0!==--a.match_length);a.strstart++}else a.s
 trstart+=a.match_length,a.match_length=0,a.ins_h=a.window[a.strstart],a.ins_h=(a.ins_h<<a.hash_shift^a.window[a.strstart+1])&a.hash_mask;else d=D._tr_tally(a,0,a.window[a.strstart]),a.lookahead--,a.strstart++;if(d&&(h(a,!1),0===a.strm.avail_out))return sb}return a.insert=a.strstart<hb-1?a.strstart:hb-1,b===K?(h(a,!0),0===a.strm.avail_out?ub:vb):a.last_lit&&(h(a,!1),0===a.strm.avail_out)?sb:tb}function p(a,b){for(var c,d,e;;){if(a.lookahead<jb){if(m(a),a.lookahead<jb&&b===H)return sb;if(0===a.lookahead)break}if(c=0,a.lookahead>=hb&&(a.ins_h=(a.ins_h<<a.hash_shift^a.window[a.strstart+hb-1])&a.hash_mask,c=a.prev[a.strstart&a.w_mask]=a.head[a.ins_h],a.head[a.ins_h]=a.strstart),a.prev_length=a.match_length,a.prev_match=a.match_start,a.match_length=hb-1,0!==c&&a.prev_length<a.max_lazy_match&&a.strstart-c<=a.w_size-jb&&(a.match_length=l(a,c),a.match_length<=5&&(a.strategy===S||a.match_length===hb&&a.strstart-a.match_start>4096)&&(a.match_length=hb-1)),a.prev_length>=hb&&a.match_length<=a.p
 rev_length){e=a.strstart+a.lookahead-hb,d=D._tr_tally(a,a.strstart-1-a.prev_match,a.prev_length-hb),a.lookahead-=a.prev_length-1,a.prev_length-=2;do++a.strstart<=e&&(a.ins_h=(a.ins_h<<a.hash_shift^a.window[a.strstart+hb-1])&a.hash_mask,c=a.prev[a.strstart&a.w_mask]=a.head[a.ins_h],a.head[a.ins_h]=a.strstart);while(0!==--a.prev_length);if(a.match_available=0,a.match_length=hb-1,a.strstart++,d&&(h(a,!1),0===a.strm.avail_out))return sb}else if(a.match_available){if(d=D._tr_tally(a,0,a.window[a.strstart-1]),d&&h(a,!1),a.strstart++,a.lookahead--,0===a.strm.avail_out)return sb}else a.match_available=1,a.strstart++,a.lookahead--}return a.match_available&&(d=D._tr_tally(a,0,a.window[a.strstart-1]),a.match_available=0),a.insert=a.strstart<hb-1?a.strstart:hb-1,b===K?(h(a,!0),0===a.strm.avail_out?ub:vb):a.last_lit&&(h(a,!1),0===a.strm.avail_out)?sb:tb}function q(a,b){for(var c,d,e,f,g=a.window;;){if(a.lookahead<=ib){if(m(a),a.lookahead<=ib&&b===H)return sb;if(0===a.lookahead)break}if(a.match_l
 ength=0,a.lookahead>=hb&&a.strstart>0&&(e=a.strstart-1,d=g[e],d===g[++e]&&d===g[++e]&&d===g[++e])){f=a.strstart+ib;do;while(d===g[++e]&&d===g[++e]&&d===g[++e]&&d===g[++e]&&d===g[++e]&&d===g[++e]&&d===g[++e]&&d===g[++e]&&f>e);a.match_length=ib-(f-e),a.match_length>a.lookahead&&(a.match_length=a.lookahead)}if(a.match_length>=hb?(c=D._tr_tally(a,1,a.match_length-hb),a.lookahead-=a.match_length,a.strstart+=a.match_length,a.match_length=0):(c=D._tr_tally(a,0,a.window[a.strstart]),a.lookahead--,a.strstart++),c&&(h(a,!1),0===a.strm.avail_out))return sb}return a.insert=0,b===K?(h(a,!0),0===a.strm.avail_out?ub:vb):a.last_lit&&(h(a,!1),0===a.strm.avail_out)?sb:tb}function r(a,b){for(var c;;){if(0===a.lookahead&&(m(a),0===a.lookahead)){if(b===H)return sb;break}if(a.match_length=0,c=D._tr_tally(a,0,a.window[a.strstart]),a.lookahead--,a.strstart++,c&&(h(a,!1),0===a.strm.avail_out))return sb}return a.insert=0,b===K?(h(a,!0),0===a.strm.avail_out?ub:vb):a.last_lit&&(h(a,!1),0===a.strm.avail_out)?sb
 :tb}function s(a){a.window_size=2*a.w_size,f(a.head),a.max_lazy_match=B[a.level].max_lazy,a.good_match=B[a.level].good_length,a.nice_match=B[a.level].nice_length,a.max_chain_length=B[a.level].max_chain,a.strstart=0,a.block_start=0,a.lookahead=0,a.insert=0,a.match_length=a.prev_length=hb-1,a.match_available=0,a.ins_h=0}function t(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=Y,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new C.Buf16
 (2*fb),this.dyn_dtree=new C.Buf16(2*(2*db+1)),this.bl_tree=new C.Buf16(2*(2*eb+1)),f(this.dyn_ltree),f(this.dyn_dtree),f(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new C.Buf16(gb+1),this.heap=new C.Buf16(2*cb+1),f(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new C.Buf16(2*cb+1),f(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function u(a){var b;return a&&a.state?(a.total_in=a.total_out=0,a.data_type=X,b=a.state,b.pending=0,b.pending_out=0,b.wrap<0&&(b.wrap=-b.wrap),b.status=b.wrap?lb:qb,a.adler=2===b.wrap?0:1,b.last_flush=H,D._tr_init(b),M):d(a,O)}function v(a){var b=u(a);return b===M&&s(a.state),b}function w(a,b){return a&&a.state?2!==a.state.wrap?O:(a.state.gzhead=b,M):O}function x(a,b,c,e,f,g){if(!a)return O;var h=1;if(b===R&&(b=6),0>e?(h=0,e=-e):e>15&&(h=2,e-=16),1>f||f>Z||c!==Y||8>e||e>15||0>b||b>9||0>g||g>V)return 
 d(a,O);8===e&&(e=9);var i=new t;return a.state=i,i.strm=a,i.wrap=h,i.gzhead=null,i.w_bits=e,i.w_size=1<<i.w_bits,i.w_mask=i.w_size-1,i.hash_bits=f+7,i.hash_size=1<<i.hash_bits,i.hash_mask=i.hash_size-1,i.hash_shift=~~((i.hash_bits+hb-1)/hb),i.window=new C.Buf8(2*i.w_size),i.head=new C.Buf16(i.hash_size),i.prev=new C.Buf16(i.w_size),i.lit_bufsize=1<<f+6,i.pending_buf_size=4*i.lit_bufsize,i.pending_buf=new C.Buf8(i.pending_buf_size),i.d_buf=i.lit_bufsize>>1,i.l_buf=3*i.lit_bufsize,i.level=b,i.strategy=g,i.method=c,v(a)}function y(a,b){return x(a,b,Y,$,_,W)}function z(a,b){var c,h,k,l;if(!a||!a.state||b>L||0>b)return a?d(a,O):O;if(h=a.state,!a.output||!a.input&&0!==a.avail_in||h.status===rb&&b!==K)return d(a,0===a.avail_out?Q:O);if(h.strm=a,c=h.last_flush,h.last_flush=b,h.status===lb)if(2===h.wrap)a.adler=0,i(h,31),i(h,139),i(h,8),h.gzhead?(i(h,(h.gzhead.text?1:0)+(h.gzhead.hcrc?2:0)+(h.gzhead.extra?4:0)+(h.gzhead.name?8:0)+(h.gzhead.comment?16:0)),i(h,255&h.gzhead.time),i(h,h.gzhead.t
 ime>>8&255),i(h,h.gzhead.time>>16&255),i(h,h.gzhead.time>>24&255),i(h,9===h.level?2:h.strategy>=T||h.level<2?4:0),i(h,255&h.gzhead.os),h.gzhead.extra&&h.gzhead.extra.length&&(i(h,255&h.gzhead.extra.length),i(h,h.gzhead.extra.length>>8&255)),h.gzhead.hcrc&&(a.adler=F(a.adler,h.pending_buf,h.pending,0)),h.gzindex=0,h.status=mb):(i(h,0),i(h,0),i(h,0),i(h,0),i(h,0),i(h,9===h.level?2:h.strategy>=T||h.level<2?4:0),i(h,wb),h.status=qb);else{var m=Y+(h.w_bits-8<<4)<<8,n=-1;n=h.strategy>=T||h.level<2?0:h.level<6?1:6===h.level?2:3,m|=n<<6,0!==h.strstart&&(m|=kb),m+=31-m%31,h.status=qb,j(h,m),0!==h.strstart&&(j(h,a.adler>>>16),j(h,65535&a.adler)),a.adler=1}if(h.status===mb)if(h.gzhead.extra){for(k=h.pending;h.gzindex<(65535&h.gzhead.extra.length)&&(h.pending!==h.pending_buf_size||(h.gzhead.hcrc&&h.pending>k&&(a.adler=F(a.adler,h.pending_buf,h.pending-k,k)),g(a),k=h.pending,h.pending!==h.pending_buf_size));)i(h,255&h.gzhead.extra[h.gzindex]),h.gzindex++;h.gzhead.hcrc&&h.pending>k&&(a.adler=F(a.
 adler,h.pending_buf,h.pending-k,k)),h.gzindex===h.gzhead.extra.length&&(h.gzindex=0,h.status=nb)}else h.status=nb;if(h.status===nb)if(h.gzhead.name){k=h.pending;do{if(h.pending===h.pending_buf_size&&(h.gzhead.hcrc&&h.pending>k&&(a.adler=F(a.adler,h.pending_buf,h.pending-k,k)),g(a),k=h.pending,h.pending===h.pending_buf_size)){l=1;break}l=h.gzindex<h.gzhead.name.length?255&h.gzhead.name.charCodeAt(h.gzindex++):0,i(h,l)}while(0!==l);h.gzhead.hcrc&&h.pending>k&&(a.adler=F(a.adler,h.pending_buf,h.pending-k,k)),0===l&&(h.gzindex=0,h.status=ob)}else h.status=ob;if(h.status===ob)if(h.gzhead.comment){k=h.pending;do{if(h.pending===h.pending_buf_size&&(h.gzhead.hcrc&&h.pending>k&&(a.adler=F(a.adler,h.pending_buf,h.pending-k,k)),g(a),k=h.pending,h.pending===h.pending_buf_size)){l=1;break}l=h.gzindex<h.gzhead.comment.length?255&h.gzhead.comment.charCodeAt(h.gzindex++):0,i(h,l)}while(0!==l);h.gzhead.hcrc&&h.pending>k&&(a.adler=F(a.adler,h.pending_buf,h.pending-k,k)),0===l&&(h.status=pb)}else h.st
 atus=pb;if(h.status===pb&&(h.gzhead.hcrc?(h.pending+2>h.pending_buf_size&&g(a),h.pending+2<=h.pending_buf_size&&(i(h,255&a.adler),i(h,a.adler>>8&255),a.adler=0,h.status=qb)):h.status=qb),0!==h.pending){if(g(a),0===a.avail_out)return h.last_flush=-1,M}else if(0===a.avail_in&&e(b)<=e(c)&&b!==K)return d(a,Q);if(h.status===rb&&0!==a.avail_in)return d(a,Q);if(0!==a.avail_in||0!==h.lookahead||b!==H&&h.status!==rb){var o=h.strategy===T?r(h,b):h.strategy===U?q(h,b):B[h.level].func(h,b);if((o===ub||o===vb)&&(h.status=rb),o===sb||o===ub)return 0===a.avail_out&&(h.last_flush=-1),M;if(o===tb&&(b===I?D._tr_align(h):b!==L&&(D._tr_stored_block(h,0,0,!1),b===J&&(f(h.head),0===h.lookahead&&(h.strstart=0,h.block_start=0,h.insert=0))),g(a),0===a.avail_out))return h.last_flush=-1,M}return b!==K?M:h.wrap<=0?N:(2===h.wrap?(i(h,255&a.adler),i(h,a.adler>>8&255),i(h,a.adler>>16&255),i(h,a.adler>>24&255),i(h,255&a.total_in),i(h,a.total_in>>8&255),i(h,a.total_in>>16&255),i(h,a.total_in>>24&255)):(j(h,a.adler>
 >>16),j(h,65535&a.adler)),g(a),h.wrap>0&&(h.wrap=-h.wrap),0!==h.pending?M:N)}function A(a){var b;return a&&a.state?(b=a.state.status,b!==lb&&b!==mb&&b!==nb&&b!==ob&&b!==pb&&b!==qb&&b!==rb?d(a,O):(a.state=null,b===qb?d(a,P):M)):O}var B,C=a("../utils/common"),D=a("./trees"),E=a("./adler32"),F=a("./crc32"),G=a("./messages"),H=0,I=1,J=3,K=4,L=5,M=0,N=1,O=-2,P=-3,Q=-5,R=-1,S=1,T=2,U=3,V=4,W=0,X=2,Y=8,Z=9,$=15,_=8,ab=29,bb=256,cb=bb+1+ab,db=30,eb=19,fb=2*cb+1,gb=15,hb=3,ib=258,jb=ib+hb+1,kb=32,lb=42,mb=69,nb=73,ob=91,pb=103,qb=113,rb=666,sb=1,tb=2,ub=3,vb=4,wb=3,xb=function(a,b,c,d,e){this.good_length=a,this.max_lazy=b,this.nice_length=c,this.max_chain=d,this.func=e};B=[new xb(0,0,0,0,n),new xb(4,4,8,4,o),new xb(4,5,16,8,o),new xb(4,6,32,32,o),new xb(4,4,16,16,p),new xb(8,16,32,32,p),new xb(8,16,128,128,p),new xb(8,32,128,256,p),new xb(32,128,258,1024,p),new xb(32,258,258,4096,p)],c.deflateInit=y,c.deflateInit2=x,c.deflateReset=v,c.deflateResetKeep=u,c.deflateSetHeader=w,c.deflate=z,c.def
 lateEnd=A,c.deflateInfo="pako deflate (from Nodeca project)"},{"../utils/common":27,"./adler32":29,"./crc32":31,"./messages":37,"./trees":38}],33:[function(a,b){"use strict";function c(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}b.exports=c},{}],34:[function(a,b){"use strict";var c=30,d=12;b.exports=function(a,b){var e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C;e=a.state,f=a.next_in,B=a.input,g=f+(a.avail_in-5),h=a.next_out,C=a.output,i=h-(b-a.avail_out),j=h+(a.avail_out-257),k=e.dmax,l=e.wsize,m=e.whave,n=e.wnext,o=e.window,p=e.hold,q=e.bits,r=e.lencode,s=e.distcode,t=(1<<e.lenbits)-1,u=(1<<e.distbits)-1;a:do{15>q&&(p+=B[f++]<<q,q+=8,p+=B[f++]<<q,q+=8),v=r[p&t];b:for(;;){if(w=v>>>24,p>>>=w,q-=w,w=v>>>16&255,0===w)C[h++]=65535&v;else{if(!(16&w)){if(0===(64&w)){v=r[(65535&v)+(p&(1<<w)-1)];continue b}if(32&w){e.mode=d;break a}a.msg="invalid literal/length code",e.mode=c;break a}x=65535&v,
 w&=15,w&&(w>q&&(p+=B[f++]<<q,q+=8),x+=p&(1<<w)-1,p>>>=w,q-=w),15>q&&(p+=B[f++]<<q,q+=8,p+=B[f++]<<q,q+=8),v=s[p&u];c:for(;;){if(w=v>>>24,p>>>=w,q-=w,w=v>>>16&255,!(16&w)){if(0===(64&w)){v=s[(65535&v)+(p&(1<<w)-1)];continue c}a.msg="invalid distance code",e.mode=c;break a}if(y=65535&v,w&=15,w>q&&(p+=B[f++]<<q,q+=8,w>q&&(p+=B[f++]<<q,q+=8)),y+=p&(1<<w)-1,y>k){a.msg="invalid distance too far back",e.mode=c;break a}if(p>>>=w,q-=w,w=h-i,y>w){if(w=y-w,w>m&&e.sane){a.msg="invalid distance too far back",e.mode=c;break a}if(z=0,A=o,0===n){if(z+=l-w,x>w){x-=w;do C[h++]=o[z++];while(--w);z=h-y,A=C}}else if(w>n){if(z+=l+n-w,w-=n,x>w){x-=w;do C[h++]=o[z++];while(--w);if(z=0,x>n){w=n,x-=w;do C[h++]=o[z++];while(--w);z=h-y,A=C}}}else if(z+=n-w,x>w){x-=w;do C[h++]=o[z++];while(--w);z=h-y,A=C}for(;x>2;)C[h++]=A[z++],C[h++]=A[z++],C[h++]=A[z++],x-=3;x&&(C[h++]=A[z++],x>1&&(C[h++]=A[z++]))}else{z=h-y;do C[h++]=C[z++],C[h++]=C[z++],C[h++]=C[z++],x-=3;while(x>2);x&&(C[h++]=C[z++],x>1&&(C[h++]=C[z++]))}b
 reak}}break}}while(g>f&&j>h);x=q>>3,f-=x,q-=x<<3,p&=(1<<q)-1,a.next_in=f,a.next_out=h,a.avail_in=g>f?5+(g-f):5-(f-g),a.avail_out=j>h?257+(j-h):257-(h-j),e.hold=p,e.bits=q}},{}],35:[function(a,b,c){"use strict";function d(a){return(a>>>24&255)+(a>>>8&65280)+((65280&a)<<8)+((255&a)<<24)}function e(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new r.Buf16(320),this.work=new r.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function f(a){var b;return a&&a.state?(b=a.state,a.total_in=a.total_out=b.total=0,a.msg="",b.wrap&&(a.adler=1&b.wrap),b.mode=K,b.last=0,b.havedict=0,b.dmax=32768,b.head=null,b.hold=0,b.bi
 ts=0,b.lencode=b.lendyn=new r.Buf32(ob),b.distcode=b.distdyn=new r.Buf32(pb),b.sane=1,b.back=-1,C):F}function g(a){var b;return a&&a.state?(b=a.state,b.wsize=0,b.whave=0,b.wnext=0,f(a)):F}function h(a,b){var c,d;return a&&a.state?(d=a.state,0>b?(c=0,b=-b):(c=(b>>4)+1,48>b&&(b&=15)),b&&(8>b||b>15)?F:(null!==d.window&&d.wbits!==b&&(d.window=null),d.wrap=c,d.wbits=b,g(a))):F}function i(a,b){var c,d;return a?(d=new e,a.state=d,d.window=null,c=h(a,b),c!==C&&(a.state=null),c):F}function j(a){return i(a,rb)}function k(a){if(sb){var b;for(p=new r.Buf32(512),q=new r.Buf32(32),b=0;144>b;)a.lens[b++]=8;for(;256>b;)a.lens[b++]=9;for(;280>b;)a.lens[b++]=7;for(;288>b;)a.lens[b++]=8;for(v(x,a.lens,0,288,p,0,a.work,{bits:9}),b=0;32>b;)a.lens[b++]=5;v(y,a.lens,0,32,q,0,a.work,{bits:5}),sb=!1}a.lencode=p,a.lenbits=9,a.distcode=q,a.distbits=5}function l(a,b,c,d){var e,f=a.state;return null===f.window&&(f.wsize=1<<f.wbits,f.wnext=0,f.whave=0,f.window=new r.Buf8(f.wsize)),d>=f.wsize?(r.arraySet(f.window
 ,b,c-f.wsize,f.wsize,0),f.wnext=0,f.whave=f.wsize):(e=f.wsize-f.wnext,e>d&&(e=d),r.arraySet(f.window,b,c-d,e,f.wnext),d-=e,d?(r.arraySet(f.window,b,c-d,d,0),f.wnext=d,f.whave=f.wsize):(f.wnext+=e,f.wnext===f.wsize&&(f.wnext=0),f.whave<f.wsize&&(f.whave+=e))),0}function m(a,b){var c,e,f,g,h,i,j,m,n,o,p,q,ob,pb,qb,rb,sb,tb,ub,vb,wb,xb,yb,zb,Ab=0,Bb=new r.Buf8(4),Cb=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!a||!a.state||!a.output||!a.input&&0!==a.avail_in)return F;c=a.state,c.mode===V&&(c.mode=W),h=a.next_out,f=a.output,j=a.avail_out,g=a.next_in,e=a.input,i=a.avail_in,m=c.hold,n=c.bits,o=i,p=j,xb=C;a:for(;;)switch(c.mode){case K:if(0===c.wrap){c.mode=W;break}for(;16>n;){if(0===i)break a;i--,m+=e[g++]<<n,n+=8}if(2&c.wrap&&35615===m){c.check=0,Bb[0]=255&m,Bb[1]=m>>>8&255,c.check=t(c.check,Bb,2,0),m=0,n=0,c.mode=L;break}if(c.flags=0,c.head&&(c.head.done=!1),!(1&c.wrap)||(((255&m)<<8)+(m>>8))%31){a.msg="incorrect header check",c.mode=lb;break}if((15&m)!==J){a.msg="unknown compre
 ssion method",c.mode=lb;break}if(m>>>=4,n-=4,wb=(15&m)+8,0===c.wbits)c.wbits=wb;else if(wb>c.wbits){a.msg="invalid window size",c.mode=lb;break}c.dmax=1<<wb,a.adler=c.check=1,c.mode=512&m?T:V,m=0,n=0;break;case L:for(;16>n;){if(0===i)break a;i--,m+=e[g++]<<n,n+=8}if(c.flags=m,(255&c.flags)!==J){a.msg="unknown compression method",c.mode=lb;break}if(57344&c.flags){a.msg="unknown header flags set",c.mode=lb;break}c.head&&(c.head.text=m>>8&1),512&c.flags&&(Bb[0]=255&m,Bb[1]=m>>>8&255,c.check=t(c.check,Bb,2,0)),m=0,n=0,c.mode=M;case M:for(;32>n;){if(0===i)break a;i--,m+=e[g++]<<n,n+=8}c.head&&(c.head.time=m),512&c.flags&&(Bb[0]=255&m,Bb[1]=m>>>8&255,Bb[2]=m>>>16&255,Bb[3]=m>>>24&255,c.check=t(c.check,Bb,4,0)),m=0,n=0,c.mode=N;case N:for(;16>n;){if(0===i)break a;i--,m+=e[g++]<<n,n+=8}c.head&&(c.head.xflags=255&m,c.head.os=m>>8),512&c.flags&&(Bb[0]=255&m,Bb[1]=m>>>8&255,c.check=t(c.check,Bb,2,0)),m=0,n=0,c.mode=O;case O:if(1024&c.flags){for(;16>n;){if(0===i)break a;i--,m+=e[g++]<<n,n+=8}c.
 length=m,c.head&&(c.head.extra_len=m),512&c.flags&&(Bb[0]=255&m,Bb[1]=m>>>8&255,c.check=t(c.check,Bb,2,0)),m=0,n=0}else c.head&&(c.head.extra=null);c.mode=P;case P:if(1024&c.flags&&(q=c.length,q>i&&(q=i),q&&(c.head&&(wb=c.head.extra_len-c.length,c.head.extra||(c.head.extra=new Array(c.head.extra_len)),r.arraySet(c.head.extra,e,g,q,wb)),512&c.flags&&(c.check=t(c.check,e,q,g)),i-=q,g+=q,c.length-=q),c.length))break a;c.length=0,c.mode=Q;case Q:if(2048&c.flags){if(0===i)break a;q=0;do wb=e[g+q++],c.head&&wb&&c.length<65536&&(c.head.name+=String.fromCharCode(wb));while(wb&&i>q);if(512&c.flags&&(c.check=t(c.check,e,q,g)),i-=q,g+=q,wb)break a}else c.head&&(c.head.name=null);c.length=0,c.mode=R;case R:if(4096&c.flags){if(0===i)break a;q=0;do wb=e[g+q++],c.head&&wb&&c.length<65536&&(c.head.comment+=String.fromCharCode(wb));while(wb&&i>q);if(512&c.flags&&(c.check=t(c.check,e,q,g)),i-=q,g+=q,wb)break a}else c.head&&(c.head.comment=null);c.mode=S;case S:if(512&c.flags){for(;16>n;){if(0===i)bre
 ak a;i--,m+=e[g++]<<n,n+=8}if(m!==(65535&c.check)){a.msg="header crc mismatch",c.mode=lb;break}m=0,n=0}c.head&&(c.head.hcrc=c.flags>>9&1,c.head.done=!0),a.adler=c.check=0,c.mode=V;break;case T:for(;32>n;){if(0===i)break a;i--,m+=e[g++]<<n,n+=8}a.adler=c.check=d(m),m=0,n=0,c.mode=U;case U:if(0===c.havedict)return a.next_out=h,a.avail_out=j,a.next_in=g,a.avail_in=i,c.hold=m,c.bits=n,E;a.adler=c.check=1,c.mode=V;case V:if(b===A||b===B)break a;case W:if(c.last){m>>>=7&n,n-=7&n,c.mode=ib;break}for(;3>n;){if(0===i)break a;i--,m+=e[g++]<<n,n+=8}switch(c.last=1&m,m>>>=1,n-=1,3&m){case 0:c.mode=X;break;case 1:if(k(c),c.mode=bb,b===B){m>>>=2,n-=2;break a}break;case 2:c.mode=$;break;case 3:a.msg="invalid block type",c.mode=lb}m>>>=2,n-=2;break;case X:for(m>>>=7&n,n-=7&n;32>n;){if(0===i)break a;i--,m+=e[g++]<<n,n+=8}if((65535&m)!==(m>>>16^65535)){a.msg="invalid stored block lengths",c.mode=lb;break}if(c.length=65535&m,m=0,n=0,c.mode=Y,b===B)break a;case Y:c.mode=Z;case Z:if(q=c.length){if(q>i&&
 (q=i),q>j&&(q=j),0===q)break a;r.arraySet(f,e,g,q,h),i-=q,g+=q,j-=q,h+=q,c.length-=q;break}c.mode=V;break;case $:for(;14>n;){if(0===i)break a;i--,m+=e[g++]<<n,n+=8}if(c.nlen=(31&m)+257,m>>>=5,n-=5,c.ndist=(31&m)+1,m>>>=5,n-=5,c.ncode=(15&m)+4,m>>>=4,n-=4,c.nlen>286||c.ndist>30){a.msg="too many length or distance symbols",c.mode=lb;break}c.have=0,c.mode=_;case _:for(;c.have<c.ncode;){for(;3>n;){if(0===i)break a;i--,m+=e[g++]<<n,n+=8}c.lens[Cb[c.have++]]=7&m,m>>>=3,n-=3}for(;c.have<19;)c.lens[Cb[c.have++]]=0;if(c.lencode=c.lendyn,c.lenbits=7,yb={bits:c.lenbits},xb=v(w,c.lens,0,19,c.lencode,0,c.work,yb),c.lenbits=yb.bits,xb){a.msg="invalid code lengths set",c.mode=lb;break}c.have=0,c.mode=ab;case ab:for(;c.have<c.nlen+c.ndist;){for(;Ab=c.lencode[m&(1<<c.lenbits)-1],qb=Ab>>>24,rb=Ab>>>16&255,sb=65535&Ab,!(n>=qb);){if(0===i)break a;i--,m+=e[g++]<<n,n+=8}if(16>sb)m>>>=qb,n-=qb,c.lens[c.have++]=sb;else{if(16===sb){for(zb=qb+2;zb>n;){if(0===i)break a;i--,m+=e[g++]<<n,n+=8}if(m>>>=qb,n-=qb,0
 ===c.have){a.msg="invalid bit length repeat",c.mode=lb;break}wb=c.lens[c.have-1],q=3+(3&m),m>>>=2,n-=2}else if(17===sb){for(zb=qb+3;zb>n;){if(0===i)break a;i--,m+=e[g++]<<n,n+=8}m>>>=qb,n-=qb,wb=0,q=3+(7&m),m>>>=3,n-=3}else{for(zb=qb+7;zb>n;){if(0===i)break a;i--,m+=e[g++]<<n,n+=8}m>>>=qb,n-=qb,wb=0,q=11+(127&m),m>>>=7,n-=7}if(c.have+q>c.nlen+c.ndist){a.msg="invalid bit length repeat",c.mode=lb;break}for(;q--;)c.lens[c.have++]=wb}}if(c.mode===lb)break;if(0===c.lens[256]){a.msg="invalid code -- missing end-of-block",c.mode=lb;break}if(c.lenbits=9,yb={bits:c.lenbits},xb=v(x,c.lens,0,c.nlen,c.lencode,0,c.work,yb),c.lenbits=yb.bits,xb){a.msg="invalid literal/lengths set",c.mode=lb;break}if(c.distbits=6,c.distcode=c.distdyn,yb={bits:c.distbits},xb=v(y,c.lens,c.nlen,c.ndist,c.distcode,0,c.work,yb),c.distbits=yb.bits,xb){a.msg="invalid distances set",c.mode=lb;break}if(c.mode=bb,b===B)break a;case bb:c.mode=cb;case cb:if(i>=6&&j>=258){a.next_out=h,a.avail_out=j,a.next_in=g,a.avail_in=i,c.h
 old=m,c.bits=n,u(a,p),h=a.next_out,f=a.output,j=a.avail_out,g=a.next_in,e=a.input,i=a.avail_in,m=c.hold,n=c.bits,c.mode===V&&(c.back=-1);
+    break}for(c.back=0;Ab=c.lencode[m&(1<<c.lenbits)-1],qb=Ab>>>24,rb=Ab>>>16&255,sb=65535&Ab,!(n>=qb);){if(0===i)break a;i--,m+=e[g++]<<n,n+=8}if(rb&&0===(240&rb)){for(tb=qb,ub=rb,vb=sb;Ab=c.lencode[vb+((m&(1<<tb+ub)-1)>>tb)],qb=Ab>>>24,rb=Ab>>>16&255,sb=65535&Ab,!(n>=tb+qb);){if(0===i)break a;i--,m+=e[g++]<<n,n+=8}m>>>=tb,n-=tb,c.back+=tb}if(m>>>=qb,n-=qb,c.back+=qb,c.length=sb,0===rb){c.mode=hb;break}if(32&rb){c.back=-1,c.mode=V;break}if(64&rb){a.msg="invalid literal/length code",c.mode=lb;break}c.extra=15&rb,c.mode=db;case db:if(c.extra){for(zb=c.extra;zb>n;){if(0===i)break a;i--,m+=e[g++]<<n,n+=8}c.length+=m&(1<<c.extra)-1,m>>>=c.extra,n-=c.extra,c.back+=c.extra}c.was=c.length,c.mode=eb;case eb:for(;Ab=c.distcode[m&(1<<c.distbits)-1],qb=Ab>>>24,rb=Ab>>>16&255,sb=65535&Ab,!(n>=qb);){if(0===i)break a;i--,m+=e[g++]<<n,n+=8}if(0===(240&rb)){for(tb=qb,ub=rb,vb=sb;Ab=c.distcode[vb+((m&(1<<tb+ub)-1)>>tb)],qb=Ab>>>24,rb=Ab>>>16&255,sb=65535&Ab,!(n>=tb+qb);){if(0===i)break a;i--,m+=e[g+
 +]<<n,n+=8}m>>>=tb,n-=tb,c.back+=tb}if(m>>>=qb,n-=qb,c.back+=qb,64&rb){a.msg="invalid distance code",c.mode=lb;break}c.offset=sb,c.extra=15&rb,c.mode=fb;case fb:if(c.extra){for(zb=c.extra;zb>n;){if(0===i)break a;i--,m+=e[g++]<<n,n+=8}c.offset+=m&(1<<c.extra)-1,m>>>=c.extra,n-=c.extra,c.back+=c.extra}if(c.offset>c.dmax){a.msg="invalid distance too far back",c.mode=lb;break}c.mode=gb;case gb:if(0===j)break a;if(q=p-j,c.offset>q){if(q=c.offset-q,q>c.whave&&c.sane){a.msg="invalid distance too far back",c.mode=lb;break}q>c.wnext?(q-=c.wnext,ob=c.wsize-q):ob=c.wnext-q,q>c.length&&(q=c.length),pb=c.window}else pb=f,ob=h-c.offset,q=c.length;q>j&&(q=j),j-=q,c.length-=q;do f[h++]=pb[ob++];while(--q);0===c.length&&(c.mode=cb);break;case hb:if(0===j)break a;f[h++]=c.length,j--,c.mode=cb;break;case ib:if(c.wrap){for(;32>n;){if(0===i)break a;i--,m|=e[g++]<<n,n+=8}if(p-=j,a.total_out+=p,c.total+=p,p&&(a.adler=c.check=c.flags?t(c.check,f,p,h-p):s(c.check,f,p,h-p)),p=j,(c.flags?m:d(m))!==c.check){a.
 msg="incorrect data check",c.mode=lb;break}m=0,n=0}c.mode=jb;case jb:if(c.wrap&&c.flags){for(;32>n;){if(0===i)break a;i--,m+=e[g++]<<n,n+=8}if(m!==(4294967295&c.total)){a.msg="incorrect length check",c.mode=lb;break}m=0,n=0}c.mode=kb;case kb:xb=D;break a;case lb:xb=G;break a;case mb:return H;case nb:default:return F}return a.next_out=h,a.avail_out=j,a.next_in=g,a.avail_in=i,c.hold=m,c.bits=n,(c.wsize||p!==a.avail_out&&c.mode<lb&&(c.mode<ib||b!==z))&&l(a,a.output,a.next_out,p-a.avail_out)?(c.mode=mb,H):(o-=a.avail_in,p-=a.avail_out,a.total_in+=o,a.total_out+=p,c.total+=p,c.wrap&&p&&(a.adler=c.check=c.flags?t(c.check,f,p,a.next_out-p):s(c.check,f,p,a.next_out-p)),a.data_type=c.bits+(c.last?64:0)+(c.mode===V?128:0)+(c.mode===bb||c.mode===Y?256:0),(0===o&&0===p||b===z)&&xb===C&&(xb=I),xb)}function n(a){if(!a||!a.state)return F;var b=a.state;return b.window&&(b.window=null),a.state=null,C}function o(a,b){var c;return a&&a.state?(c=a.state,0===(2&c.wrap)?F:(c.head=b,b.done=!1,C)):F}var p,
 q,r=a("../utils/common"),s=a("./adler32"),t=a("./crc32"),u=a("./inffast"),v=a("./inftrees"),w=0,x=1,y=2,z=4,A=5,B=6,C=0,D=1,E=2,F=-2,G=-3,H=-4,I=-5,J=8,K=1,L=2,M=3,N=4,O=5,P=6,Q=7,R=8,S=9,T=10,U=11,V=12,W=13,X=14,Y=15,Z=16,$=17,_=18,ab=19,bb=20,cb=21,db=22,eb=23,fb=24,gb=25,hb=26,ib=27,jb=28,kb=29,lb=30,mb=31,nb=32,ob=852,pb=592,qb=15,rb=qb,sb=!0;c.inflateReset=g,c.inflateReset2=h,c.inflateResetKeep=f,c.inflateInit=j,c.inflateInit2=i,c.inflate=m,c.inflateEnd=n,c.inflateGetHeader=o,c.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":27,"./adler32":29,"./crc32":31,"./inffast":34,"./inftrees":36}],36:[function(a,b){"use strict";var c=a("../utils/common"),d=15,e=852,f=592,g=0,h=1,i=2,j=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],k=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],l=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,1
 2289,16385,24577,0,0],m=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];b.exports=function(a,b,n,o,p,q,r,s){var t,u,v,w,x,y,z,A,B,C=s.bits,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=null,O=0,P=new c.Buf16(d+1),Q=new c.Buf16(d+1),R=null,S=0;for(D=0;d>=D;D++)P[D]=0;for(E=0;o>E;E++)P[b[n+E]]++;for(H=C,G=d;G>=1&&0===P[G];G--);if(H>G&&(H=G),0===G)return p[q++]=20971520,p[q++]=20971520,s.bits=1,0;for(F=1;G>F&&0===P[F];F++);for(F>H&&(H=F),K=1,D=1;d>=D;D++)if(K<<=1,K-=P[D],0>K)return-1;if(K>0&&(a===g||1!==G))return-1;for(Q[1]=0,D=1;d>D;D++)Q[D+1]=Q[D]+P[D];for(E=0;o>E;E++)0!==b[n+E]&&(r[Q[b[n+E]]++]=E);if(a===g?(N=R=r,y=19):a===h?(N=j,O-=257,R=k,S-=257,y=256):(N=l,R=m,y=-1),M=0,E=0,D=F,x=q,I=H,J=0,v=-1,L=1<<H,w=L-1,a===h&&L>e||a===i&&L>f)return 1;for(var T=0;;){T++,z=D-J,r[E]<y?(A=0,B=r[E]):r[E]>y?(A=R[S+r[E]],B=N[O+r[E]]):(A=96,B=0),t=1<<D-J,u=1<<I,F=u;do u-=t,p[x+(M>>J)+u]=z<<24|A<<16|B|0;while(0!==u);for(t=1<<D-1;M&t;)t>>=1;if(0!==t?(M&=t-
 1,M+=t):M=0,E++,0===--P[D]){if(D===G)break;D=b[n+r[E]]}if(D>H&&(M&w)!==v){for(0===J&&(J=H),x+=F,I=D-J,K=1<<I;G>I+J&&(K-=P[I+J],!(0>=K));)I++,K<<=1;if(L+=1<<I,a===h&&L>e||a===i&&L>f)return 1;v=M&w,p[v]=H<<24|I<<16|x-q|0}}return 0!==M&&(p[x+M]=D-J<<24|64<<16|0),s.bits=H,0}},{"../utils/common":27}],37:[function(a,b){"use strict";b.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],38:[function(a,b,c){"use strict";function d(a){for(var b=a.length;--b>=0;)a[b]=0}function e(a){return 256>a?gb[a]:gb[256+(a>>>7)]}function f(a,b){a.pending_buf[a.pending++]=255&b,a.pending_buf[a.pending++]=b>>>8&255}function g(a,b,c){a.bi_valid>V-c?(a.bi_buf|=b<<a.bi_valid&65535,f(a,a.bi_buf),a.bi_buf=b>>V-a.bi_valid,a.bi_valid+=c-V):(a.bi_buf|=b<<a.bi_valid&65535,a.bi_valid+=c)}function h(a,b,c){g(a,c[2*b],c[2*b+1])}function i(a,b){var c=0;do c|=1&a,a>>>=1,c<<=1;while(--b>0);
 return c>>>1}function j(a){16===a.bi_valid?(f(a,a.bi_buf),a.bi_buf=0,a.bi_valid=0):a.bi_valid>=8&&(a.pending_buf[a.pending++]=255&a.bi_buf,a.bi_buf>>=8,a.bi_valid-=8)}function k(a,b){var c,d,e,f,g,h,i=b.dyn_tree,j=b.max_code,k=b.stat_desc.static_tree,l=b.stat_desc.has_stree,m=b.stat_desc.extra_bits,n=b.stat_desc.extra_base,o=b.stat_desc.max_length,p=0;for(f=0;U>=f;f++)a.bl_count[f]=0;for(i[2*a.heap[a.heap_max]+1]=0,c=a.heap_max+1;T>c;c++)d=a.heap[c],f=i[2*i[2*d+1]+1]+1,f>o&&(f=o,p++),i[2*d+1]=f,d>j||(a.bl_count[f]++,g=0,d>=n&&(g=m[d-n]),h=i[2*d],a.opt_len+=h*(f+g),l&&(a.static_len+=h*(k[2*d+1]+g)));if(0!==p){do{for(f=o-1;0===a.bl_count[f];)f--;a.bl_count[f]--,a.bl_count[f+1]+=2,a.bl_count[o]--,p-=2}while(p>0);for(f=o;0!==f;f--)for(d=a.bl_count[f];0!==d;)e=a.heap[--c],e>j||(i[2*e+1]!==f&&(a.opt_len+=(f-i[2*e+1])*i[2*e],i[2*e+1]=f),d--)}}function l(a,b,c){var d,e,f=new Array(U+1),g=0;for(d=1;U>=d;d++)f[d]=g=g+c[d-1]<<1;for(e=0;b>=e;e++){var h=a[2*e+1];0!==h&&(a[2*e]=i(f[h]++,h))}}func
 tion m(){var a,b,c,d,e,f=new Array(U+1);for(c=0,d=0;O-1>d;d++)for(ib[d]=c,a=0;a<1<<_[d];a++)hb[c++]=d;for(hb[c-1]=d,e=0,d=0;16>d;d++)for(jb[d]=e,a=0;a<1<<ab[d];a++)gb[e++]=d;for(e>>=7;R>d;d++)for(jb[d]=e<<7,a=0;a<1<<ab[d]-7;a++)gb[256+e++]=d;for(b=0;U>=b;b++)f[b]=0;for(a=0;143>=a;)eb[2*a+1]=8,a++,f[8]++;for(;255>=a;)eb[2*a+1]=9,a++,f[9]++;for(;279>=a;)eb[2*a+1]=7,a++,f[7]++;for(;287>=a;)eb[2*a+1]=8,a++,f[8]++;for(l(eb,Q+1,f),a=0;R>a;a++)fb[2*a+1]=5,fb[2*a]=i(a,5);kb=new nb(eb,_,P+1,Q,U),lb=new nb(fb,ab,0,R,U),mb=new nb(new Array(0),bb,0,S,W)}function n(a){var b;for(b=0;Q>b;b++)a.dyn_ltree[2*b]=0;for(b=0;R>b;b++)a.dyn_dtree[2*b]=0;for(b=0;S>b;b++)a.bl_tree[2*b]=0;a.dyn_ltree[2*X]=1,a.opt_len=a.static_len=0,a.last_lit=a.matches=0}function o(a){a.bi_valid>8?f(a,a.bi_buf):a.bi_valid>0&&(a.pending_buf[a.pending++]=a.bi_buf),a.bi_buf=0,a.bi_valid=0}function p(a,b,c,d){o(a),d&&(f(a,c),f(a,~c)),E.arraySet(a.pending_buf,a.window,b,c,a.pending),a.pending+=c}function q(a,b,c,d){var e=2*b,f=2*c
 ;return a[e]<a[f]||a[e]===a[f]&&d[b]<=d[c]}function r(a,b,c){for(var d=a.heap[c],e=c<<1;e<=a.heap_len&&(e<a.heap_len&&q(b,a.heap[e+1],a.heap[e],a.depth)&&e++,!q(b,d,a.heap[e],a.depth));)a.heap[c]=a.heap[e],c=e,e<<=1;a.heap[c]=d}function s(a,b,c){var d,f,i,j,k=0;if(0!==a.last_lit)do d=a.pending_buf[a.d_buf+2*k]<<8|a.pending_buf[a.d_buf+2*k+1],f=a.pending_buf[a.l_buf+k],k++,0===d?h(a,f,b):(i=hb[f],h(a,i+P+1,b),j=_[i],0!==j&&(f-=ib[i],g(a,f,j)),d--,i=e(d),h(a,i,c),j=ab[i],0!==j&&(d-=jb[i],g(a,d,j)));while(k<a.last_lit);h(a,X,b)}function t(a,b){var c,d,e,f=b.dyn_tree,g=b.stat_desc.static_tree,h=b.stat_desc.has_stree,i=b.stat_desc.elems,j=-1;for(a.heap_len=0,a.heap_max=T,c=0;i>c;c++)0!==f[2*c]?(a.heap[++a.heap_len]=j=c,a.depth[c]=0):f[2*c+1]=0;for(;a.heap_len<2;)e=a.heap[++a.heap_len]=2>j?++j:0,f[2*e]=1,a.depth[e]=0,a.opt_len--,h&&(a.static_len-=g[2*e+1]);for(b.max_code=j,c=a.heap_len>>1;c>=1;c--)r(a,f,c);e=i;do c=a.heap[1],a.heap[1]=a.heap[a.heap_len--],r(a,f,1),d=a.heap[1],a.heap[--a.h
 eap_max]=c,a.heap[--a.heap_max]=d,f[2*e]=f[2*c]+f[2*d],a.depth[e]=(a.depth[c]>=a.depth[d]?a.depth[c]:a.depth[d])+1,f[2*c+1]=f[2*d+1]=e,a.heap[1]=e++,r(a,f,1);while(a.heap_len>=2);a.heap[--a.heap_max]=a.heap[1],k(a,b),l(f,j,a.bl_count)}function u(a,b,c){var d,e,f=-1,g=b[1],h=0,i=7,j=4;for(0===g&&(i=138,j=3),b[2*(c+1)+1]=65535,d=0;c>=d;d++)e=g,g=b[2*(d+1)+1],++h<i&&e===g||(j>h?a.bl_tree[2*e]+=h:0!==e?(e!==f&&a.bl_tree[2*e]++,a.bl_tree[2*Y]++):10>=h?a.bl_tree[2*Z]++:a.bl_tree[2*$]++,h=0,f=e,0===g?(i=138,j=3):e===g?(i=6,j=3):(i=7,j=4))}function v(a,b,c){var d,e,f=-1,i=b[1],j=0,k=7,l=4;for(0===i&&(k=138,l=3),d=0;c>=d;d++)if(e=i,i=b[2*(d+1)+1],!(++j<k&&e===i)){if(l>j){do h(a,e,a.bl_tree);while(0!==--j)}else 0!==e?(e!==f&&(h(a,e,a.bl_tree),j--),h(a,Y,a.bl_tree),g(a,j-3,2)):10>=j?(h(a,Z,a.bl_tree),g(a,j-3,3)):(h(a,$,a.bl_tree),g(a,j-11,7));j=0,f=e,0===i?(k=138,l=3):e===i?(k=6,l=3):(k=7,l=4)}}function w(a){var b;for(u(a,a.dyn_ltree,a.l_desc.max_code),u(a,a.dyn_dtree,a.d_desc.max_code),t(a,a.
 bl_desc),b=S-1;b>=3&&0===a.bl_tree[2*cb[b]+1];b--);return a.opt_len+=3*(b+1)+5+5+4,b}function x(a,b,c,d){var e;for(g(a,b-257,5),g(a,c-1,5),g(a,d-4,4),e=0;d>e;e++)g(a,a.bl_tree[2*cb[e]+1],3);v(a,a.dyn_ltree,b-1),v(a,a.dyn_dtree,c-1)}function y(a){var b,c=4093624447;for(b=0;31>=b;b++,c>>>=1)if(1&c&&0!==a.dyn_ltree[2*b])return G;if(0!==a.dyn_ltree[18]||0!==a.dyn_ltree[20]||0!==a.dyn_ltree[26])return H;for(b=32;P>b;b++)if(0!==a.dyn_ltree[2*b])return H;return G}function z(a){pb||(m(),pb=!0),a.l_desc=new ob(a.dyn_ltree,kb),a.d_desc=new ob(a.dyn_dtree,lb),a.bl_desc=new ob(a.bl_tree,mb),a.bi_buf=0,a.bi_valid=0,n(a)}function A(a,b,c,d){g(a,(J<<1)+(d?1:0),3),p(a,b,c,!0)}function B(a){g(a,K<<1,3),h(a,X,eb),j(a)}function C(a,b,c,d){var e,f,h=0;a.level>0?(a.strm.data_type===I&&(a.strm.data_type=y(a)),t(a,a.l_desc),t(a,a.d_desc),h=w(a),e=a.opt_len+3+7>>>3,f=a.static_len+3+7>>>3,e>=f&&(e=f)):e=f=c+5,e>=c+4&&-1!==b?A(a,b,c,d):a.strategy===F||f===e?(g(a,(K<<1)+(d?1:0),3),s(a,eb,fb)):(g(a,(L<<1)+(d?1
 :0),3),x(a,a.l_desc.max_code+1,a.d_desc.max_code+1,h+1),s(a,a.dyn_ltree,a.dyn_dtree)),n(a),d&&o(a)}function D(a,b,c){return a.pending_buf[a.d_buf+2*a.last_lit]=b>>>8&255,a.pending_buf[a.d_buf+2*a.last_lit+1]=255&b,a.pending_buf[a.l_buf+a.last_lit]=255&c,a.last_lit++,0===b?a.dyn_ltree[2*c]++:(a.matches++,b--,a.dyn_ltree[2*(hb[c]+P+1)]++,a.dyn_dtree[2*e(b)]++),a.last_lit===a.lit_bufsize-1}var E=a("../utils/common"),F=4,G=0,H=1,I=2,J=0,K=1,L=2,M=3,N=258,O=29,P=256,Q=P+1+O,R=30,S=19,T=2*Q+1,U=15,V=16,W=7,X=256,Y=16,Z=17,$=18,_=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],ab=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],bb=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],cb=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],db=512,eb=new Array(2*(Q+2));d(eb);var fb=new Array(2*R);d(fb);var gb=new Array(db);d(gb);var hb=new Array(N-M+1);d(hb);var ib=new Array(O);d(ib);var jb=new Array(R);d(jb);var kb,lb,mb,nb=function(a,b,c,d,e){this.static_tree=a,this.extra_bi
 ts=b,this.extra_base=c,this.elems=d,this.max_length=e,this.has_stree=a&&a.length},ob=function(a,b){this.dyn_tree=a,this.max_code=0,this.stat_desc=b},pb=!1;c._tr_init=z,c._tr_stored_block=A,c._tr_flush_block=C,c._tr_tally=D,c._tr_align=B},{"../utils/common":27}],39:[function(a,b){"use strict";function c(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}b.exports=c},{}]},{},[9])(9)});