-
Notifications
You must be signed in to change notification settings - Fork 1
/
Session.html
967 lines (967 loc) · 42.9 KB
/
Session.html
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
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
<!DOCTYPE HTML>
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (11.0.2) on Sat Oct 21 15:44:48 UTC 2023 -->
<title>Session (Tyrus 2.0.5 API)</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="dc.created" content="2023-10-21">
<link rel="stylesheet" type="text/css" href="../../stylesheet.css" title="Style">
<link rel="stylesheet" type="text/css" href="../../jquery/jquery-ui.css" title="Style">
<script type="text/javascript" src="../../script.js"></script>
<script type="text/javascript" src="../../jquery/jszip/dist/jszip.min.js"></script>
<script type="text/javascript" src="../../jquery/jszip-utils/dist/jszip-utils.min.js"></script>
<!--[if IE]>
<script type="text/javascript" src="../../jquery/jszip-utils/dist/jszip-utils-ie.min.js"></script>
<![endif]-->
<script type="text/javascript" src="../../jquery/jquery-3.3.1.js"></script>
<script type="text/javascript" src="../../jquery/jquery-migrate-3.0.1.js"></script>
<script type="text/javascript" src="../../jquery/jquery-ui.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="Session (Tyrus 2.0.5 API)";
}
}
catch(err) {
}
//-->
var data = {"i0":6,"i1":6,"i2":6,"i3":6,"i4":6,"i5":6,"i6":6,"i7":6,"i8":6,"i9":6,"i10":6,"i11":6,"i12":6,"i13":6,"i14":6,"i15":6,"i16":6,"i17":6,"i18":6,"i19":6,"i20":6,"i21":6,"i22":6,"i23":6,"i24":6,"i25":6,"i26":6,"i27":6,"i28":6};
var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],4:["t3","Abstract Methods"]};
var altColor = "altColor";
var rowColor = "rowColor";
var tableTab = "tableTab";
var activeTableTab = "activeTableTab";
var pathtoroot = "../../";
var useModuleDirectories = true;
loadScripts(document, 'script');</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<header role="banner">
<nav role="navigation">
<div class="fixedNav">
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a id="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a id="navbar.top.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../index.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/Session.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../index-all.html">Index</a></li>
<li><a href="../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../allclasses.html">All Classes</a></li>
</ul>
<ul class="navListSearch">
<li><label for="search">SEARCH:</label>
<input type="text" id="search" value="search" disabled="disabled">
<input type="reset" id="reset" value="reset" disabled="disabled">
</li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
</div>
<div>
<ul class="subNavList">
<li>Summary: </li>
<li>Nested | </li>
<li>Field | </li>
<li>Constr | </li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail: </li>
<li>Field | </li>
<li>Constr | </li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a id="skip.navbar.top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
</div>
<div class="navPadding"> </div>
<script type="text/javascript"><!--
$('.navPadding').css('padding-top', $('.fixedNav').css("height"));
//-->
</script>
</nav>
</header>
<!-- ======== START OF CLASS DATA ======== -->
<main role="main">
<div class="header">
<div class="subTitle"><span class="packageLabelInType">Package</span> <a href="package-summary.html">jakarta.websocket</a></div>
<h2 title="Interface Session" class="title">Interface Session</h2>
</div>
<div class="contentContainer">
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt>All Superinterfaces:</dt>
<dd><code>java.lang.AutoCloseable</code>, <code>java.io.Closeable</code></dd>
</dl>
<dl>
<dt>All Known Subinterfaces:</dt>
<dd><code><a href="../../org/glassfish/tyrus/core/cluster/DistributedSession.html" title="interface in org.glassfish.tyrus.core.cluster">DistributedSession</a></code></dd>
</dl>
<dl>
<dt>All Known Implementing Classes:</dt>
<dd><code><a href="../../org/glassfish/tyrus/core/cluster/RemoteSession.html" title="class in org.glassfish.tyrus.core.cluster">RemoteSession</a></code>, <code><a href="../../org/glassfish/tyrus/core/TyrusSession.html" title="class in org.glassfish.tyrus.core">TyrusSession</a></code></dd>
</dl>
<hr>
<pre>public interface <span class="typeNameLabel">Session</span>
extends java.io.Closeable</pre>
<div class="block">A Web Socket session represents a conversation between two web socket endpoints. As soon as the websocket handshake
completes successfully, the web socket implementation provides the endpoint an open websocket session. The endpoint
can then register interest in incoming messages that are part of this newly created session by providing a
MessageHandler to the session, and can send messages to the other end of the conversation by means of the
RemoteEndpoint object obtained from this session.
<p>
Once the session is closed, it is no longer valid for use by applications. Calling any of its methods (with the
exception of the close() methods) once the session has been closed will result in an
<code>IllegalStateException</code> being thrown. Developers should retrieve any information from the session
during the <a href="Endpoint.html#onClose(jakarta.websocket.Session,jakarta.websocket.CloseReason)"><code>Endpoint.onClose(jakarta.websocket.Session, jakarta.websocket.CloseReason)</code></a> method. Following the convention of <code>Closeable</code> calling the Session
close() methods after the Session has been closed has no effect.
<p>
Session objects may be called by multiple threads. Implementations must ensure the integrity of the mutable
properties of the session under such circumstances.</div>
<dl>
<dt><span class="simpleTagLabel">Author:</span></dt>
<dd>dannycoward</dd>
</dl>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- ========== METHOD SUMMARY =========== -->
<section role="region">
<ul class="blockList">
<li class="blockList"><a id="method.summary">
<!-- -->
</a>
<h3>Method Summary</h3>
<table class="memberSummary">
<caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd"> </span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd"> </span></span><span id="t3" class="tableTab"><span><a href="javascript:show(4);">Abstract Methods</a></span><span class="tabEnd"> </span></span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colSecond" scope="col">Method</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tr id="i0" class="altColor">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#addMessageHandler(jakarta.websocket.MessageHandler)">addMessageHandler</a></span>​(<a href="MessageHandler.html" title="interface in jakarta.websocket">MessageHandler</a> handler)</code></th>
<td class="colLast">
<div class="block">Register to handle to incoming messages in this conversation.</div>
</td>
</tr>
<tr id="i1" class="rowColor">
<td class="colFirst"><code><T> void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#addMessageHandler(java.lang.Class,jakarta.websocket.MessageHandler.Partial)">addMessageHandler</a></span>​(java.lang.Class<T> clazz,
<a href="MessageHandler.Partial.html" title="interface in jakarta.websocket">MessageHandler.Partial</a><T> handler)</code></th>
<td class="colLast">
<div class="block">Register to handle to incoming messages in this conversation.</div>
</td>
</tr>
<tr id="i2" class="altColor">
<td class="colFirst"><code><T> void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#addMessageHandler(java.lang.Class,jakarta.websocket.MessageHandler.Whole)">addMessageHandler</a></span>​(java.lang.Class<T> clazz,
<a href="MessageHandler.Whole.html" title="interface in jakarta.websocket">MessageHandler.Whole</a><T> handler)</code></th>
<td class="colLast">
<div class="block">Register to handle to incoming messages in this conversation.</div>
</td>
</tr>
<tr id="i3" class="rowColor">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#close()">close</a></span>()</code></th>
<td class="colLast">
<div class="block">Close the current conversation with a normal status code and no reason phrase.</div>
</td>
</tr>
<tr id="i4" class="altColor">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#close(jakarta.websocket.CloseReason)">close</a></span>​(<a href="CloseReason.html" title="class in jakarta.websocket">CloseReason</a> closeReason)</code></th>
<td class="colLast">
<div class="block">Close the current conversation, giving a reason for the closure.</div>
</td>
</tr>
<tr id="i5" class="rowColor">
<td class="colFirst"><code><a href="RemoteEndpoint.Async.html" title="interface in jakarta.websocket">RemoteEndpoint.Async</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getAsyncRemote()">getAsyncRemote</a></span>()</code></th>
<td class="colLast">
<div class="block">Return a reference a RemoteEndpoint object representing the peer of this conversation that is able to send
messages asynchronously to the peer.</div>
</td>
</tr>
<tr id="i6" class="altColor">
<td class="colFirst"><code><a href="RemoteEndpoint.Basic.html" title="interface in jakarta.websocket">RemoteEndpoint.Basic</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getBasicRemote()">getBasicRemote</a></span>()</code></th>
<td class="colLast">
<div class="block">Return a reference a RemoteEndpoint object representing the peer of this conversation that is able to send
messages synchronously to the peer.</div>
</td>
</tr>
<tr id="i7" class="rowColor">
<td class="colFirst"><code><a href="WebSocketContainer.html" title="interface in jakarta.websocket">WebSocketContainer</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getContainer()">getContainer</a></span>()</code></th>
<td class="colLast">
<div class="block">Return the container that this session is part of.</div>
</td>
</tr>
<tr id="i8" class="altColor">
<td class="colFirst"><code>java.lang.String</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getId()">getId</a></span>()</code></th>
<td class="colLast">
<div class="block">Returns a string containing the unique identifier assigned to this session.</div>
</td>
</tr>
<tr id="i9" class="rowColor">
<td class="colFirst"><code>int</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getMaxBinaryMessageBufferSize()">getMaxBinaryMessageBufferSize</a></span>()</code></th>
<td class="colLast">
<div class="block">The maximum length of incoming binary messages that this Session can buffer.</div>
</td>
</tr>
<tr id="i10" class="altColor">
<td class="colFirst"><code>long</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getMaxIdleTimeout()">getMaxIdleTimeout</a></span>()</code></th>
<td class="colLast">
<div class="block">Return the number of milliseconds before this conversation may be closed by the container if it is inactive, i.e.</div>
</td>
</tr>
<tr id="i11" class="rowColor">
<td class="colFirst"><code>int</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getMaxTextMessageBufferSize()">getMaxTextMessageBufferSize</a></span>()</code></th>
<td class="colLast">
<div class="block">The maximum length of incoming text messages that this Session can buffer.</div>
</td>
</tr>
<tr id="i12" class="altColor">
<td class="colFirst"><code>java.util.Set<<a href="MessageHandler.html" title="interface in jakarta.websocket">MessageHandler</a>></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getMessageHandlers()">getMessageHandlers</a></span>()</code></th>
<td class="colLast">
<div class="block">Return an unmodifiable copy of the set of MessageHandlers for this Session.</div>
</td>
</tr>
<tr id="i13" class="rowColor">
<td class="colFirst"><code>java.util.List<<a href="Extension.html" title="interface in jakarta.websocket">Extension</a>></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getNegotiatedExtensions()">getNegotiatedExtensions</a></span>()</code></th>
<td class="colLast">
<div class="block">Return the list of extensions currently in use for this conversation.</div>
</td>
</tr>
<tr id="i14" class="altColor">
<td class="colFirst"><code>java.lang.String</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getNegotiatedSubprotocol()">getNegotiatedSubprotocol</a></span>()</code></th>
<td class="colLast">
<div class="block">Return the sub protocol agreed during the websocket handshake for this conversation.</div>
</td>
</tr>
<tr id="i15" class="rowColor">
<td class="colFirst"><code>java.util.Set<<a href="Session.html" title="interface in jakarta.websocket">Session</a>></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getOpenSessions()">getOpenSessions</a></span>()</code></th>
<td class="colLast">
<div class="block">Return a copy of the Set of all the open web socket sessions that represent connections to the same endpoint to
which this session represents a connection.</div>
</td>
</tr>
<tr id="i16" class="altColor">
<td class="colFirst"><code>java.util.Map<java.lang.String,​java.lang.String></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getPathParameters()">getPathParameters</a></span>()</code></th>
<td class="colLast">
<div class="block">Return a map of the path parameter names and values used associated with the request this session was opened
under.</div>
</td>
</tr>
<tr id="i17" class="rowColor">
<td class="colFirst"><code>java.lang.String</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getProtocolVersion()">getProtocolVersion</a></span>()</code></th>
<td class="colLast">
<div class="block">Returns the version of the websocket protocol currently being used.</div>
</td>
</tr>
<tr id="i18" class="altColor">
<td class="colFirst"><code>java.lang.String</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getQueryString()">getQueryString</a></span>()</code></th>
<td class="colLast">
<div class="block">Return the query string associated with the request this session was opened under.</div>
</td>
</tr>
<tr id="i19" class="rowColor">
<td class="colFirst"><code>java.util.Map<java.lang.String,​java.util.List<java.lang.String>></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getRequestParameterMap()">getRequestParameterMap</a></span>()</code></th>
<td class="colLast">
<div class="block">Return the request parameters associated with the request this session was opened under.</div>
</td>
</tr>
<tr id="i20" class="altColor">
<td class="colFirst"><code>java.net.URI</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getRequestURI()">getRequestURI</a></span>()</code></th>
<td class="colLast">
<div class="block">Return the URI under which this session was opened, including the query string if there is one.</div>
</td>
</tr>
<tr id="i21" class="rowColor">
<td class="colFirst"><code>java.security.Principal</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getUserPrincipal()">getUserPrincipal</a></span>()</code></th>
<td class="colLast">
<div class="block">Return the authenticated user for this Session or <code>null</code> if no user is authenticated for this session.</div>
</td>
</tr>
<tr id="i22" class="altColor">
<td class="colFirst"><code>java.util.Map<java.lang.String,​java.lang.Object></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getUserProperties()">getUserProperties</a></span>()</code></th>
<td class="colLast">
<div class="block">While the session is open, this method returns a Map that the developer may use to store application specific
information relating to this session instance.</div>
</td>
</tr>
<tr id="i23" class="rowColor">
<td class="colFirst"><code>boolean</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#isOpen()">isOpen</a></span>()</code></th>
<td class="colLast">
<div class="block">Return true if and only if the underlying socket is open.</div>
</td>
</tr>
<tr id="i24" class="altColor">
<td class="colFirst"><code>boolean</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#isSecure()">isSecure</a></span>()</code></th>
<td class="colLast">
<div class="block">Return true if and only if the underlying socket is using a secure transport.</div>
</td>
</tr>
<tr id="i25" class="rowColor">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#removeMessageHandler(jakarta.websocket.MessageHandler)">removeMessageHandler</a></span>​(<a href="MessageHandler.html" title="interface in jakarta.websocket">MessageHandler</a> handler)</code></th>
<td class="colLast">
<div class="block">Remove the given MessageHandler from the set belonging to this session.</div>
</td>
</tr>
<tr id="i26" class="altColor">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#setMaxBinaryMessageBufferSize(int)">setMaxBinaryMessageBufferSize</a></span>​(int length)</code></th>
<td class="colLast">
<div class="block">Sets the maximum length of incoming binary messages that this Session can buffer.</div>
</td>
</tr>
<tr id="i27" class="rowColor">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#setMaxIdleTimeout(long)">setMaxIdleTimeout</a></span>​(long milliseconds)</code></th>
<td class="colLast">
<div class="block">Set the non-zero number of milliseconds before this session will be closed by the container if it is inactive, ie
no messages are either sent or received.</div>
</td>
</tr>
<tr id="i28" class="altColor">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#setMaxTextMessageBufferSize(int)">setMaxTextMessageBufferSize</a></span>​(int length)</code></th>
<td class="colLast">
<div class="block">Sets the maximum length of incoming text messages that this Session can buffer.</div>
</td>
</tr>
</table>
</li>
</ul>
</section>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ============ METHOD DETAIL ========== -->
<section role="region">
<ul class="blockList">
<li class="blockList"><a id="method.detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a id="getContainer()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getContainer</h4>
<pre class="methodSignature"><a href="WebSocketContainer.html" title="interface in jakarta.websocket">WebSocketContainer</a> getContainer()</pre>
<div class="block">Return the container that this session is part of.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the container.</dd>
</dl>
</li>
</ul>
<a id="addMessageHandler(jakarta.websocket.MessageHandler)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>addMessageHandler</h4>
<pre class="methodSignature">void addMessageHandler​(<a href="MessageHandler.html" title="interface in jakarta.websocket">MessageHandler</a> handler)
throws java.lang.IllegalStateException</pre>
<div class="block">Register to handle to incoming messages in this conversation. A maximum of one message handler per native
websocket message type (text, binary, pong) may be added to each Session. I.e. a maximum of one message handler
to handle incoming text messages a maximum of one message handler for handling incoming binary messages, and a
maximum of one for handling incoming pong messages. For further details of which message handlers handle which of
the native websocket message types please see <a href="MessageHandler.Whole.html" title="interface in jakarta.websocket"><code>MessageHandler.Whole</code></a> and <a href="MessageHandler.Partial.html" title="interface in jakarta.websocket"><code>MessageHandler.Partial</code></a>.
Adding more than one of any one type will result in a runtime exception.
<p>
This method is not safe to use unless you are providing an anonymous class derived directly from
<a href="MessageHandler.Whole.html" title="interface in jakarta.websocket"><code>MessageHandler.Whole</code></a> or <a href="MessageHandler.Partial.html" title="interface in jakarta.websocket"><code>MessageHandler.Partial</code></a>. In all other
cases (Lambda Expressions, more complex inheritance or generic type arrangements), one of the following methods
have to be used: <a href="#addMessageHandler(java.lang.Class,jakarta.websocket.MessageHandler.Whole)"><code>addMessageHandler(Class, jakarta.websocket.MessageHandler.Whole)</code></a> or
<a href="#addMessageHandler(java.lang.Class,jakarta.websocket.MessageHandler.Partial)"><code>addMessageHandler(Class, jakarta.websocket.MessageHandler.Partial)</code></a>.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>handler</code> - the MessageHandler to be added.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>java.lang.IllegalStateException</code> - if there is already a MessageHandler registered for the same native websocket
message type as this handler.</dd>
</dl>
</li>
</ul>
<a id="addMessageHandler(java.lang.Class,jakarta.websocket.MessageHandler.Whole)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>addMessageHandler</h4>
<pre class="methodSignature"><T> void addMessageHandler​(java.lang.Class<T> clazz,
<a href="MessageHandler.Whole.html" title="interface in jakarta.websocket">MessageHandler.Whole</a><T> handler)</pre>
<div class="block">Register to handle to incoming messages in this conversation. A maximum of one message handler per native
websocket message type (text, binary, pong) may be added to each Session. I.e. a maximum of one message handler
to handle incoming text messages a maximum of one message handler for handling incoming binary messages, and a
maximum of one for handling incoming pong messages. For further details of which message handlers handle which of
the native websocket message types please see <a href="MessageHandler.Whole.html" title="interface in jakarta.websocket"><code>MessageHandler.Whole</code></a> and <a href="MessageHandler.Partial.html" title="interface in jakarta.websocket"><code>MessageHandler.Partial</code></a>.
Adding more than one of any one type will result in a runtime exception.</div>
<dl>
<dt><span class="paramLabel">Type Parameters:</span></dt>
<dd><code>T</code> - type of message that the given handler is intended for.</dd>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>clazz</code> - type of the message processed by message handler to be registered.</dd>
<dd><code>handler</code> - whole message handler to be added.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>java.lang.IllegalStateException</code> - if there is already a MessageHandler registered for the same native websocket
message type as this handler.</dd>
<dt><span class="simpleTagLabel">Since:</span></dt>
<dd>WebSocket 1.1</dd>
</dl>
</li>
</ul>
<a id="addMessageHandler(java.lang.Class,jakarta.websocket.MessageHandler.Partial)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>addMessageHandler</h4>
<pre class="methodSignature"><T> void addMessageHandler​(java.lang.Class<T> clazz,
<a href="MessageHandler.Partial.html" title="interface in jakarta.websocket">MessageHandler.Partial</a><T> handler)</pre>
<div class="block">Register to handle to incoming messages in this conversation. A maximum of one message handler per native
websocket message type (text, binary, pong) may be added to each Session. I.e. a maximum of one message handler
to handle incoming text messages a maximum of one message handler for handling incoming binary messages, and a
maximum of one for handling incoming pong messages. For further details of which message handlers handle which of
the native websocket message types please see <a href="MessageHandler.Whole.html" title="interface in jakarta.websocket"><code>MessageHandler.Whole</code></a> and <a href="MessageHandler.Partial.html" title="interface in jakarta.websocket"><code>MessageHandler.Partial</code></a>.
Adding more than one of any one type will result in a runtime exception.</div>
<dl>
<dt><span class="paramLabel">Type Parameters:</span></dt>
<dd><code>T</code> - type of message that the given handler is intended for.</dd>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>clazz</code> - type of the message processed by message handler to be registered.</dd>
<dd><code>handler</code> - partial message handler to be added.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>java.lang.IllegalStateException</code> - if there is already a MessageHandler registered for the same native websocket
message type as this handler.</dd>
<dt><span class="simpleTagLabel">Since:</span></dt>
<dd>WebSocket 1.1</dd>
</dl>
</li>
</ul>
<a id="getMessageHandlers()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getMessageHandlers</h4>
<pre class="methodSignature">java.util.Set<<a href="MessageHandler.html" title="interface in jakarta.websocket">MessageHandler</a>> getMessageHandlers()</pre>
<div class="block">Return an unmodifiable copy of the set of MessageHandlers for this Session.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the set of message handlers.</dd>
</dl>
</li>
</ul>
<a id="removeMessageHandler(jakarta.websocket.MessageHandler)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>removeMessageHandler</h4>
<pre class="methodSignature">void removeMessageHandler​(<a href="MessageHandler.html" title="interface in jakarta.websocket">MessageHandler</a> handler)</pre>
<div class="block">Remove the given MessageHandler from the set belonging to this session. This method may block if the given
handler is processing a message until it is no longer in use.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>handler</code> - the handler to be removed.</dd>
</dl>
</li>
</ul>
<a id="getProtocolVersion()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getProtocolVersion</h4>
<pre class="methodSignature">java.lang.String getProtocolVersion()</pre>
<div class="block">Returns the version of the websocket protocol currently being used. This is taken as the value of the
Sec-WebSocket-Version header used in the opening handshake. i.e. "13".</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the protocol version.</dd>
</dl>
</li>
</ul>
<a id="getNegotiatedSubprotocol()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getNegotiatedSubprotocol</h4>
<pre class="methodSignature">java.lang.String getNegotiatedSubprotocol()</pre>
<div class="block">Return the sub protocol agreed during the websocket handshake for this conversation.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the negotiated subprotocol, or the empty string if there isn't one.</dd>
</dl>
</li>
</ul>
<a id="getNegotiatedExtensions()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getNegotiatedExtensions</h4>
<pre class="methodSignature">java.util.List<<a href="Extension.html" title="interface in jakarta.websocket">Extension</a>> getNegotiatedExtensions()</pre>
<div class="block">Return the list of extensions currently in use for this conversation.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the negotiated extensions.</dd>
</dl>
</li>
</ul>
<a id="isSecure()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>isSecure</h4>
<pre class="methodSignature">boolean isSecure()</pre>
<div class="block">Return true if and only if the underlying socket is using a secure transport.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>whether its using a secure transport.</dd>
</dl>
</li>
</ul>
<a id="isOpen()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>isOpen</h4>
<pre class="methodSignature">boolean isOpen()</pre>
<div class="block">Return true if and only if the underlying socket is open.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>whether the session is active.</dd>
</dl>
</li>
</ul>
<a id="getMaxIdleTimeout()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getMaxIdleTimeout</h4>
<pre class="methodSignature">long getMaxIdleTimeout()</pre>
<div class="block">Return the number of milliseconds before this conversation may be closed by the container if it is inactive, i.e.
no messages are either sent or received in that time.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the timeout in milliseconds.</dd>
</dl>
</li>
</ul>
<a id="setMaxIdleTimeout(long)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setMaxIdleTimeout</h4>
<pre class="methodSignature">void setMaxIdleTimeout​(long milliseconds)</pre>
<div class="block">Set the non-zero number of milliseconds before this session will be closed by the container if it is inactive, ie
no messages are either sent or received. A value that is 0 or negative indicates the session will never timeout
due to inactivity.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>milliseconds</code> - the number of milliseconds.</dd>
</dl>
</li>
</ul>
<a id="setMaxBinaryMessageBufferSize(int)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setMaxBinaryMessageBufferSize</h4>
<pre class="methodSignature">void setMaxBinaryMessageBufferSize​(int length)</pre>
<div class="block">Sets the maximum length of incoming binary messages that this Session can buffer.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>length</code> - the maximum length.</dd>
</dl>
</li>
</ul>
<a id="getMaxBinaryMessageBufferSize()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getMaxBinaryMessageBufferSize</h4>
<pre class="methodSignature">int getMaxBinaryMessageBufferSize()</pre>
<div class="block">The maximum length of incoming binary messages that this Session can buffer. If the implementation receives a
binary message that it cannot buffer because it is too large, it must close the session with a close code of
<a href="CloseReason.CloseCodes.html#TOO_BIG"><code>CloseReason.CloseCodes.TOO_BIG</code></a>.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the maximum binary message size that can be buffered.</dd>
</dl>
</li>
</ul>
<a id="setMaxTextMessageBufferSize(int)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setMaxTextMessageBufferSize</h4>
<pre class="methodSignature">void setMaxTextMessageBufferSize​(int length)</pre>
<div class="block">Sets the maximum length of incoming text messages that this Session can buffer.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>length</code> - the maximum length.</dd>
</dl>
</li>
</ul>
<a id="getMaxTextMessageBufferSize()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getMaxTextMessageBufferSize</h4>
<pre class="methodSignature">int getMaxTextMessageBufferSize()</pre>
<div class="block">The maximum length of incoming text messages that this Session can buffer. If the implementation receives a text
message that it cannot buffer because it is too large, it must close the session with a close code of
<a href="CloseReason.CloseCodes.html#TOO_BIG"><code>CloseReason.CloseCodes.TOO_BIG</code></a>.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the maximum text message size that can be buffered.</dd>
</dl>
</li>
</ul>
<a id="getAsyncRemote()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getAsyncRemote</h4>
<pre class="methodSignature"><a href="RemoteEndpoint.Async.html" title="interface in jakarta.websocket">RemoteEndpoint.Async</a> getAsyncRemote()</pre>
<div class="block">Return a reference a RemoteEndpoint object representing the peer of this conversation that is able to send
messages asynchronously to the peer.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the remote endpoint.</dd>
</dl>
</li>
</ul>
<a id="getBasicRemote()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getBasicRemote</h4>
<pre class="methodSignature"><a href="RemoteEndpoint.Basic.html" title="interface in jakarta.websocket">RemoteEndpoint.Basic</a> getBasicRemote()</pre>
<div class="block">Return a reference a RemoteEndpoint object representing the peer of this conversation that is able to send
messages synchronously to the peer.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the remote endpoint.</dd>
</dl>
</li>
</ul>
<a id="getId()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getId</h4>
<pre class="methodSignature">java.lang.String getId()</pre>
<div class="block">Returns a string containing the unique identifier assigned to this session. The identifier is assigned by the web
socket implementation and is implementation dependent.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the unique identifier for this session instance.</dd>
</dl>
</li>
</ul>
<a id="close()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>close</h4>
<pre class="methodSignature">void close()
throws java.io.IOException</pre>
<div class="block">Close the current conversation with a normal status code and no reason phrase.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code>close</code> in interface <code>java.lang.AutoCloseable</code></dd>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code>close</code> in interface <code>java.io.Closeable</code></dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>java.io.IOException</code> - if there was a connection error closing the connection.</dd>
</dl>
</li>
</ul>
<a id="close(jakarta.websocket.CloseReason)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>close</h4>
<pre class="methodSignature">void close​(<a href="CloseReason.html" title="class in jakarta.websocket">CloseReason</a> closeReason)
throws java.io.IOException</pre>
<div class="block">Close the current conversation, giving a reason for the closure. The close call causes the implementation to
attempt notify the client of the close as soon as it can. This may cause the sending of unsent messages
immediately prior to the close notification. After the close notification has been sent the implementation
notifies the endpoint's onClose method. Note the websocket specification defines the acceptable uses of status
codes and reason phrases. If the application cannot determine a suitable close code to use for the closeReason,
it is recommended to use <a href="CloseReason.CloseCodes.html#NO_STATUS_CODE"><code>CloseReason.CloseCodes.NO_STATUS_CODE</code></a>.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>closeReason</code> - the reason for the closure.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>java.io.IOException</code> - if there was a connection error closing the connection</dd>
</dl>
</li>
</ul>
<a id="getRequestURI()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getRequestURI</h4>
<pre class="methodSignature">java.net.URI getRequestURI()</pre>
<div class="block">Return the URI under which this session was opened, including the query string if there is one.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the request URI.</dd>
</dl>
</li>
</ul>
<a id="getRequestParameterMap()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getRequestParameterMap</h4>
<pre class="methodSignature">java.util.Map<java.lang.String,​java.util.List<java.lang.String>> getRequestParameterMap()</pre>
<div class="block">Return the request parameters associated with the request this session was opened under. The request parameters
will have been part of the HTTP upgrade request which is limited by RFC 6455 to only use the HTTP GET method.
Therefore, the parameters in the returned Map will be a representation of the parameters contained in the query
string.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the unmodifiable map of the request parameters.</dd>
</dl>
</li>
</ul>
<a id="getQueryString()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getQueryString</h4>
<pre class="methodSignature">java.lang.String getQueryString()</pre>
<div class="block">Return the query string associated with the request this session was opened under.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the query string</dd>
</dl>
</li>
</ul>
<a id="getPathParameters()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getPathParameters</h4>
<pre class="methodSignature">java.util.Map<java.lang.String,​java.lang.String> getPathParameters()</pre>
<div class="block">Return a map of the path parameter names and values used associated with the request this session was opened
under.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the unmodifiable map of path parameters. The key of the map is the parameter name, the values in the map
are the parameter values.</dd>
</dl>
</li>
</ul>
<a id="getUserProperties()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getUserProperties</h4>
<pre class="methodSignature">java.util.Map<java.lang.String,​java.lang.Object> getUserProperties()</pre>
<div class="block">While the session is open, this method returns a Map that the developer may use to store application specific
information relating to this session instance. The developer may retrieve information from this Map at any time
between the opening of the session and during the onClose() method. But outside that time, any information stored
using this Map may no longer be kept by the container. Web socket applications running on distributed
implementations of the web container should make any application specific objects stored here
java.io.Serializable, or the object may not be recreated after a failover.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>an editable Map of application data.</dd>
</dl>
</li>
</ul>
<a id="getUserPrincipal()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getUserPrincipal</h4>
<pre class="methodSignature">java.security.Principal getUserPrincipal()</pre>
<div class="block">Return the authenticated user for this Session or <code>null</code> if no user is authenticated for this session.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the user principal.</dd>
</dl>
</li>
</ul>
<a id="getOpenSessions()">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>getOpenSessions</h4>
<pre class="methodSignature">java.util.Set<<a href="Session.html" title="interface in jakarta.websocket">Session</a>> getOpenSessions()</pre>
<div class="block">Return a copy of the Set of all the open web socket sessions that represent connections to the same endpoint to
which this session represents a connection. The Set includes the session this method is called on. These sessions
may not still be open at any point after the return of this method. For example, iterating over the set at a
later time may yield one or more closed sessions. Developers should use session.isOpen() to check.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the set of sessions, open at the time of return.</dd>
</dl>
</li>
</ul>
</li>
</ul>
</section>
</li>
</ul>
</div>
</div>
</main>
<!-- ========= END OF CLASS DATA ========= -->
<footer role="contentinfo">
<nav role="navigation">
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a id="navbar.bottom">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a id="navbar.bottom.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../index.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/Session.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../index-all.html">Index</a></li>
<li><a href="../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../allclasses.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
</div>
<div>
<ul class="subNavList">
<li>Summary: </li>
<li>Nested | </li>
<li>Field | </li>
<li>Constr | </li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail: </li>
<li>Field | </li>
<li>Constr | </li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a id="skip.navbar.bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
</nav>
<p class="legalCopy"><small>Copyright © 2012–2020 <a href="http://www.oracle.com/">Oracle Corporation</a>. All rights reserved.</small></p>
</footer>
</body>
</html>