1 | import { ConfigParams } from 'pip-services3-commons-node';
|
2 | import { IReconfigurable } 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 | export declare class ContextInfo implements IReconfigurable {
|
31 | private _name;
|
32 | private _description;
|
33 | private _contextId;
|
34 | private _startTime;
|
35 | private _properties;
|
36 | |
37 |
|
38 |
|
39 |
|
40 |
|
41 |
|
42 | constructor(name?: string, description?: string);
|
43 | /**
|
44 | * Configures component by passing configuration parameters.
|
45 | *
|
46 | * @param config configuration parameters to be set.
|
47 | */
|
48 | configure(config: ConfigParams): void;
|
49 | /**
|
50 | * Gets the context name.
|
51 | *
|
52 | * @returns the context name
|
53 | */
|
54 | get name(): string;
|
55 | /**
|
56 | * Sets the context name.
|
57 | *
|
58 | * @param value a new name for the context.
|
59 | */
|
60 | set name(value: string);
|
61 | /**
|
62 | * Gets the human-readable description of the context.
|
63 | *
|
64 | * @returns the human-readable description of the context.
|
65 | */
|
66 | get description(): string;
|
67 | /**
|
68 | * Sets the human-readable description of the context.
|
69 | *
|
70 | * @param value a new human readable description of the context.
|
71 | */
|
72 | set description(value: string);
|
73 | /**
|
74 | * Gets the unique context id.
|
75 | * Usually it is the current host name.
|
76 | *
|
77 | * @returns the unique context id.
|
78 | */
|
79 | get contextId(): string;
|
80 | /**
|
81 | * Sets the unique context id.
|
82 | *
|
83 | * @param value a new unique context id.
|
84 | */
|
85 | set contextId(value: string);
|
86 | /**
|
87 | * Gets the context start time.
|
88 | *
|
89 | * @returns the context start time.
|
90 | */
|
91 | get startTime(): Date;
|
92 | /**
|
93 | * Sets the context start time.
|
94 | *
|
95 | * @param value a new context start time.
|
96 | */
|
97 | set startTime(value: Date);
|
98 | /**
|
99 | * Calculates the context uptime as from the start time.
|
100 | *
|
101 | * @returns number of milliseconds from the context start time.
|
102 | */
|
103 | get uptime(): number;
|
104 | /**
|
105 | * Gets context additional parameters.
|
106 | *
|
107 | * @returns a JSON object with additional context parameters.
|
108 | */
|
109 | get properties(): any;
|
110 | /**
|
111 | * Sets context additional parameters.
|
112 | *
|
113 | * @param properties a JSON object with context additional parameters
|
114 | */
|
115 | set properties(properties: any);
|
116 | /**
|
117 | * Creates a new ContextInfo and sets its configuration parameters.
|
118 | *
|
119 | * @param config configuration parameters for the new ContextInfo.
|
120 | * @returns a newly created ContextInfo
|
121 | */
|
122 | static fromConfig(config: ConfigParams): ContextInfo;
|
123 | }
|