-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathIgniteClientConfiguration.js.html
More file actions
163 lines (136 loc) · 6.68 KB
/
Copy pathIgniteClientConfiguration.js.html
File metadata and controls
163 lines (136 loc) · 6.68 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>JSDoc: Source: IgniteClientConfiguration.js</title>
<script src="scripts/prettify/prettify.js"> </script>
<script src="scripts/prettify/lang-css.js"> </script>
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
<link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
</head>
<body>
<div id="main">
<h1 class="page-title">Source: IgniteClientConfiguration.js</h1>
<section>
<article>
<pre class="prettyprint source linenums"><code>/*
* 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.
*/
'use strict';
const FS = require('fs');
const Util = require('util');
const Errors = require('./Errors');
const ArgumentChecker = require('./internal/ArgumentChecker');
/**
* Class representing Ignite client configuration.
*
* The configuration includes:
* - (mandatory) Ignite node endpoint(s)
* - (optional) user credentials for authentication
* - (optional) TLS enabling
* - (optional) connection options
*/
class IgniteClientConfiguration {
/**
* Creates an instance of Ignite client configuration
* with the provided mandatory settings and default optional settings.
*
* By default, the client does not use authentication and secure connection.
*
* @param {...string} endpoints - Ignite node endpoint(s).
* The client randomly connects/reconnects to one of the specified node.
*
* @return {IgniteClientConfiguration} - new client configuration instance.
*
* @throws {IgniteClientError} if error.
*/
constructor(...endpoints) {
ArgumentChecker.notEmpty(endpoints, 'endpoints');
this._endpoints = endpoints;
this._userName = null;
this._password = null;
this._useTLS = false;
this._options = null;
}
/**
* Sets username which will be used for authentication during the client's connection.
*
* If username is not set, the client does not use authentication during connection.
*
* @param {string} userName - username. If null, authentication is disabled.
*
* @return {IgniteClientConfiguration} - the same instance of the IgniteClientConfiguration.
*
* @throws {IgniteClientError} if error.
*/
setUserName(userName) {
this._userName = userName;
return this;
}
/**
* Sets password which will be used for authentication during the client's connection.
*
* Password is ignored, if username is not set.
* If password is not set, it is considered empty.
*
* @param {string} password - password. If null, password is empty.
*
* @return {IgniteClientConfiguration} - the same instance of the IgniteClientConfiguration.
*
* @throws {IgniteClientError} if error.
*/
setPassword(password) {
this._password = password;
return this;
}
/**
* Sets connection options.
*
* By default the client establishes a non-secure connection with default connection options defined by nodejs.
*
* @param {boolean} useTLS - if true, secure connection will be established;
* if false, non-secure connection will be established.
* @param {object} [connectionOptions=null] - connection options.
* - For non-secure connection options defined here {@link https://nodejs.org/api/net.html#net_net_createconnection_options_connectlistener}
* - For secure connection options defined here {@link https://nodejs.org/api/tls.html#tls_tls_connect_options_callback}
*
* @return {IgniteClientConfiguration} - the same instance of the IgniteClientConfiguration.
*/
setConnectionOptions(useTLS, connectionOptions = null) {
this._useTLS = useTLS;
this._options = connectionOptions;
return this;
}
}
module.exports = IgniteClientConfiguration;
</code></pre>
</article>
</section>
</div>
<nav>
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="BinaryObject.html">BinaryObject</a></li><li><a href="CacheClient.html">CacheClient</a></li><li><a href="CacheConfiguration.html">CacheConfiguration</a></li><li><a href="CacheEntry.html">CacheEntry</a></li><li><a href="CacheKeyConfiguration.html">CacheKeyConfiguration</a></li><li><a href="CollectionObjectType.html">CollectionObjectType</a></li><li><a href="ComplexObjectType.html">ComplexObjectType</a></li><li><a href="CompositeType.html">CompositeType</a></li><li><a href="Cursor.html">Cursor</a></li><li><a href="EnumItem.html">EnumItem</a></li><li><a href="IgniteClient.html">IgniteClient</a></li><li><a href="IgniteClientConfiguration.html">IgniteClientConfiguration</a></li><li><a href="IgniteClientError.html">IgniteClientError</a></li><li><a href="IllegalStateError.html">IllegalStateError</a></li><li><a href="LostConnectionError.html">LostConnectionError</a></li><li><a href="MapObjectType.html">MapObjectType</a></li><li><a href="ObjectArrayType.html">ObjectArrayType</a></li><li><a href="ObjectType.html">ObjectType</a></li><li><a href="OperationError.html">OperationError</a></li><li><a href="Query.html">Query</a></li><li><a href="QueryEntity.html">QueryEntity</a></li><li><a href="QueryField.html">QueryField</a></li><li><a href="QueryIndex.html">QueryIndex</a></li><li><a href="ScanQuery.html">ScanQuery</a></li><li><a href="SqlFieldsCursor.html">SqlFieldsCursor</a></li><li><a href="SqlFieldsQuery.html">SqlFieldsQuery</a></li><li><a href="SqlQuery.html">SqlQuery</a></li><li><a href="Timestamp.html">Timestamp</a></li></ul>
</nav>
<br class="clear">
<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Tue May 22 2018 12:08:48 GMT+0300 (Russia TZ 2 Standard Time)
</footer>
<script> prettyPrint(); </script>
<script src="scripts/linenumber.js"> </script>
</body>
</html>