infinispan 0.12.0 → 0.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/package.json +7 -6
- package/.eslintrc +0 -25
- package/.flowconfig +0 -6
- package/Jenkinsfile +0 -50
- package/Jenkinsfile-release +0 -63
- package/documentation/asciidoc/stories/assembly_client_usage_examples.adoc +0 -10
- package/documentation/asciidoc/stories/assembly_installation_configuration.adoc +0 -20
- package/documentation/asciidoc/titles/js_client.asciidoc +0 -28
- package/documentation/asciidoc/titles/stories.adoc +0 -5
- package/documentation/asciidoc/topics/attributes/community-attributes.adoc +0 -9
- package/documentation/asciidoc/topics/attributes/downstream-attributes.adoc +0 -2
- package/documentation/asciidoc/topics/code_examples/authentication-digest.js +0 -12
- package/documentation/asciidoc/topics/code_examples/authentication-external.js +0 -15
- package/documentation/asciidoc/topics/code_examples/authentication-oauthbearer.js +0 -10
- package/documentation/asciidoc/topics/code_examples/authentication-plain.js +0 -11
- package/documentation/asciidoc/topics/code_examples/authentication-scram.js +0 -11
- package/documentation/asciidoc/topics/code_examples/await-multiple-entries.js +0 -36
- package/documentation/asciidoc/topics/code_examples/await-single-entries.js +0 -29
- package/documentation/asciidoc/topics/code_examples/conditional-operations.js +0 -57
- package/documentation/asciidoc/topics/code_examples/connection-multiple-servers.js +0 -23
- package/documentation/asciidoc/topics/code_examples/connection-xsite-cluster-switch.js +0 -39
- package/documentation/asciidoc/topics/code_examples/connection-xsite.js +0 -13
- package/documentation/asciidoc/topics/code_examples/data-types.js +0 -30
- package/documentation/asciidoc/topics/code_examples/encryption-crypto-store.js +0 -11
- package/documentation/asciidoc/topics/code_examples/encryption-private-key.js +0 -13
- package/documentation/asciidoc/topics/code_examples/encryption-sni-hostname.js +0 -9
- package/documentation/asciidoc/topics/code_examples/encryption-trust-certs.js +0 -8
- package/documentation/asciidoc/topics/code_examples/ephemeral-data.js +0 -52
- package/documentation/asciidoc/topics/code_examples/hello-world.js +0 -42
- package/documentation/asciidoc/topics/code_examples/key-value-converter.js +0 -67
- package/documentation/asciidoc/topics/code_examples/logging-configuration.js +0 -2
- package/documentation/asciidoc/topics/code_examples/multiple-entries.js +0 -64
- package/documentation/asciidoc/topics/code_examples/queries.js +0 -92
- package/documentation/asciidoc/topics/code_examples/register-event-listener.js +0 -64
- package/documentation/asciidoc/topics/code_examples/sample-script-execute.js +0 -33
- package/documentation/asciidoc/topics/code_examples/sample-script.js +0 -3
- package/documentation/asciidoc/topics/code_examples/single-entries.js +0 -49
- package/documentation/asciidoc/topics/config_examples/logging.json +0 -14
- package/documentation/asciidoc/topics/proc_configuring_authentication.adoc +0 -16
- package/documentation/asciidoc/topics/proc_configuring_connections.adoc +0 -25
- package/documentation/asciidoc/topics/proc_configuring_connections_xsite.adoc +0 -18
- package/documentation/asciidoc/topics/proc_configuring_data_formats.adoc +0 -30
- package/documentation/asciidoc/topics/proc_configuring_encryption.adoc +0 -15
- package/documentation/asciidoc/topics/proc_configuring_logging.adoc +0 -28
- package/documentation/asciidoc/topics/proc_installing_clients.adoc +0 -58
- package/documentation/asciidoc/topics/proc_switching_clusters.adoc +0 -17
- package/documentation/asciidoc/topics/ref_authentication_mechanisms.adoc +0 -68
- package/documentation/asciidoc/topics/ref_client_usage.adoc +0 -128
- package/documentation/asciidoc/topics/ref_encryption.adoc +0 -71
- package/gen-jsdoc.sh +0 -6
- package/make-ssl.sh +0 -335
- package/memory-profiling/helper.js +0 -9
- package/memory-profiling/infinispan_memory_many_get.js +0 -50
- package/memory-profiling/infinispan_memory_one_get.js +0 -56
- package/release.sh +0 -19
- package/run-servers.sh +0 -171
- package/run-testsuite.sh +0 -6
- package/server/.keep +0 -0
- package/set-npm-auth-token.sh +0 -4
- package/smoke-tests.sh +0 -21
- package/spec/codec_spec.js +0 -224
- package/spec/configs/clean/infinispan.xml +0 -55
- package/spec/configs/infinispan-clustered.xml +0 -63
- package/spec/configs/infinispan-ssl.xml +0 -115
- package/spec/configs/infinispan-xsite-EARTH.xml +0 -187
- package/spec/configs/infinispan-xsite-MOON.xml +0 -189
- package/spec/configs/infinispan.xml +0 -77
- package/spec/functional_spec.js +0 -73
- package/spec/infinispan_auth_spec.js +0 -19
- package/spec/infinispan_cluster_spec.js +0 -176
- package/spec/infinispan_expiry_spec.js +0 -218
- package/spec/infinispan_failover_listener_spec.js +0 -52
- package/spec/infinispan_failover_spec.js +0 -63
- package/spec/infinispan_json_spec.js +0 -182
- package/spec/infinispan_local_spec.js +0 -354
- package/spec/infinispan_ssl_spec.js +0 -442
- package/spec/infinispan_stress_spec.js +0 -32
- package/spec/infinispan_xsite_spec.js +0 -99
- package/spec/protocols_spec.js +0 -82
- package/spec/protostream_spec.js +0 -237
- package/spec/tests.js +0 -28
- package/spec/utils/test-log4js.json +0 -14
- package/spec/utils/testing.js +0 -762
- package/spec/utils/typed-cachemanager-put-get.js +0 -3
- package/spec/utils/typed-null-return-dist.js +0 -2
- package/spec/utils/typed-null-return.js +0 -2
- package/spec/utils/typed-put-get-dist.js +0 -3
- package/spec/utils/typed-put-get-unicode.js +0 -3
- package/spec/utils/typed-put-get.js +0 -3
- package/spec/utils/typed-size.js +0 -2
- package/spec/utils_spec.js +0 -154
- package/spec-manual/infinispan_manual_stress_get_spec.js +0 -50
- package/spec-manual/infinispan_manual_stress_iterate_spec.js +0 -86
package/README.md
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "infinispan",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.13.0",
|
|
4
4
|
"description": "Infinispan Javascript client",
|
|
5
5
|
"main": "index",
|
|
6
6
|
"typings": "./types",
|
|
@@ -9,9 +9,9 @@
|
|
|
9
9
|
},
|
|
10
10
|
"scripts": {
|
|
11
11
|
"lint": "eslint --ignore-path .gitignore .",
|
|
12
|
-
"test": "
|
|
12
|
+
"test": "jasmine"
|
|
13
13
|
},
|
|
14
|
-
"author": "
|
|
14
|
+
"author": "Infinispan Community",
|
|
15
15
|
"license": "Apache-2.0",
|
|
16
16
|
"keywords": [
|
|
17
17
|
"infinispan",
|
|
@@ -24,18 +24,19 @@
|
|
|
24
24
|
],
|
|
25
25
|
"repository": {
|
|
26
26
|
"type": "git",
|
|
27
|
-
"url": "https://github.com/infinispan/js-client"
|
|
27
|
+
"url": "git+https://github.com/infinispan/js-client.git"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
30
|
"buffer-xor": "^2.0.2",
|
|
31
|
+
"jsdoc": "^4.0.2",
|
|
31
32
|
"log4js": "^6.4.6",
|
|
32
33
|
"protobufjs": "^7.0.0",
|
|
33
34
|
"underscore": "^1.13.3",
|
|
34
|
-
"urllib": "^
|
|
35
|
+
"urllib": "^4.9.0"
|
|
35
36
|
},
|
|
36
37
|
"devDependencies": {
|
|
37
38
|
"eslint": "^8.26.0",
|
|
38
|
-
"jasmine
|
|
39
|
+
"jasmine": "^6.1.0",
|
|
39
40
|
"long": "^5.2.3"
|
|
40
41
|
}
|
|
41
42
|
}
|
package/.eslintrc
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"root":true,
|
|
3
|
-
"env": {
|
|
4
|
-
"es6": true,
|
|
5
|
-
"node": true
|
|
6
|
-
},
|
|
7
|
-
"parserOptions": {
|
|
8
|
-
"ecmaVersion": 2022,
|
|
9
|
-
"sourceType": "module"
|
|
10
|
-
},
|
|
11
|
-
"rules": {
|
|
12
|
-
"standard/no-callback-literal": "off",
|
|
13
|
-
"arrow-spacing": "error",
|
|
14
|
-
"arrow-parens": ["error", "as-needed"],
|
|
15
|
-
"arrow-body-style": ["error", "as-needed"],
|
|
16
|
-
"prefer-template": "error",
|
|
17
|
-
"no-unused-vars": ["warn", {
|
|
18
|
-
"argsIgnorePattern": "^_$|^e$|^reject$|^resolve$"
|
|
19
|
-
}],
|
|
20
|
-
"valid-jsdoc": "error",
|
|
21
|
-
"require-jsdoc": "warn",
|
|
22
|
-
"semi": ["error", "always"],
|
|
23
|
-
"quotes": ["error", "single", { "allowTemplateLiterals": true }]
|
|
24
|
-
}
|
|
25
|
-
}
|
package/Jenkinsfile
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env groovy
|
|
2
|
-
|
|
3
|
-
pipeline {
|
|
4
|
-
agent {
|
|
5
|
-
label 'slave-group-normal'
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
options {
|
|
9
|
-
timeout(time: 20, unit: 'MINUTES')
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
stages {
|
|
13
|
-
stage('Build') {
|
|
14
|
-
steps {
|
|
15
|
-
nodejs(nodeJSInstallationName: 'Node 14') {
|
|
16
|
-
sh 'rm -drf node_modules/'
|
|
17
|
-
sh 'npm config ls'
|
|
18
|
-
sh 'npm install'
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
stage('Docs') {
|
|
23
|
-
steps {
|
|
24
|
-
nodejs(nodeJSInstallationName: 'Node 14') {
|
|
25
|
-
sh './node_modules/.bin/jsdoc lib/*.js'
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
stage('Run server') {
|
|
30
|
-
steps {
|
|
31
|
-
sh './run-servers.sh --ci'
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
stage('Test') {
|
|
35
|
-
steps {
|
|
36
|
-
sh 'rm -drf tmp-tests.log'
|
|
37
|
-
|
|
38
|
-
nodejs(nodeJSInstallationName: 'Node 14') {
|
|
39
|
-
sh './node_modules/.bin/jasmine-node spec --captureExceptions --forceexit'
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
post {
|
|
45
|
-
failure {
|
|
46
|
-
sh 'cat tmp-tests.log'
|
|
47
|
-
sh 'cat server/infinispan-server/server-*/log/server.log'
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
}
|
package/Jenkinsfile-release
DELETED
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env groovy
|
|
2
|
-
|
|
3
|
-
pipeline {
|
|
4
|
-
agent {
|
|
5
|
-
label 'slave-group-release'
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
parameters {
|
|
9
|
-
string(name: 'version', defaultValue: '0.0.0', description: 'Release version')
|
|
10
|
-
string(name: 'branch', defaultValue: 'main', description: 'Branch to release from')
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
options {
|
|
14
|
-
timeout(time: 60, unit: 'MINUTES')
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
stages {
|
|
18
|
-
stage('Checkout') {
|
|
19
|
-
steps {
|
|
20
|
-
sh "git checkout ${branch}"
|
|
21
|
-
sh "git remote -v"
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
stage('Install release package') {
|
|
26
|
-
steps {
|
|
27
|
-
nodejs(nodeJSInstallationName: 'Node 18') {
|
|
28
|
-
sh 'rm -drf node_modules/'
|
|
29
|
-
sh 'npm config ls'
|
|
30
|
-
sh 'npm install'
|
|
31
|
-
sh 'npm install npm-release -g'
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
stage('Release') {
|
|
37
|
-
steps {
|
|
38
|
-
nodejs(nodeJSInstallationName: 'Node 18') {
|
|
39
|
-
withCredentials([string(credentialsId: 'npmauthtoken', variable: 'NPM_AUTH_TOKEN')]) {
|
|
40
|
-
sh './set-npm-auth-token.sh'
|
|
41
|
-
}
|
|
42
|
-
sh "git status"
|
|
43
|
-
sh "git diff"
|
|
44
|
-
sh "npm-release ${version}"
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
stage('Generate JS API docs and upload') {
|
|
50
|
-
steps {
|
|
51
|
-
nodejs(nodeJSInstallationName: 'Node 18') {
|
|
52
|
-
sh './node_modules/.bin/jsdoc lib/*.js'
|
|
53
|
-
sh 'mv out apidocs'
|
|
54
|
-
sh 'mkdir 1.0'
|
|
55
|
-
sh 'mv apidocs 1.0'
|
|
56
|
-
sh 'rsync -rv --protocol=28 1.0 infinispan@filemgmt.jboss.org:/docs_htdocs/infinispan/hotrod-clients/javascript'
|
|
57
|
-
sh 'mv 1.0 out'
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
}
|
|
63
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
[id='client-usage-examples']
|
|
2
|
-
:context: client-usage-examples
|
|
3
|
-
= Using {hr_js} clients
|
|
4
|
-
Take a look at some examples for using the {hr_js} client with {brandname}.
|
|
5
|
-
|
|
6
|
-
include::{topics}/ref_client_usage.adoc[leveloffset=+1]
|
|
7
|
-
|
|
8
|
-
// Restore the parent context.
|
|
9
|
-
ifdef::parent-context[:context: {parent-context}]
|
|
10
|
-
ifndef::parent-context[:!context:]
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
[id='install-configure']
|
|
2
|
-
:context: install-configure
|
|
3
|
-
= Installing and configuring {hr_js} clients
|
|
4
|
-
Ensure your system meets requirements before installing the {hr_js} client.
|
|
5
|
-
You can then configure {hr_js} clients to connect to {brandname} Server, use different media types for keys and values, and customize logging.
|
|
6
|
-
|
|
7
|
-
include::{topics}/proc_installing_clients.adoc[leveloffset=+1]
|
|
8
|
-
include::{topics}/proc_configuring_connections.adoc[leveloffset=+1]
|
|
9
|
-
include::{topics}/proc_configuring_connections_xsite.adoc[leveloffset=+2]
|
|
10
|
-
include::{topics}/proc_switching_clusters.adoc[leveloffset=+2]
|
|
11
|
-
include::{topics}/proc_configuring_authentication.adoc[leveloffset=+1]
|
|
12
|
-
include::{topics}/ref_authentication_mechanisms.adoc[leveloffset=+2]
|
|
13
|
-
include::{topics}/proc_configuring_encryption.adoc[leveloffset=+1]
|
|
14
|
-
include::{topics}/ref_encryption.adoc[leveloffset=+2]
|
|
15
|
-
include::{topics}/proc_configuring_data_formats.adoc[leveloffset=+1]
|
|
16
|
-
include::{topics}/proc_configuring_logging.adoc[leveloffset=+1]
|
|
17
|
-
|
|
18
|
-
// Restore the parent context.
|
|
19
|
-
ifdef::parent-context[:context: {parent-context}]
|
|
20
|
-
ifndef::parent-context[:!context:]
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
//Directory attributes
|
|
2
|
-
:stories: ../stories
|
|
3
|
-
:topics: ../topics
|
|
4
|
-
|
|
5
|
-
//Doc attributes
|
|
6
|
-
//Community
|
|
7
|
-
:community:
|
|
8
|
-
include::{topics}/attributes/community-attributes.adoc[]
|
|
9
|
-
//Downstream
|
|
10
|
-
//include::{topics}/attributes/downstream-attributes.adoc[]
|
|
11
|
-
//:downstream:
|
|
12
|
-
//:rhdg-install-npmrepo:
|
|
13
|
-
|
|
14
|
-
//Title attributes
|
|
15
|
-
:toc2:
|
|
16
|
-
:icons: font
|
|
17
|
-
:toclevels: 3
|
|
18
|
-
:numbered:
|
|
19
|
-
:sectanchors:
|
|
20
|
-
|
|
21
|
-
//Title
|
|
22
|
-
= {hr_js} Client Guide
|
|
23
|
-
|
|
24
|
-
{hr_js} clients provide asynchronous, event-driven access to {brandname} clusters for Node.js applications.
|
|
25
|
-
The asynchronous operation results are represented with `Promise` instances, which allows the client to chain multiple invocations and centralize error handling.
|
|
26
|
-
|
|
27
|
-
//User stories
|
|
28
|
-
include::stories.adoc[]
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
:brandname: Infinispan
|
|
2
|
-
:hr_js: Hot Rod JS
|
|
3
|
-
|
|
4
|
-
:doc_home: https://infinispan.org/documentation/
|
|
5
|
-
:download_url: https://infinispan.org/hotrod-clients
|
|
6
|
-
:node_docs: https://docs.jboss.org/infinispan/hotrod-clients/javascript/1.0/apidocs/
|
|
7
|
-
:server_docs: https://infinispan.org/docs/stable/titles/server/server.html
|
|
8
|
-
:code_tutorials: https://github.com/infinispan/infinispan-simple-tutorials/
|
|
9
|
-
:query_docs: https://infinispan.org/docs/stable/titles/query/query.html
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
const infinispan = require("infinispan");
|
|
2
|
-
|
|
3
|
-
const log4js = require('log4js');
|
|
4
|
-
log4js.configure('example-log4js.json');
|
|
5
|
-
|
|
6
|
-
async function test() {
|
|
7
|
-
let client = await infinispan.client({port: 11222, host: '127.0.0.1'});
|
|
8
|
-
console.log(`Connected to Infinispan dashboard data`);
|
|
9
|
-
|
|
10
|
-
let data = [
|
|
11
|
-
{key: 'multi1', value: 'v1'},
|
|
12
|
-
{key: 'multi2', value: 'v2'},
|
|
13
|
-
{key: 'multi3', value: 'v3'}];
|
|
14
|
-
|
|
15
|
-
await client.putAll(data);
|
|
16
|
-
|
|
17
|
-
let entries = await client.getAll(['multi2', 'multi3']);
|
|
18
|
-
console.log('getAll(multi2, multi3)=%s', JSON.stringify(entries));
|
|
19
|
-
|
|
20
|
-
let iterator = await client.iterator(1);
|
|
21
|
-
|
|
22
|
-
let entry = {done: true};
|
|
23
|
-
|
|
24
|
-
do {
|
|
25
|
-
entry = await iterator.next();
|
|
26
|
-
console.log('iterator.next()=' + JSON.stringify(entry));
|
|
27
|
-
} while (!entry.done);
|
|
28
|
-
|
|
29
|
-
await iterator.close();
|
|
30
|
-
|
|
31
|
-
await client.clear();
|
|
32
|
-
|
|
33
|
-
await client.disconnect();
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
test();
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
const infinispan = require("infinispan");
|
|
2
|
-
|
|
3
|
-
const log4js = require('log4js');
|
|
4
|
-
log4js.configure('example-log4js.json');
|
|
5
|
-
|
|
6
|
-
async function test() {
|
|
7
|
-
await new Promise((resolve, reject) => setTimeout(() => resolve(), 1000));
|
|
8
|
-
console.log('Hello, World!');
|
|
9
|
-
|
|
10
|
-
let client = await infinispan.client({port: 11222, host: '127.0.0.1'});
|
|
11
|
-
console.log(`Connected to Infinispan dashboard data`);
|
|
12
|
-
|
|
13
|
-
await client.put('key', 'value');
|
|
14
|
-
|
|
15
|
-
let value = await client.get('key');
|
|
16
|
-
console.log('get(key)=' + value);
|
|
17
|
-
|
|
18
|
-
let success = await client.remove('key');
|
|
19
|
-
console.log('remove(key)=' + success);
|
|
20
|
-
|
|
21
|
-
let stats = await client.stats();
|
|
22
|
-
console.log('Number of stores: ' + stats.stores);
|
|
23
|
-
console.log('Number of cache hits: ' + stats.hits);
|
|
24
|
-
console.log('All statistics: ' + JSON.stringify(stats, null, " "));
|
|
25
|
-
|
|
26
|
-
await client.disconnect();
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
test();
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
var infinispan = require('infinispan');
|
|
2
|
-
|
|
3
|
-
var connected = infinispan.client(
|
|
4
|
-
{port: 11222, host: '127.0.0.1'}
|
|
5
|
-
{
|
|
6
|
-
// Configure client connections with authentication and encryption here.
|
|
7
|
-
}
|
|
8
|
-
);
|
|
9
|
-
|
|
10
|
-
connected.then(function (client) {
|
|
11
|
-
|
|
12
|
-
var clientPut = client.putIfAbsent('cond', 'v0');
|
|
13
|
-
|
|
14
|
-
var showPut = clientPut.then(
|
|
15
|
-
function(success) { console.log(':putIfAbsent(cond)=' + success); });
|
|
16
|
-
|
|
17
|
-
var clientReplace = showPut.then(
|
|
18
|
-
function() { return client.replace('cond', 'v1'); } );
|
|
19
|
-
|
|
20
|
-
var showReplace = clientReplace.then(
|
|
21
|
-
function(success) { console.log('replace(cond)=' + success); });
|
|
22
|
-
|
|
23
|
-
var clientGetMetaForReplace = showReplace.then(
|
|
24
|
-
function() { return client.getWithMetadata('cond'); });
|
|
25
|
-
|
|
26
|
-
// Call the getWithMetadata method to retrieve the value and its metadata.
|
|
27
|
-
var clientReplaceWithVersion = clientGetMetaForReplace.then(
|
|
28
|
-
function(entry) {
|
|
29
|
-
console.log('getWithMetadata(cond)=' + JSON.stringify(entry));
|
|
30
|
-
return client.replaceWithVersion('cond', 'v2', entry.version);
|
|
31
|
-
}
|
|
32
|
-
);
|
|
33
|
-
|
|
34
|
-
var showReplaceWithVersion = clientReplaceWithVersion.then(
|
|
35
|
-
function(success) { console.log('replaceWithVersion(cond)=' + success); });
|
|
36
|
-
|
|
37
|
-
var clientGetMetaForRemove = showReplaceWithVersion.then(
|
|
38
|
-
function() { return client.getWithMetadata('cond'); });
|
|
39
|
-
|
|
40
|
-
var clientRemoveWithVersion = clientGetMetaForRemove.then(
|
|
41
|
-
function(entry) {
|
|
42
|
-
console.log('getWithMetadata(cond)=' + JSON.stringify(entry));
|
|
43
|
-
return client.removeWithVersion('cond', entry.version);
|
|
44
|
-
}
|
|
45
|
-
);
|
|
46
|
-
|
|
47
|
-
var showRemoveWithVersion = clientRemoveWithVersion.then(
|
|
48
|
-
function(success) { console.log('removeWithVersion(cond)=' + success)});
|
|
49
|
-
|
|
50
|
-
return showRemoveWithVersion.finally(
|
|
51
|
-
function() { return client.disconnect(); });
|
|
52
|
-
|
|
53
|
-
}).catch(function(error) {
|
|
54
|
-
|
|
55
|
-
console.log("Got error: " + error.message);
|
|
56
|
-
|
|
57
|
-
});
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
var infinispan = require('infinispan');
|
|
2
|
-
|
|
3
|
-
var connected = infinispan.client(
|
|
4
|
-
[{port: 11322, host: '127.0.0.1'}, {port: 11222, host: '127.0.0.1'}]
|
|
5
|
-
{
|
|
6
|
-
// Configure client connections with authentication and encryption here.
|
|
7
|
-
}
|
|
8
|
-
);
|
|
9
|
-
|
|
10
|
-
connected.then(function (client) {
|
|
11
|
-
|
|
12
|
-
var members = client.getTopologyInfo().getMembers();
|
|
13
|
-
|
|
14
|
-
// Displays all members of the {brandname} cluster.
|
|
15
|
-
console.log('Connected to: ' + JSON.stringify(members));
|
|
16
|
-
|
|
17
|
-
return client.disconnect();
|
|
18
|
-
|
|
19
|
-
}).catch(function(error) {
|
|
20
|
-
|
|
21
|
-
console.log("Got error: " + error.message);
|
|
22
|
-
|
|
23
|
-
});
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
var connected = infinispan.client({port: 11222, host: '127.0.0.1'},
|
|
2
|
-
{
|
|
3
|
-
clusters: [
|
|
4
|
-
{
|
|
5
|
-
name: 'LON',
|
|
6
|
-
servers: [{port: 11222, host: 'LON-host'}]
|
|
7
|
-
},
|
|
8
|
-
{
|
|
9
|
-
name: 'NYC',
|
|
10
|
-
servers: [{port: 11222, host: 'NYC-host1'}, {port: 11322, host: 'NYC-host2'}]
|
|
11
|
-
}
|
|
12
|
-
]
|
|
13
|
-
});
|
|
14
|
-
|
|
15
|
-
connected.then(function (client) {
|
|
16
|
-
|
|
17
|
-
var switchToB = client.getTopologyInfo().switchToCluster('NYC');
|
|
18
|
-
|
|
19
|
-
switchToB.then(function(switchSucceed) {
|
|
20
|
-
|
|
21
|
-
if (switchSucceed) {
|
|
22
|
-
...
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
...
|
|
26
|
-
|
|
27
|
-
var switchToDefault = client.getTopologyInfo().switchToDefaultCluster();
|
|
28
|
-
|
|
29
|
-
switchToDefault.then(function(switchSucceed) {
|
|
30
|
-
|
|
31
|
-
if (switchSucceed) {
|
|
32
|
-
...
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
})
|
|
36
|
-
|
|
37
|
-
})
|
|
38
|
-
|
|
39
|
-
});
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
var connected = infinispan.client({port: 11222, host: '127.0.0.1'},
|
|
2
|
-
{
|
|
3
|
-
clusters: [
|
|
4
|
-
{
|
|
5
|
-
name: 'LON',
|
|
6
|
-
servers: [{port: 11222, host: 'LON-host'}]
|
|
7
|
-
},
|
|
8
|
-
{
|
|
9
|
-
name: 'NYC',
|
|
10
|
-
servers: [{port: 11222, host: 'NYC-host1'}, {port: 11322, host: 'NYC-host2'}]
|
|
11
|
-
}
|
|
12
|
-
]
|
|
13
|
-
});
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
var infinispan = require('infinispan');
|
|
2
|
-
|
|
3
|
-
var connected = infinispan.client(
|
|
4
|
-
{port: 11222, host: '127.0.0.1'},
|
|
5
|
-
{
|
|
6
|
-
dataFormat : {
|
|
7
|
-
keyType: 'application/json',
|
|
8
|
-
valueType: 'application/json'
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
);
|
|
12
|
-
|
|
13
|
-
connected.then(function (client) {
|
|
14
|
-
|
|
15
|
-
var clientPut = client.put({k: 'key'}, {v: 'value'});
|
|
16
|
-
|
|
17
|
-
var clientGet = clientPut.then(
|
|
18
|
-
function() { return client.get({k: 'key'}); });
|
|
19
|
-
|
|
20
|
-
var showGet = clientGet.then(
|
|
21
|
-
function(value) { console.log("get({k: 'key'})=" + JSON.stringify(value)); });
|
|
22
|
-
|
|
23
|
-
return showGet.finally(
|
|
24
|
-
function() { return client.disconnect(); });
|
|
25
|
-
|
|
26
|
-
}).catch(function(error) {
|
|
27
|
-
|
|
28
|
-
console.log("Got error: " + error.message);
|
|
29
|
-
|
|
30
|
-
});
|