1 |
|
2 | import { ConfigParams } from 'pip-services3-commons-node';
|
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 | export declare class ConnectionParams extends ConfigParams {
|
39 | |
40 |
|
41 |
|
42 |
|
43 |
|
44 | constructor(values?: any);
|
45 | /**
|
46 | * Checks if these connection parameters shall be retrieved from [[DiscoveryService]].
|
47 | * The connection parameters are redirected to [[DiscoveryService]] when discovery_key parameter is set.
|
48 | *
|
49 | * @returns true if connection shall be retrieved from [[DiscoveryService]]
|
50 | *
|
51 | * @see [[getDiscoveryKey]]
|
52 | */
|
53 | useDiscovery(): boolean;
|
54 | /**
|
55 | * Gets the key to retrieve this connection from [[DiscoveryService]].
|
56 | * If this key is null, than all parameters are already present.
|
57 | *
|
58 | * @returns the discovery key to retrieve connection.
|
59 | *
|
60 | * @see [[useDiscovery]]
|
61 | */
|
62 | getDiscoveryKey(): string;
|
63 | /**
|
64 | * Sets the key to retrieve these parameters from [[DiscoveryService]].
|
65 | *
|
66 | * @param value a new key to retrieve connection.
|
67 | */
|
68 | setDiscoveryKey(value: string): void;
|
69 | /**
|
70 | * Gets the connection protocol.
|
71 | *
|
72 | * @returns the connection protocol or the default value if it's not set.
|
73 | */
|
74 | getProtocol(): string;
|
75 | /**
|
76 | * Gets the connection protocol with default value.
|
77 | *
|
78 | * @param defaultValue (optional) the default protocol
|
79 | * @returns the connection protocol or the default value if it's not set.
|
80 | */
|
81 | getProtocolWithDefault(defaultValue: string): string;
|
82 | /**
|
83 | * Sets the connection protocol.
|
84 | *
|
85 | * @param value a new connection protocol.
|
86 | */
|
87 | setProtocol(value: string): void;
|
88 | /**
|
89 | * Gets the host name or IP address.
|
90 | *
|
91 | * @returns the host name or IP address.
|
92 | */
|
93 | getHost(): string;
|
94 | /**
|
95 | * Sets the host name or IP address.
|
96 | *
|
97 | * @param value a new host name or IP address.
|
98 | */
|
99 | setHost(value: string): void;
|
100 | /**
|
101 | * Gets the port number.
|
102 | *
|
103 | * @returns the port number.
|
104 | */
|
105 | getPort(): number;
|
106 | /**
|
107 | * Gets the port number with default value.
|
108 | *
|
109 | * @param defaultPort a default port number.
|
110 | * @returns the port number.
|
111 | */
|
112 | getPortWithDefault(defaultPort: number): number;
|
113 | /**
|
114 | * Sets the port number.
|
115 | *
|
116 | * @param value a new port number.
|
117 | *
|
118 | * @see [[getHost]]
|
119 | */
|
120 | setPort(value: number): void;
|
121 | /**
|
122 | * Gets the resource URI or connection string.
|
123 | * Usually it includes all connection parameters in it.
|
124 | *
|
125 | * @returns the resource URI or connection string.
|
126 | */
|
127 | getUri(): string;
|
128 | /**
|
129 | * Sets the resource URI or connection string.
|
130 | *
|
131 | * @param value a new resource URI or connection string.
|
132 | */
|
133 | setUri(value: string): void;
|
134 | /**
|
135 | * Creates a new ConnectionParams object filled with key-value pairs serialized as a string.
|
136 | *
|
137 | * @param line a string with serialized key-value pairs as "key1=value1;key2=value2;..."
|
138 | * Example: "Key1=123;Key2=ABC;Key3=2016-09-16T00:00:00.00Z"
|
139 | * @returns a new ConnectionParams object.
|
140 | *
|
141 | * @see [[StringValueMap.fromString]]
|
142 | */
|
143 | static fromString(line: string): ConnectionParams;
|
144 | /**
|
145 | * Creates a new ConnectionParams object filled with provided key-value pairs called tuples.
|
146 | * Tuples parameters contain a sequence of key1, value1, key2, value2, ... pairs.
|
147 | *
|
148 | * @param tuples the tuples to fill a new ConnectionParams object.
|
149 | * @returns a new ConnectionParams object.
|
150 | */
|
151 | static fromTuples(...tuples: any[]): ConnectionParams;
|
152 | /**
|
153 | * Retrieves all ConnectionParams from configuration parameters
|
154 | * from "connections" section. If "connection" section is present instead,
|
155 | * than it returns a list with only one ConnectionParams.
|
156 | *
|
157 | * @param config a configuration parameters to retrieve connections
|
158 | * @returns a list of retrieved ConnectionParams
|
159 | */
|
160 | static manyFromConfig(config: ConfigParams): ConnectionParams[];
|
161 | /**
|
162 | * Retrieves a single ConnectionParams from configuration parameters
|
163 | * from "connection" section. If "connections" section is present instead,
|
164 | * then is returns only the first connection element.
|
165 | *
|
166 | * @param config ConnectionParams, containing a section named "connection(s)".
|
167 | * @returns the generated ConnectionParams object.
|
168 | *
|
169 | * @see [[manyFromConfig]]
|
170 | */
|
171 | static fromConfig(config: ConfigParams): ConnectionParams;
|
172 | }
|