Web Console: implemented universal version check.
@@ -73,10 +73,10 @@ class ConnectionState {
}
export default class IgniteAgentManager {
- static $inject = ['$rootScope', '$q', '$transitions', 'igniteSocketFactory', 'AgentModal', 'UserNotifications'];
+ static $inject = ['$rootScope', '$q', '$transitions', 'igniteSocketFactory', 'AgentModal', 'UserNotifications', 'IgniteVersion' ];
- constructor($root, $q, $transitions, socketFactory, AgentModal, UserNotifications) {
- Object.assign(this, {$root, $q, $transitions, socketFactory, AgentModal, UserNotifications});
+ constructor($root, $q, $transitions, socketFactory, AgentModal, UserNotifications, Version) {
+ Object.assign(this, {$root, $q, $transitions, socketFactory, AgentModal, UserNotifications, Version});
this.promises = new Set();
@@ -99,8 +99,7 @@ export default class IgniteAgentManager {
this.connectionSbj = new BehaviorSubject(new ConnectionState(cluster));
- this.ignite2x = true;
- this.ignite2_1 = true;
+ this.clusterVersion = '2.0.0';
if (!$root.IgniteDemoMode) {
this.connectionSbj.subscribe({
@@ -110,13 +109,16 @@ export default class IgniteAgentManager {
if (_.isEmpty(version))
return;
- this.ignite2x = version.startsWith('2.');
- this.ignite2_1 = version.startsWith('2.1');
+ this.clusterVersion = version;
}
});
}
}
+ available(sinceVersion) {
+ return this.Version.since(this.clusterVersion, sinceVersion);
+ }
+
connect() {
const self = this;
@@ -491,7 +493,7 @@ export default class IgniteAgentManager {
* @returns {Promise}
*/
querySql(nid, cacheName, query, nonCollocatedJoins, enforceJoinOrder, replicatedOnly, local, pageSz) {
- if (this.ignite2x) {
+ if (this.available('2.0.0')) {
return this.visorTask('querySqlX2', nid, cacheName, query, nonCollocatedJoins, enforceJoinOrder, replicatedOnly, local, pageSz)
.then(({error, result}) => {
if (_.isEmpty(error))
@@ -528,7 +530,7 @@ export default class IgniteAgentManager {
* @returns {Promise}
*/
queryNextPage(nid, queryId, pageSize) {
- if (this.ignite2x)
+ if (this.available('2.0.0'))
return this.visorTask('queryFetchX2', nid, queryId, pageSize);
return this.visorTask('queryFetch', nid, queryId, pageSize);
@@ -572,7 +574,7 @@ export default class IgniteAgentManager {
* @returns {Promise}
*/
queryClose(nid, queryId) {
- if (this.ignite2x) {
+ if (this.available('2.0.0')) {
return this.visorTask('queryCloseX2', nid, 'java.util.Map', 'java.util.UUID', 'java.util.Collection',
nid + '=' + queryId);
}
@@ -592,7 +594,7 @@ export default class IgniteAgentManager {
* @returns {Promise}
*/
queryScan(nid, cacheName, filter, regEx, caseSensitive, near, local, pageSize) {
- if (this.ignite2x) {
+ if (this.available('2.0.0')) {
return this.visorTask('queryScanX2', nid, cacheName, filter, regEx, caseSensitive, near, local, pageSize)
.then(({error, result}) => {
if (_.isEmpty(error))
