@jahia/javascript-modules-library 0.0.1

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.
Files changed (87) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +35 -0
  3. package/core/index.js +1 -0
  4. package/core/server/components/AbsoluteArea.js +1 -0
  5. package/core/server/components/AddContentButtons.js +1 -0
  6. package/core/server/components/AddResources.js +1 -0
  7. package/core/server/components/Area.js +1 -0
  8. package/core/server/components/index.js +1 -0
  9. package/core/server/components/render/HydrateInBrowser.js +1 -0
  10. package/core/server/components/render/Render.js +1 -0
  11. package/core/server/components/render/RenderInBrowser.js +1 -0
  12. package/core/server/components/render/index.js +1 -0
  13. package/core/server/components/render/internal/InBrowser.js +1 -0
  14. package/core/server/framework/defineJahiaComponent.js +1 -0
  15. package/core/server/framework/index.js +1 -0
  16. package/core/server/framework/register.js +1 -0
  17. package/core/server/hooks/index.js +1 -0
  18. package/core/server/hooks/useGQLQuery.js +1 -0
  19. package/core/server/hooks/useJCRQuery.js +1 -0
  20. package/core/server/hooks/useServerContext.js +1 -0
  21. package/core/server/hooks/useUrlBuilder.js +1 -0
  22. package/core/server/index.js +1 -0
  23. package/core/server/utils/index.js +1 -0
  24. package/core/server/utils/jcr/getChildNodes.js +1 -0
  25. package/core/server/utils/jcr/getNodeFromPathOrId.js +1 -0
  26. package/core/server/utils/jcr/getNodeProps.js +1 -0
  27. package/core/server/utils/jcr/getNodesByJCRQuery.js +1 -0
  28. package/core/server/utils/jcr/index.js +1 -0
  29. package/core/server/utils/urlBuilder/index.js +1 -0
  30. package/core/server/utils/urlBuilder/urlBuilder.js +1 -0
  31. package/index.js +1 -0
  32. package/nav/index.js +1 -0
  33. package/nav/server/index.js +1 -0
  34. package/nav/server/navBuilder/index.js +1 -0
  35. package/nav/server/navBuilder/navBuilder.js +24 -0
  36. package/package.json +60 -0
  37. package/types/@jahia/javascript-modules-library-private.d.ts +60 -0
  38. package/types/core/index.d.ts +1 -0
  39. package/types/core/server/components/AbsoluteArea.d.ts +29 -0
  40. package/types/core/server/components/AddContentButtons.d.ts +13 -0
  41. package/types/core/server/components/AddResources.d.ts +31 -0
  42. package/types/core/server/components/Area.d.ts +27 -0
  43. package/types/core/server/components/index.d.ts +5 -0
  44. package/types/core/server/components/render/HydrateInBrowser.d.ts +13 -0
  45. package/types/core/server/components/render/Render.d.ts +23 -0
  46. package/types/core/server/components/render/RenderInBrowser.d.ts +13 -0
  47. package/types/core/server/components/render/index.d.ts +3 -0
  48. package/types/core/server/components/render/internal/InBrowser.d.ts +8 -0
  49. package/types/core/server/framework/defineJahiaComponent.d.ts +41 -0
  50. package/types/core/server/framework/index.d.ts +2 -0
  51. package/types/core/server/framework/register.d.ts +7 -0
  52. package/types/core/server/hooks/index.d.ts +4 -0
  53. package/types/core/server/hooks/useGQLQuery.d.ts +5 -0
  54. package/types/core/server/hooks/useJCRQuery.d.ts +3 -0
  55. package/types/core/server/hooks/useServerContext.d.ts +14 -0
  56. package/types/core/server/hooks/useUrlBuilder.d.ts +31 -0
  57. package/types/core/server/index.d.ts +4 -0
  58. package/types/core/server/utils/index.d.ts +2 -0
  59. package/types/core/server/utils/jcr/getChildNodes.d.ts +9 -0
  60. package/types/core/server/utils/jcr/getNodeFromPathOrId.d.ts +12 -0
  61. package/types/core/server/utils/jcr/getNodeProps.d.ts +7 -0
  62. package/types/core/server/utils/jcr/getNodesByJCRQuery.d.ts +9 -0
  63. package/types/core/server/utils/jcr/index.d.ts +4 -0
  64. package/types/core/server/utils/urlBuilder/index.d.ts +1 -0
  65. package/types/core/server/utils/urlBuilder/urlBuilder.d.ts +27 -0
  66. package/types/globals.d.ts +11 -0
  67. package/types/index.d.ts +19 -0
  68. package/types/java.io.d.ts +694 -0
  69. package/types/java.net.d.ts +190 -0
  70. package/types/java.security.d.ts +27 -0
  71. package/types/java.util.d.ts +1536 -0
  72. package/types/javax.jcr.d.ts +1250 -0
  73. package/types/javax.servlet.d.ts +426 -0
  74. package/types/javax.servlet.http.d.ts +1431 -0
  75. package/types/nav/index.d.ts +1 -0
  76. package/types/nav/server/index.d.ts +1 -0
  77. package/types/nav/server/navBuilder/index.d.ts +1 -0
  78. package/types/nav/server/navBuilder/navBuilder.d.ts +78 -0
  79. package/types/org.jahia.modules.npm.modules.engine.js.server.d.ts +292 -0
  80. package/types/org.jahia.services.content.d.ts +1463 -0
  81. package/types/org.jahia.services.content.decorator.d.ts +92 -0
  82. package/types/org.jahia.services.query.d.ts +35 -0
  83. package/types/org.jahia.services.render.d.ts +168 -0
  84. package/types/org.jahia.services.usermanager.d.ts +85 -0
  85. package/types/org.osgi.framework.d.ts +1004 -0
  86. package/types/server.d.ts +27 -0
  87. package/types/servercontext.d.ts +29 -0
@@ -0,0 +1,1431 @@
1
+ declare module 'javax.servlet.http' {
2
+ import { Principal } from 'java.security';
3
+ import { ServletInputStream, ServletOutputStream } from 'javax.servlet';
4
+ import { Locale, Enumeration, Collection, Map } from 'java.util';
5
+ import { BufferedReader, PrintWriter } from 'java.io';
6
+ /**
7
+ *
8
+ * Creates a cookie, a small amount of information sent by a servlet to
9
+ * a Web browser, saved by the browser, and later sent back to the server.
10
+ * A cookie's value can uniquely
11
+ * identify a client, so cookies are commonly used for session management.
12
+ *
13
+ * A cookie has a name, a single value, and optional attributes
14
+ * such as a comment, path and domain qualifiers, a maximum age, and a
15
+ * version number. Some Web browsers have bugs in how they handle the
16
+ * optional attributes, so use them sparingly to improve the interoperability
17
+ * of your servlets.
18
+ *
19
+ * The servlet sends cookies to the browser by using the
20
+ * {@link HttpServletResponse#addCookie} method, which adds
21
+ * fields to HTTP response headers to send cookies to the
22
+ * browser, one at a time. The browser is expected to
23
+ * support 20 cookies for each Web server, 300 cookies total, and
24
+ * may limit cookie size to 4 KB each.
25
+ *
26
+ * The browser returns cookies to the servlet by adding
27
+ * fields to HTTP request headers. Cookies can be retrieved
28
+ * from a request by using the {@link HttpServletRequest#getCookies} method.
29
+ * Several cookies might have the same name but different path attributes.
30
+ *
31
+ * Cookies affect the caching of the Web pages that use them.
32
+ * HTTP 1.0 does not cache pages that use cookies created with
33
+ * this class. This class does not support the cache control
34
+ * defined with HTTP 1.1.
35
+ *
36
+ * This class supports both the Version 0 (by Netscape) and Version 1
37
+ * (by RFC 2109) cookie specifications. By default, cookies are
38
+ * created using Version 0 to ensure the best interoperability.
39
+ *
40
+ * @author Various
41
+ */
42
+ export class Cookie {
43
+ /**
44
+ * Returns the comment describing the purpose of this cookie, or
45
+ * null if the cookie has no comment.
46
+ *
47
+ * @return the comment of the cookie, or null if unspecified
48
+ *
49
+ * @see #setComment
50
+ */
51
+ getComment(): string;
52
+ /**
53
+ * Gets the domain name of this Cookie.
54
+ *
55
+ * Domain names are formatted according to RFC 2109.
56
+ *
57
+ * @return the domain name of this Cookie
58
+ *
59
+ * @see #setDomain
60
+ */
61
+ getDomain(): string;
62
+ /**
63
+ * Gets the maximum age in seconds of this Cookie.
64
+ *
65
+ * By default, -1 is returned, which indicates that
66
+ * the cookie will persist until browser shutdown.
67
+ *
68
+ * @return an integer specifying the maximum age of the
69
+ * cookie in seconds; if negative, means
70
+ * the cookie persists until browser shutdown
71
+ *
72
+ * @see #setMaxAge
73
+ */
74
+ getMaxAge(): number;
75
+ /**
76
+ * Returns the path on the server
77
+ * to which the browser returns this cookie. The
78
+ * cookie is visible to all subpaths on the server.
79
+ *
80
+ * @return a String specifying a path that contains
81
+ * a servlet name, for example, /catalog
82
+ *
83
+ * @see #setPath
84
+ */
85
+ getPath(): string;
86
+ /**
87
+ * Returns true if the browser is sending cookies
88
+ * only over a secure protocol, or false if the
89
+ * browser can send cookies using any protocol.
90
+ *
91
+ * @return true if the browser uses a secure protocol,
92
+ * false otherwise
93
+ *
94
+ * @see #setSecure
95
+ */
96
+ getSecure(): boolean;
97
+ /**
98
+ * Returns the name of the cookie. The name cannot be changed after
99
+ * creation.
100
+ *
101
+ * @return the name of the cookie
102
+ */
103
+ getName(): string;
104
+ /**
105
+ * Gets the current value of this Cookie.
106
+ *
107
+ * @return the current value of this Cookie
108
+ *
109
+ * @see #setValue
110
+ */
111
+ getValue(): string;
112
+ /**
113
+ * Returns the version of the protocol this cookie complies
114
+ * with. Version 1 complies with RFC 2109,
115
+ * and version 0 complies with the original
116
+ * cookie specification drafted by Netscape. Cookies provided
117
+ * by a browser use and identify the browser's cookie version.
118
+ *
119
+ * @return 0 if the cookie complies with the
120
+ * original Netscape specification; 1
121
+ * if the cookie complies with RFC 2109
122
+ *
123
+ * @see #setVersion
124
+ */
125
+ getVersion(): number;
126
+ /**
127
+ * Checks whether this Cookie has been marked as HttpOnly.
128
+ *
129
+ * @return true if this Cookie has been marked as HttpOnly,
130
+ * false otherwise
131
+ *
132
+ * @since Servlet 3.0
133
+ */
134
+ isHttpOnly(): boolean;
135
+ }
136
+ export class HttpServletRequest {
137
+ /**
138
+ * Returns the name of the authentication scheme used to protect
139
+ * the servlet. All servlet containers support basic, form and client
140
+ * certificate authentication, and may additionally support digest
141
+ * authentication.
142
+ * If the servlet is not authenticated null is returned.
143
+ *
144
+ * Same as the value of the CGI variable AUTH_TYPE.
145
+ *
146
+ * @return one of the static members BASIC_AUTH,
147
+ * FORM_AUTH, CLIENT_CERT_AUTH, DIGEST_AUTH
148
+ * (suitable for == comparison) or
149
+ * the container-specific string indicating
150
+ * the authentication scheme, or
151
+ * null if the request was
152
+ * not authenticated.
153
+ */
154
+ getAuthType(): string;
155
+ /**
156
+ * Returns an array containing all of the Cookie
157
+ * objects the client sent with this request.
158
+ * This method returns null if no cookies were sent.
159
+ *
160
+ * @return an array of all the Cookies
161
+ * included with this request, or null
162
+ * if the request has no cookies
163
+ */
164
+ getCookies(): Cookie[];
165
+ /**
166
+ * Returns the value of the specified request header
167
+ * as a long value that represents a
168
+ * Date object. Use this method with
169
+ * headers that contain dates, such as
170
+ * If-Modified-Since.
171
+ *
172
+ * The date is returned as
173
+ * the number of milliseconds since January 1, 1970 GMT.
174
+ * The header name is case insensitive.
175
+ *
176
+ * If the request did not have a header of the
177
+ * specified name, this method returns -1. If the header
178
+ * can't be converted to a date, the method throws
179
+ * an IllegalArgumentException.
180
+ *
181
+ * @param name a String specifying the
182
+ * name of the header
183
+ *
184
+ * @return a long value
185
+ * representing the date specified
186
+ * in the header expressed as
187
+ * the number of milliseconds
188
+ * since January 1, 1970 GMT,
189
+ * or -1 if the named header
190
+ * was not included with the
191
+ * request
192
+ *
193
+ * @exception IllegalArgumentException If the header value
194
+ * can't be converted
195
+ * to a date
196
+ */
197
+ getDateHeader(name: string): number;
198
+ /**
199
+ * Returns the value of the specified request header
200
+ * as a String. If the request did not include a header
201
+ * of the specified name, this method returns null.
202
+ * If there are multiple headers with the same name, this method
203
+ * returns the first head in the request.
204
+ * The header name is case insensitive. You can use
205
+ * this method with any request header.
206
+ *
207
+ * @param name a String specifying the
208
+ * header name
209
+ *
210
+ * @return a String containing the
211
+ * value of the requested
212
+ * header, or null
213
+ * if the request does not
214
+ * have a header of that name
215
+ */
216
+ getHeader(name: string): string;
217
+ /**
218
+ * Returns all the values of the specified request header
219
+ * as an Enumeration of String objects.
220
+ *
221
+ * Some headers, such as Accept-Language can be sent
222
+ * by clients as several headers each with a different value rather than
223
+ * sending the header as a comma separated list.
224
+ *
225
+ * If the request did not include any headers
226
+ * of the specified name, this method returns an empty
227
+ * Enumeration.
228
+ * The header name is case insensitive. You can use
229
+ * this method with any request header.
230
+ *
231
+ * @param name a String specifying the
232
+ * header name
233
+ *
234
+ * @return an Enumeration containing
235
+ * the values of the requested header. If
236
+ * the request does not have any headers of
237
+ * that name return an empty
238
+ * enumeration. If
239
+ * the container does not allow access to
240
+ * header information, return null
241
+ */
242
+ getHeaders(name: string): Enumeration<string>;
243
+ /**
244
+ * Returns an enumeration of all the header names
245
+ * this request contains. If the request has no
246
+ * headers, this method returns an empty enumeration.
247
+ *
248
+ * Some servlet containers do not allow
249
+ * servlets to access headers using this method, in
250
+ * which case this method returns null
251
+ *
252
+ * @return an enumeration of all the
253
+ * header names sent with this
254
+ * request; if the request has
255
+ * no headers, an empty enumeration;
256
+ * if the servlet container does not
257
+ * allow servlets to use this method,
258
+ * null
259
+ */
260
+ getHeaderNames(): Enumeration<string>;
261
+ /**
262
+ * Returns the value of the specified request header
263
+ * as an int. If the request does not have a header
264
+ * of the specified name, this method returns -1. If the
265
+ * header cannot be converted to an integer, this method
266
+ * throws a NumberFormatException.
267
+ *
268
+ * The header name is case insensitive.
269
+ *
270
+ * @param name a String specifying the name
271
+ * of a request header
272
+ *
273
+ * @return an integer expressing the value
274
+ * of the request header or -1
275
+ * if the request doesn't have a
276
+ * header of this name
277
+ *
278
+ * @exception NumberFormatException If the header value
279
+ * can't be converted
280
+ * to an int
281
+ */
282
+ getIntHeader(name: string): number;
283
+ /**
284
+ * Returns the name of the HTTP method with which this
285
+ * request was made, for example, GET, POST, or PUT.
286
+ * Same as the value of the CGI variable REQUEST_METHOD.
287
+ *
288
+ * @return a String
289
+ * specifying the name
290
+ * of the method with which
291
+ * this request was made
292
+ */
293
+ getMethod(): string;
294
+ /**
295
+ * Returns any extra path information associated with
296
+ * the URL the client sent when it made this request.
297
+ * The extra path information follows the servlet path
298
+ * but precedes the query string and will start with
299
+ * a "/" character.
300
+ *
301
+ * This method returns null if there
302
+ * was no extra path information.
303
+ *
304
+ * Same as the value of the CGI variable PATH_INFO.
305
+ *
306
+ * @return a String, decoded by the
307
+ * web container, specifying
308
+ * extra path information that comes
309
+ * after the servlet path but before
310
+ * the query string in the request URL;
311
+ * or null if the URL does not have
312
+ * any extra path information
313
+ */
314
+ getPathInfo(): string;
315
+ /**
316
+ * Returns any extra path information after the servlet name
317
+ * but before the query string, and translates it to a real
318
+ * path. Same as the value of the CGI variable PATH_TRANSLATED.
319
+ *
320
+ * If the URL does not have any extra path information,
321
+ * this method returns null or the servlet container
322
+ * cannot translate the virtual path to a real path for any reason
323
+ * (such as when the web application is executed from an archive).
324
+ *
325
+ * The web container does not decode this string.
326
+ *
327
+ * @return a String specifying the
328
+ * real path, or null if
329
+ * the URL does not have any extra path
330
+ * information
331
+ */
332
+ getPathTranslated(): string;
333
+ /**
334
+ * Returns the portion of the request URI that indicates the context
335
+ * of the request. The context path always comes first in a request
336
+ * URI. The path starts with a "/" character but does not end with a "/"
337
+ * character. For servlets in the default (root) context, this method
338
+ * returns "". The container does not decode this string.
339
+ *
340
+ * It is possible that a servlet container may match a context by
341
+ * more than one context path. In such cases this method will return the
342
+ * actual context path used by the request and it may differ from the
343
+ * path returned by the
344
+ * {@link javax.servlet.ServletContext#getContextPath()} method.
345
+ * The context path returned by
346
+ * {@link javax.servlet.ServletContext#getContextPath()}
347
+ * should be considered as the prime or preferred context path of the
348
+ * application.
349
+ *
350
+ * @return a String specifying the
351
+ * portion of the request URI that indicates the context
352
+ * of the request
353
+ *
354
+ * @see javax.servlet.ServletContext#getContextPath()
355
+ */
356
+ getContextPath(): string;
357
+ /**
358
+ * Returns the query string that is contained in the request
359
+ * URL after the path. This method returns null
360
+ * if the URL does not have a query string. Same as the value
361
+ * of the CGI variable QUERY_STRING.
362
+ *
363
+ * @return a String containing the query
364
+ * string or null if the URL
365
+ * contains no query string. The value is not
366
+ * decoded by the container.
367
+ */
368
+ getQueryString(): string;
369
+ /**
370
+ * Returns the login of the user making this request, if the
371
+ * user has been authenticated, or null if the user
372
+ * has not been authenticated.
373
+ * Whether the user name is sent with each subsequent request
374
+ * depends on the browser and type of authentication. Same as the
375
+ * value of the CGI variable REMOTE_USER.
376
+ *
377
+ * @return a String specifying the login
378
+ * of the user making this request, or null
379
+ * if the user login is not known
380
+ */
381
+ getRemoteUser(): string;
382
+ /**
383
+ * Returns a boolean indicating whether the authenticated user is included
384
+ * in the specified logical "role". Roles and role membership can be
385
+ * defined using deployment descriptors. If the user has not been
386
+ * authenticated, the method returns false.
387
+ *
388
+ * The role name “*” should never be used as an argument in calling
389
+ * isUserInRole. Any call to isUserInRole with
390
+ * “*” must return false.
391
+ * If the role-name of the security-role to be tested is “**”, and
392
+ * the application has NOT declared an application security-role with
393
+ * role-name “**”, isUserInRole must only return true if
394
+ * the user has been authenticated; that is, only when
395
+ * {@link #getRemoteUser} and {@link #getUserPrincipal} would both return
396
+ * a non-null value. Otherwise, the container must check
397
+ * the user for membership in the application role.
398
+ *
399
+ * @param role a String specifying the name
400
+ * of the role
401
+ *
402
+ * @return a boolean indicating whether
403
+ * the user making this request belongs to a given role;
404
+ * false if the user has not been
405
+ * authenticated
406
+ */
407
+ isUserInRole(role: string): boolean;
408
+ /**
409
+ * Returns a java.security.Principal object containing
410
+ * the name of the current authenticated user. If the user has not been
411
+ * authenticated, the method returns null.
412
+ *
413
+ * @return a java.security.Principal containing
414
+ * the name of the user making this request;
415
+ * null if the user has not been
416
+ * authenticated
417
+ */
418
+ getUserPrincipal(): Principal;
419
+ /**
420
+ * Returns the session ID specified by the client. This may
421
+ * not be the same as the ID of the current valid session
422
+ * for this request.
423
+ * If the client did not specify a session ID, this method returns
424
+ * null.
425
+ *
426
+ * @return a String specifying the session
427
+ * ID, or null if the request did
428
+ * not specify a session ID
429
+ *
430
+ * @see #isRequestedSessionIdValid
431
+ */
432
+ getRequestedSessionId(): string;
433
+ /**
434
+ * Returns the part of this request's URL from the protocol
435
+ * name up to the query string in the first line of the HTTP request.
436
+ * The web container does not decode this String.
437
+ * For example:
438
+ *
439
+ *
440
+ * First line of HTTP request
441
+ * Returned Value
442
+ * POST /some/path.html HTTP/1.1/some/path.html
443
+ * GET http://foo.bar/a.html HTTP/1.0
444
+ * /a.html
445
+ * HEAD /xyz?a=b HTTP/1.1/xyz
446
+ *
447
+ *
448
+ * To reconstruct an URL with a scheme and host, use
449
+ * {@link HttpUtils#getRequestURL}.
450
+ *
451
+ * @return a String containing
452
+ * the part of the URL from the
453
+ * protocol name up to the query string
454
+ *
455
+ * @see HttpUtils#getRequestURL
456
+ */
457
+ getRequestURI(): string;
458
+ /**
459
+ * Returns the part of this request's URL that calls
460
+ * the servlet. This path starts with a "/" character
461
+ * and includes either the servlet name or a path to
462
+ * the servlet, but does not include any extra path
463
+ * information or a query string. Same as the value of
464
+ * the CGI variable SCRIPT_NAME.
465
+ *
466
+ * This method will return an empty string ("") if the
467
+ * servlet used to process this request was matched using
468
+ * the "/*" pattern.
469
+ *
470
+ * @return a String containing
471
+ * the name or path of the servlet being
472
+ * called, as specified in the request URL,
473
+ * decoded, or an empty string if the servlet
474
+ * used to process the request is matched
475
+ * using the "/*" pattern.
476
+ */
477
+ getServletPath(): string;
478
+ /**
479
+ * Returns the current HttpSession
480
+ * associated with this request or, if there is no
481
+ * current session and create is true, returns
482
+ * a new session.
483
+ *
484
+ * If create is false
485
+ * and the request has no valid HttpSession,
486
+ * this method returns null.
487
+ *
488
+ * To make sure the session is properly maintained,
489
+ * you must call this method before
490
+ * the response is committed. If the container is using cookies
491
+ * to maintain session integrity and is asked to create a new session
492
+ * when the response is committed, an IllegalStateException is thrown.
493
+ *
494
+ * @param create true to create
495
+ * a new session for this request if necessary;
496
+ * false to return null
497
+ * if there's no current session
498
+ *
499
+ * @return the HttpSession associated
500
+ * with this request or null if
501
+ * create is false
502
+ * and the request has no valid session
503
+ *
504
+ * @see #getSession()
505
+ */
506
+ getSession(create: boolean): HttpSession;
507
+ /**
508
+ * Returns the current session associated with this request,
509
+ * or if the request does not have a session, creates one.
510
+ *
511
+ * @return the HttpSession associated
512
+ * with this request
513
+ *
514
+ * @see #getSession(boolean)
515
+ */
516
+ getSession(): HttpSession;
517
+ /**
518
+ * Checks whether the requested session ID is still valid.
519
+ *
520
+ * If the client did not specify any session ID, this method returns
521
+ * false.
522
+ *
523
+ * @return true if this
524
+ * request has an id for a valid session
525
+ * in the current session context;
526
+ * false otherwise
527
+ *
528
+ * @see #getRequestedSessionId
529
+ * @see #getSession
530
+ * @see HttpSessionContext
531
+ */
532
+ isRequestedSessionIdValid(): boolean;
533
+ /**
534
+ * Checks whether the requested session ID came in as a cookie.
535
+ *
536
+ * @return true if the session ID
537
+ * came in as a
538
+ * cookie; otherwise, false
539
+ *
540
+ * @see #getSession
541
+ */
542
+ isRequestedSessionIdFromCookie(): boolean;
543
+ /**
544
+ * Checks whether the requested session ID came in as part of the
545
+ * request URL.
546
+ *
547
+ * @return true if the session ID
548
+ * came in as part of a URL; otherwise,
549
+ * false
550
+ *
551
+ * @see #getSession
552
+ */
553
+ isRequestedSessionIdFromURL(): boolean;
554
+ /**
555
+ * @deprecated As of Version 2.1 of the Java Servlet
556
+ * API, use {@link #isRequestedSessionIdFromURL}
557
+ * instead.
558
+ */
559
+ isRequestedSessionIdFromUrl(): boolean;
560
+ /**
561
+ * Gets all the {@link Part} components of this request, provided
562
+ * that it is of type multipart/form-data.
563
+ *
564
+ * If this request is of type multipart/form-data, but
565
+ * does not contain any Part components, the returned
566
+ * Collection will be empty.
567
+ *
568
+ * Any changes to the returned Collection must not
569
+ * affect this HttpServletRequest.
570
+ *
571
+ * @return a (possibly empty) Collection of the
572
+ * Part components of this request
573
+ *
574
+ * @throws IOException if an I/O error occurred during the retrieval
575
+ * of the {@link Part} components of this request
576
+ *
577
+ * @throws ServletException if this request is not of type
578
+ * multipart/form-data
579
+ *
580
+ * @throws IllegalStateException if the request body is larger than
581
+ * maxRequestSize, or any Part in the
582
+ * request is larger than maxFileSize, or there is no
583
+ * @MultipartConfig or multipart-config in
584
+ * deployment descriptors
585
+ *
586
+ * @see javax.servlet.annotation.MultipartConfig#maxFileSize
587
+ * @see javax.servlet.annotation.MultipartConfig#maxRequestSize
588
+ *
589
+ * @since Servlet 3.0
590
+ */
591
+ getParts(): Collection<Part>;
592
+ /**
593
+ * Gets the {@link Part} with the given name.
594
+ *
595
+ * @param name the name of the requested Part
596
+ *
597
+ * @return The Part with the given name, or
598
+ * null if this request is of type
599
+ * multipart/form-data, but does not
600
+ * contain the requested Part
601
+ *
602
+ * @throws IOException if an I/O error occurred during the retrieval
603
+ * of the requested Part
604
+ * @throws ServletException if this request is not of type
605
+ * multipart/form-data
606
+ * @throws IllegalStateException if the request body is larger than
607
+ * maxRequestSize, or any Part in the
608
+ * request is larger than maxFileSize, or there is no
609
+ * @MultipartConfig or multipart-config in
610
+ * deployment descriptors
611
+ *
612
+ * @see javax.servlet.annotation.MultipartConfig#maxFileSize
613
+ * @see javax.servlet.annotation.MultipartConfig#maxRequestSize
614
+ *
615
+ * @since Servlet 3.0
616
+ */
617
+ getPart(name: string): Part;
618
+ /**
619
+ * Returns the value of the named attribute as an Object,
620
+ * or null if no attribute of the given name exists.
621
+ *
622
+ * Attributes can be set two ways. The servlet container may set
623
+ * attributes to make available custom information about a request.
624
+ * For example, for requests made using HTTPS, the attribute
625
+ * javax.servlet.request.X509Certificate can be used to
626
+ * retrieve information on the certificate of the client. Attributes
627
+ * can also be set programatically using
628
+ * {@link ServletRequest#setAttribute}. This allows information to be
629
+ * embedded into a request before a {@link RequestDispatcher} call.
630
+ *
631
+ * Attribute names should follow the same conventions as package
632
+ * names. This specification reserves names matching java.*,
633
+ * javax.*, and sun.*.
634
+ *
635
+ * @param name a String specifying the name of the attribute
636
+ *
637
+ * @return an Object containing the value of the attribute,
638
+ * or null if the attribute does not exist
639
+ */
640
+ getAttribute(name: string): any;
641
+ /**
642
+ * Returns an Enumeration containing the
643
+ * names of the attributes available to this request.
644
+ * This method returns an empty Enumeration
645
+ * if the request has no attributes available to it.
646
+ *
647
+ * @return an Enumeration of strings containing the names
648
+ * of the request's attributes
649
+ */
650
+ getAttributeNames(): Enumeration<string>;
651
+ /**
652
+ * Returns the name of the character encoding used in the body of this
653
+ * request. This method returns null if the request
654
+ * does not specify a character encoding
655
+ *
656
+ * @return a String containing the name of the character
657
+ * encoding, or null if the request does not specify a
658
+ * character encoding
659
+ */
660
+ getCharacterEncoding(): string;
661
+ /**
662
+ * Returns the length, in bytes, of the request body and made available by
663
+ * the input stream, or -1 if the length is not known ir is greater than
664
+ * Integer.MAX_VALUE. For HTTP servlets,
665
+ * same as the value of the CGI variable CONTENT_LENGTH.
666
+ *
667
+ * @return an integer containing the length of the request body or -1 if
668
+ * the length is not known or is greater than Integer.MAX_VALUE.
669
+ */
670
+ getContentLength(): number;
671
+ /**
672
+ * Returns the length, in bytes, of the request body and made available by
673
+ * the input stream, or -1 if the length is not known. For HTTP servlets,
674
+ * same as the value of the CGI variable CONTENT_LENGTH.
675
+ *
676
+ * @return a long containing the length of the request body or -1L if
677
+ * the length is not known
678
+ *
679
+ * @since Servlet 3.1
680
+ */
681
+ getContentLengthLong(): number;
682
+ /**
683
+ * Returns the MIME type of the body of the request, or
684
+ * null if the type is not known. For HTTP servlets,
685
+ * same as the value of the CGI variable CONTENT_TYPE.
686
+ *
687
+ * @return a String containing the name of the MIME type
688
+ * of the request, or null if the type is not known
689
+ */
690
+ getContentType(): string;
691
+ /**
692
+ * Retrieves the body of the request as binary data using
693
+ * a {@link ServletInputStream}. Either this method or
694
+ * {@link #getReader} may be called to read the body, not both.
695
+ *
696
+ * @return a {@link ServletInputStream} object containing
697
+ * the body of the request
698
+ *
699
+ * @exception IllegalStateException if the {@link #getReader} method
700
+ * has already been called for this request
701
+ *
702
+ * @exception IOException if an input or output exception occurred
703
+ */
704
+ getInputStream(): ServletInputStream;
705
+ /**
706
+ * Returns the value of a request parameter as a String,
707
+ * or null if the parameter does not exist. Request parameters
708
+ * are extra information sent with the request. For HTTP servlets,
709
+ * parameters are contained in the query string or posted form data.
710
+ *
711
+ * You should only use this method when you are sure the
712
+ * parameter has only one value. If the parameter might have
713
+ * more than one value, use {@link #getParameterValues}.
714
+ *
715
+ * If you use this method with a multivalued
716
+ * parameter, the value returned is equal to the first value
717
+ * in the array returned by getParameterValues.
718
+ *
719
+ * If the parameter data was sent in the request body, such as occurs
720
+ * with an HTTP POST request, then reading the body directly via {@link
721
+ * #getInputStream} or {@link #getReader} can interfere
722
+ * with the execution of this method.
723
+ *
724
+ * @param name a String specifying the name of the parameter
725
+ *
726
+ * @return a String representing the single value of
727
+ * the parameter
728
+ *
729
+ * @see #getParameterValues
730
+ */
731
+ getParameter(name: string): string;
732
+ /**
733
+ *
734
+ * Returns an Enumeration of String
735
+ * objects containing the names of the parameters contained
736
+ * in this request. If the request has
737
+ * no parameters, the method returns an empty Enumeration.
738
+ *
739
+ * @return an Enumeration of String
740
+ * objects, each String containing the name of
741
+ * a request parameter; or an empty Enumeration
742
+ * if the request has no parameters
743
+ */
744
+ getParameterNames(): Enumeration<string>;
745
+ /**
746
+ * Returns an array of String objects containing
747
+ * all of the values the given request parameter has, or
748
+ * null if the parameter does not exist.
749
+ *
750
+ * If the parameter has a single value, the array has a length
751
+ * of 1.
752
+ *
753
+ * @param name a String containing the name of
754
+ * the parameter whose value is requested
755
+ *
756
+ * @return an array of String objects
757
+ * containing the parameter's values
758
+ *
759
+ * @see #getParameter
760
+ */
761
+ getParameterValues(name: string): string[];
762
+ /**
763
+ * Returns a java.util.Map of the parameters of this request.
764
+ *
765
+ * Request parameters are extra information sent with the request.
766
+ * For HTTP servlets, parameters are contained in the query string or
767
+ * posted form data.
768
+ *
769
+ * @return an immutable java.util.Map containing parameter names as
770
+ * keys and parameter values as map values. The keys in the parameter
771
+ * map are of type String. The values in the parameter map are of type
772
+ * String array.
773
+ */
774
+ getParameterMap(): Map<string, string[]>;
775
+ /**
776
+ * Returns the name and version of the protocol the request uses
777
+ * in the form protocol/majorVersion.minorVersion, for
778
+ * example, HTTP/1.1. For HTTP servlets, the value
779
+ * returned is the same as the value of the CGI variable
780
+ * SERVER_PROTOCOL.
781
+ *
782
+ * @return a String containing the protocol
783
+ * name and version number
784
+ */
785
+ getProtocol(): string;
786
+ /**
787
+ * Returns the name of the scheme used to make this request,
788
+ * for example,
789
+ * http, https, or ftp.
790
+ * Different schemes have different rules for constructing URLs,
791
+ * as noted in RFC 1738.
792
+ *
793
+ * @return a String containing the name
794
+ * of the scheme used to make this request
795
+ */
796
+ getScheme(): string;
797
+ /**
798
+ * Returns the host name of the server to which the request was sent.
799
+ * It is the value of the part before ":" in the Host
800
+ * header value, if any, or the resolved server name, or the server IP
801
+ * address.
802
+ *
803
+ * @return a String containing the name of the server
804
+ */
805
+ getServerName(): string;
806
+ /**
807
+ * Returns the port number to which the request was sent.
808
+ * It is the value of the part after ":" in the Host
809
+ * header value, if any, or the server port where the client connection
810
+ * was accepted on.
811
+ *
812
+ * @return an integer specifying the port number
813
+ */
814
+ getServerPort(): number;
815
+ /**
816
+ * Retrieves the body of the request as character data using
817
+ * a BufferedReader. The reader translates the character
818
+ * data according to the character encoding used on the body.
819
+ * Either this method or {@link #getInputStream} may be called to read the
820
+ * body, not both.
821
+ *
822
+ * @return a BufferedReader containing the body of the request
823
+ *
824
+ * @exception UnsupportedEncodingException if the character set encoding
825
+ * used is not supported and the text cannot be decoded
826
+ *
827
+ * @exception IllegalStateException if {@link #getInputStream} method
828
+ * has been called on this request
829
+ *
830
+ * @exception IOException if an input or output exception occurred
831
+ *
832
+ * @see #getInputStream
833
+ */
834
+ getReader(): BufferedReader;
835
+ /**
836
+ * Returns the Internet Protocol (IP) address of the client
837
+ * or last proxy that sent the request.
838
+ * For HTTP servlets, same as the value of the
839
+ * CGI variable REMOTE_ADDR.
840
+ *
841
+ * @return a String containing the
842
+ * IP address of the client that sent the request
843
+ */
844
+ getRemoteAddr(): string;
845
+ /**
846
+ * Returns the fully qualified name of the client
847
+ * or the last proxy that sent the request.
848
+ * If the engine cannot or chooses not to resolve the hostname
849
+ * (to improve performance), this method returns the dotted-string form of
850
+ * the IP address. For HTTP servlets, same as the value of the CGI variable
851
+ * REMOTE_HOST.
852
+ *
853
+ * @return a String containing the fully
854
+ * qualified name of the client
855
+ */
856
+ getRemoteHost(): string;
857
+ /**
858
+ * Returns the preferred Locale that the client will
859
+ * accept content in, based on the Accept-Language header.
860
+ * If the client request doesn't provide an Accept-Language header,
861
+ * this method returns the default locale for the server.
862
+ *
863
+ * @return the preferred Locale for the client
864
+ */
865
+ getLocale(): Locale;
866
+ /**
867
+ * Returns an Enumeration of Locale objects
868
+ * indicating, in decreasing order starting with the preferred locale, the
869
+ * locales that are acceptable to the client based on the Accept-Language
870
+ * header.
871
+ * If the client request doesn't provide an Accept-Language header,
872
+ * this method returns an Enumeration containing one
873
+ * Locale, the default locale for the server.
874
+ *
875
+ * @return an Enumeration of preferred
876
+ * Locale objects for the client
877
+ */
878
+ getLocales(): Enumeration<Locale>;
879
+ /**
880
+ *
881
+ * Returns a boolean indicating whether this request was made using a
882
+ * secure channel, such as HTTPS.
883
+ *
884
+ * @return a boolean indicating if the request was made using a
885
+ * secure channel
886
+ */
887
+ isSecure(): boolean;
888
+ /**
889
+ * @deprecated As of Version 2.1 of the Java Servlet API,
890
+ * use {@link ServletContext#getRealPath} instead.
891
+ */
892
+ getRealPath(path: string): string;
893
+ /**
894
+ * Returns the Internet Protocol (IP) source port of the client
895
+ * or last proxy that sent the request.
896
+ *
897
+ * @return an integer specifying the port number
898
+ *
899
+ * @since Servlet 2.4
900
+ */
901
+ getRemotePort(): number;
902
+ /**
903
+ * Returns the host name of the Internet Protocol (IP) interface on
904
+ * which the request was received.
905
+ *
906
+ * @return a String containing the host
907
+ * name of the IP on which the request was received.
908
+ *
909
+ * @since Servlet 2.4
910
+ */
911
+ getLocalName(): string;
912
+ /**
913
+ * Returns the Internet Protocol (IP) address of the interface on
914
+ * which the request was received.
915
+ *
916
+ * @return a String containing the
917
+ * IP address on which the request was received.
918
+ *
919
+ * @since Servlet 2.4
920
+ */
921
+ getLocalAddr(): string;
922
+ /**
923
+ * Returns the Internet Protocol (IP) port number of the interface
924
+ * on which the request was received.
925
+ *
926
+ * @return an integer specifying the port number
927
+ *
928
+ * @since Servlet 2.4
929
+ */
930
+ getLocalPort(): number;
931
+ /**
932
+ * Checks if this request has been put into asynchronous mode.
933
+ *
934
+ * A ServletRequest is put into asynchronous mode by calling
935
+ * {@link #startAsync} or
936
+ * {@link #startAsync(ServletRequest,ServletResponse)} on it.
937
+ *
938
+ * This method returns false if this request was
939
+ * put into asynchronous mode, but has since been dispatched using
940
+ * one of the {@link AsyncContext#dispatch} methods or released
941
+ * from asynchronous mode via a call to {@link AsyncContext#complete}.
942
+ *
943
+ * @return true if this request has been put into asynchronous mode,
944
+ * false otherwise
945
+ *
946
+ * @since Servlet 3.0
947
+ */
948
+ isAsyncStarted(): boolean;
949
+ /**
950
+ * Checks if this request supports asynchronous operation.
951
+ *
952
+ * Asynchronous operation is disabled for this request if this request
953
+ * is within the scope of a filter or servlet that has not been annotated
954
+ * or flagged in the deployment descriptor as being able to support
955
+ * asynchronous handling.
956
+ *
957
+ * @return true if this request supports asynchronous operation, false
958
+ * otherwise
959
+ *
960
+ * @since Servlet 3.0
961
+ */
962
+ isAsyncSupported(): boolean;
963
+ }
964
+ /**
965
+ *
966
+ * Extends the {@link ServletResponse} interface to provide HTTP-specific
967
+ * functionality in sending a response. For example, it has methods
968
+ * to access HTTP headers and cookies.
969
+ *
970
+ * The servlet container creates an HttpServletResponse object
971
+ * and passes it as an argument to the servlet's service methods
972
+ * (doGet, doPost, etc).
973
+ *
974
+ *
975
+ * @author Various
976
+ *
977
+ * @see javax.servlet.ServletResponse
978
+ *
979
+ */
980
+ export class HttpServletResponse {
981
+ /**
982
+ * Gets the current status code of this response.
983
+ *
984
+ * @return the current status code of this response
985
+ *
986
+ * @since Servlet 3.0
987
+ */
988
+ getStatus(): number;
989
+ /**
990
+ * Gets the value of the response header with the given name.
991
+ *
992
+ * If a response header with the given name exists and contains
993
+ * multiple values, the value that was added first will be returned.
994
+ *
995
+ * This method considers only response headers set or added via
996
+ * {@link #setHeader}, {@link #addHeader}, {@link #setDateHeader},
997
+ * {@link #addDateHeader}, {@link #setIntHeader}, or
998
+ * {@link #addIntHeader}, respectively.
999
+ *
1000
+ * @param name the name of the response header whose value to return
1001
+ *
1002
+ * @return the value of the response header with the given name,
1003
+ * or null if no header with the given name has been set
1004
+ * on this response
1005
+ *
1006
+ * @since Servlet 3.0
1007
+ */
1008
+ getHeader(name: string): string;
1009
+ /**
1010
+ * Gets the values of the response header with the given name.
1011
+ *
1012
+ * This method considers only response headers set or added via
1013
+ * {@link #setHeader}, {@link #addHeader}, {@link #setDateHeader},
1014
+ * {@link #addDateHeader}, {@link #setIntHeader}, or
1015
+ * {@link #addIntHeader}, respectively.
1016
+ *
1017
+ * Any changes to the returned Collection must not
1018
+ * affect this HttpServletResponse.
1019
+ *
1020
+ * @param name the name of the response header whose values to return
1021
+ *
1022
+ * @return a (possibly empty) Collection of the values
1023
+ * of the response header with the given name
1024
+ *
1025
+ * @since Servlet 3.0
1026
+ */
1027
+ getHeaders(name: string): Collection<string>;
1028
+ /**
1029
+ * Gets the names of the headers of this response.
1030
+ *
1031
+ * This method considers only response headers set or added via
1032
+ * {@link #setHeader}, {@link #addHeader}, {@link #setDateHeader},
1033
+ * {@link #addDateHeader}, {@link #setIntHeader}, or
1034
+ * {@link #addIntHeader}, respectively.
1035
+ *
1036
+ * Any changes to the returned Collection must not
1037
+ * affect this HttpServletResponse.
1038
+ *
1039
+ * @return a (possibly empty) Collection of the names
1040
+ * of the headers of this response
1041
+ *
1042
+ * @since Servlet 3.0
1043
+ */
1044
+ getHeaderNames(): Collection<string>;
1045
+ /**
1046
+ * Returns the name of the character encoding (MIME charset)
1047
+ * used for the body sent in this response.
1048
+ * The character encoding may have been specified explicitly
1049
+ * using the {@link #setCharacterEncoding} or
1050
+ * {@link #setContentType} methods, or implicitly using the
1051
+ * {@link #setLocale} method. Explicit specifications take
1052
+ * precedence over implicit specifications. Calls made
1053
+ * to these methods after getWriter has been
1054
+ * called or after the response has been committed have no
1055
+ * effect on the character encoding. If no character encoding
1056
+ * has been specified, ISO-8859-1 is returned.
1057
+ * See RFC 2047 (http://www.ietf.org/rfc/rfc2047.txt)
1058
+ * for more information about character encoding and MIME.
1059
+ *
1060
+ * @return a String specifying the name of
1061
+ * the character encoding, for example, UTF-8
1062
+ */
1063
+ getCharacterEncoding(): string;
1064
+ /**
1065
+ * Returns the content type used for the MIME body
1066
+ * sent in this response. The content type proper must
1067
+ * have been specified using {@link #setContentType}
1068
+ * before the response is committed. If no content type
1069
+ * has been specified, this method returns null.
1070
+ * If a content type has been specified, and a
1071
+ * character encoding has been explicitly or implicitly
1072
+ * specified as described in {@link #getCharacterEncoding}
1073
+ * or {@link #getWriter} has been called,
1074
+ * the charset parameter is included in the string returned.
1075
+ * If no character encoding has been specified, the
1076
+ * charset parameter is omitted.
1077
+ *
1078
+ * @return a String specifying the content type,
1079
+ * for example, text/html; charset=UTF-8, or null
1080
+ *
1081
+ * @since Servlet 2.4
1082
+ */
1083
+ getContentType(): string;
1084
+ /**
1085
+ * Returns a {@link ServletOutputStream} suitable for writing binary
1086
+ * data in the response. The servlet container does not encode the
1087
+ * binary data.
1088
+ *
1089
+ * Calling flush() on the ServletOutputStream commits the response.
1090
+ *
1091
+ * Either this method or {@link #getWriter} may
1092
+ * be called to write the body, not both, except when {@link #reset}
1093
+ * has been called.
1094
+ *
1095
+ * @return a {@link ServletOutputStream} for writing binary data
1096
+ *
1097
+ * @exception IllegalStateException if the getWriter method
1098
+ * has been called on this response
1099
+ *
1100
+ * @exception IOException if an input or output exception occurred
1101
+ *
1102
+ * @see #getWriter
1103
+ * @see #reset
1104
+ */
1105
+ getOutputStream(): ServletOutputStream;
1106
+ /**
1107
+ * Returns a PrintWriter object that
1108
+ * can send character text to the client.
1109
+ * The PrintWriter uses the character
1110
+ * encoding returned by {@link #getCharacterEncoding}.
1111
+ * If the response's character encoding has not been
1112
+ * specified as described in getCharacterEncoding
1113
+ * (i.e., the method just returns the default value
1114
+ * ISO-8859-1), getWriter
1115
+ * updates it to ISO-8859-1.
1116
+ * Calling flush() on the PrintWriter
1117
+ * commits the response.
1118
+ * Either this method or {@link #getOutputStream} may be called
1119
+ * to write the body, not both, except when {@link #reset}
1120
+ * has been called.
1121
+ *
1122
+ * @return a PrintWriter object that
1123
+ * can return character data to the client
1124
+ *
1125
+ * @exception java.io.UnsupportedEncodingException
1126
+ * if the character encoding returned
1127
+ * by getCharacterEncoding cannot be used
1128
+ *
1129
+ * @exception IllegalStateException
1130
+ * if the getOutputStream
1131
+ * method has already been called for this response object
1132
+ *
1133
+ * @exception IOException
1134
+ * if an input or output exception occurred
1135
+ *
1136
+ * @see #getOutputStream
1137
+ * @see #setCharacterEncoding
1138
+ * @see #reset
1139
+ */
1140
+ getWriter(): PrintWriter;
1141
+ /**
1142
+ * Returns the actual buffer size used for the response. If no buffering
1143
+ * is used, this method returns 0.
1144
+ *
1145
+ * @return the actual buffer size used
1146
+ *
1147
+ * @see #setBufferSize
1148
+ * @see #flushBuffer
1149
+ * @see #isCommitted
1150
+ * @see #reset
1151
+ */
1152
+ getBufferSize(): number;
1153
+ /**
1154
+ * Returns a boolean indicating if the response has been
1155
+ * committed. A committed response has already had its status
1156
+ * code and headers written.
1157
+ *
1158
+ * @return a boolean indicating if the response has been
1159
+ * committed
1160
+ *
1161
+ * @see #setBufferSize
1162
+ * @see #getBufferSize
1163
+ * @see #flushBuffer
1164
+ * @see #reset
1165
+ *
1166
+ */
1167
+ isCommitted(): boolean;
1168
+ /**
1169
+ * Returns the locale specified for this response
1170
+ * using the {@link #setLocale} method. Calls made to
1171
+ * setLocale after the response is committed
1172
+ * have no effect. If no locale has been specified,
1173
+ * the container's default locale is returned.
1174
+ *
1175
+ * @see #setLocale
1176
+ */
1177
+ getLocale(): Locale;
1178
+ }
1179
+ export class HttpSession {
1180
+ /**
1181
+ *
1182
+ * Returns the time when this session was created, measured
1183
+ * in milliseconds since midnight January 1, 1970 GMT.
1184
+ *
1185
+ * @return a long specifying
1186
+ * when this session was created,
1187
+ * expressed in
1188
+ * milliseconds since 1/1/1970 GMT
1189
+ *
1190
+ * @exception IllegalStateException if this method is called on an
1191
+ * invalidated session
1192
+ */
1193
+ getCreationTime(): number;
1194
+ /**
1195
+ * Returns a string containing the unique identifier assigned
1196
+ * to this session. The identifier is assigned
1197
+ * by the servlet container and is implementation dependent.
1198
+ *
1199
+ * @return a string specifying the identifier
1200
+ * assigned to this session
1201
+ */
1202
+ getId(): string;
1203
+ /**
1204
+ *
1205
+ * Returns the last time the client sent a request associated with
1206
+ * this session, as the number of milliseconds since midnight
1207
+ * January 1, 1970 GMT, and marked by the time the container received the
1208
+ * request.
1209
+ *
1210
+ * Actions that your application takes, such as getting or setting
1211
+ * a value associated with the session, do not affect the access
1212
+ * time.
1213
+ *
1214
+ * @return a long
1215
+ * representing the last time
1216
+ * the client sent a request associated
1217
+ * with this session, expressed in
1218
+ * milliseconds since 1/1/1970 GMT
1219
+ *
1220
+ * @exception IllegalStateException if this method is called on an
1221
+ * invalidated session
1222
+ */
1223
+ getLastAccessedTime(): number;
1224
+ /**
1225
+ * Specifies the time, in seconds, between client requests before the
1226
+ * servlet container will invalidate this session.
1227
+ *
1228
+ * An interval value of zero or less indicates that the
1229
+ * session should never timeout.
1230
+ *
1231
+ * @param interval An integer specifying the number
1232
+ * of seconds
1233
+ */
1234
+ setMaxInactiveInterval(interval: number): void;
1235
+ /**
1236
+ * Returns the maximum time interval, in seconds, that
1237
+ * the servlet container will keep this session open between
1238
+ * client accesses. After this interval, the servlet container
1239
+ * will invalidate the session. The maximum time interval can be set
1240
+ * with the setMaxInactiveInterval method.
1241
+ *
1242
+ * A return value of zero or less indicates that the
1243
+ * session will never timeout.
1244
+ *
1245
+ * @return an integer specifying the number of
1246
+ * seconds this session remains open
1247
+ * between client requests
1248
+ *
1249
+ * @see #setMaxInactiveInterval
1250
+ */
1251
+ getMaxInactiveInterval(): number;
1252
+ /**
1253
+ * Returns the object bound with the specified name in this session, or
1254
+ * null if no object is bound under the name.
1255
+ *
1256
+ * @param name a string specifying the name of the object
1257
+ *
1258
+ * @return the object with the specified name
1259
+ *
1260
+ * @exception IllegalStateException if this method is called on an
1261
+ * invalidated session
1262
+ */
1263
+ getAttribute(name: string): any;
1264
+ /**
1265
+ * Returns an Enumeration of String objects
1266
+ * containing the names of all the objects bound to this session.
1267
+ *
1268
+ * @return an Enumeration of
1269
+ * String objects specifying the
1270
+ * names of all the objects bound to
1271
+ * this session
1272
+ *
1273
+ * @exception IllegalStateException if this method is called on an
1274
+ * invalidated session
1275
+ */
1276
+ getAttributeNames(): Enumeration<string>;
1277
+ /**
1278
+ * Binds an object to this session, using the name specified.
1279
+ * If an object of the same name is already bound to the session,
1280
+ * the object is replaced.
1281
+ *
1282
+ * After this method executes, and if the new object
1283
+ * implements HttpSessionBindingListener,
1284
+ * the container calls
1285
+ * HttpSessionBindingListener.valueBound. The container then
1286
+ * notifies any HttpSessionAttributeListeners in the web
1287
+ * application.
1288
+ * If an object was already bound to this session of this name
1289
+ * that implements HttpSessionBindingListener, its
1290
+ * HttpSessionBindingListener.valueUnbound method is called.
1291
+ *
1292
+ * If the value passed in is null, this has the same effect as calling
1293
+ * removeAttribute().
1294
+ *
1295
+ *
1296
+ * @param name the name to which the object is bound;
1297
+ * cannot be null
1298
+ *
1299
+ * @param value the object to be bound
1300
+ *
1301
+ * @exception IllegalStateException if this method is called on an
1302
+ * invalidated session
1303
+ */
1304
+ setAttribute(name: string, value: any): void;
1305
+ /**
1306
+ * Removes the object bound with the specified name from
1307
+ * this session. If the session does not have an object
1308
+ * bound with the specified name, this method does nothing.
1309
+ *
1310
+ * After this method executes, and if the object
1311
+ * implements HttpSessionBindingListener,
1312
+ * the container calls
1313
+ * HttpSessionBindingListener.valueUnbound. The container
1314
+ * then notifies any HttpSessionAttributeListeners in the web
1315
+ * application.
1316
+ *
1317
+ * @param name the name of the object to
1318
+ * remove from this session
1319
+ *
1320
+ * @exception IllegalStateException if this method is called on an
1321
+ * invalidated session
1322
+ */
1323
+ removeAttribute(name: string): void;
1324
+ /**
1325
+ * Invalidates this session then unbinds any objects bound
1326
+ * to it.
1327
+ *
1328
+ * @exception IllegalStateException if this method is called on an
1329
+ * already invalidated session
1330
+ */
1331
+ invalidate(): void;
1332
+ /**
1333
+ * Returns true if the client does not yet know about the
1334
+ * session or if the client chooses not to join the session. For
1335
+ * example, if the server used only cookie-based sessions, and
1336
+ * the client had disabled the use of cookies, then a session would
1337
+ * be new on each request.
1338
+ *
1339
+ * @return true if the
1340
+ * server has created a session,
1341
+ * but the client has not yet joined
1342
+ *
1343
+ * @exception IllegalStateException if this method is called on an
1344
+ * already invalidated session
1345
+ */
1346
+ isNew(): boolean;
1347
+ }
1348
+ /**
1349
+ * This class represents a part or form item that was received within a
1350
+ * multipart/form-data POST request.
1351
+ *
1352
+ * @since Servlet 3.0
1353
+ */
1354
+ export class Part {
1355
+ /**
1356
+ * Gets the content type of this part.
1357
+ *
1358
+ * @return The content type of this part.
1359
+ */
1360
+ getContentType(): string;
1361
+ /**
1362
+ * Gets the name of this part
1363
+ *
1364
+ * @return The name of this part as a String
1365
+ */
1366
+ getName(): string;
1367
+ /**
1368
+ * Gets the file name specified by the client
1369
+ *
1370
+ * @return the submitted file name
1371
+ *
1372
+ * @since Servlet 3.1
1373
+ */
1374
+ getSubmittedFileName(): string;
1375
+ /**
1376
+ * Returns the size of this fille.
1377
+ *
1378
+ * @return a long specifying the size of this part, in bytes.
1379
+ */
1380
+ getSize(): number;
1381
+ /**
1382
+ *
1383
+ * Returns the value of the specified mime header
1384
+ * as a String. If the Part did not include a header
1385
+ * of the specified name, this method returns null.
1386
+ * If there are multiple headers with the same name, this method
1387
+ * returns the first header in the part.
1388
+ * The header name is case insensitive. You can use
1389
+ * this method with any request header.
1390
+ *
1391
+ * @param name a String specifying the
1392
+ * header name
1393
+ *
1394
+ * @return a String containing the
1395
+ * value of the requested
1396
+ * header, or null
1397
+ * if the part does not
1398
+ * have a header of that name
1399
+ */
1400
+ getHeader(name: string): string;
1401
+ /**
1402
+ * Gets the values of the Part header with the given name.
1403
+ *
1404
+ * Any changes to the returned Collection must not
1405
+ * affect this Part.
1406
+ *
1407
+ * Part header names are case insensitive.
1408
+ *
1409
+ * @param name the header name whose values to return
1410
+ *
1411
+ * @return a (possibly empty) Collection of the values of
1412
+ * the header with the given name
1413
+ */
1414
+ getHeaders(name: string): Collection<string>;
1415
+ /**
1416
+ * Gets the header names of this Part.
1417
+ *
1418
+ * Some servlet containers do not allow
1419
+ * servlets to access headers using this method, in
1420
+ * which case this method returns null
1421
+ *
1422
+ * Any changes to the returned Collection must not
1423
+ * affect this Part.
1424
+ *
1425
+ * @return a (possibly empty) Collection of the header
1426
+ * names of this Part
1427
+ */
1428
+ getHeaderNames(): Collection<string>;
1429
+ }
1430
+
1431
+ }