iris-pex-embedded-python 2.3.25b2__py3-none-any.whl → 3.2.1b2__py3-none-any.whl

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.

Potentially problematic release.


This version of iris-pex-embedded-python might be problematic. Click here for more details.

Files changed (85) hide show
  1. grongier/cls/Grongier/PEX/BusinessOperation.cls +1 -28
  2. grongier/cls/Grongier/PEX/BusinessProcess.cls +1 -101
  3. grongier/cls/Grongier/PEX/BusinessService.cls +1 -28
  4. grongier/cls/Grongier/PEX/Common.cls +1 -194
  5. grongier/cls/Grongier/PEX/Director.cls +1 -48
  6. grongier/cls/Grongier/PEX/Duplex/Operation.cls +1 -26
  7. grongier/cls/Grongier/PEX/Duplex/Process.cls +1 -217
  8. grongier/cls/Grongier/PEX/Duplex/Service.cls +1 -6
  9. grongier/cls/Grongier/PEX/InboundAdapter.cls +1 -15
  10. grongier/cls/Grongier/PEX/Message.cls +1 -116
  11. grongier/cls/Grongier/PEX/OutboundAdapter.cls +1 -29
  12. grongier/cls/Grongier/PEX/PickleMessage.cls +1 -46
  13. grongier/cls/Grongier/PEX/PrivateSession/Duplex.cls +1 -253
  14. grongier/cls/Grongier/PEX/PrivateSession/Message/Ack.cls +1 -19
  15. grongier/cls/Grongier/PEX/PrivateSession/Message/Poll.cls +1 -19
  16. grongier/cls/Grongier/PEX/PrivateSession/Message/Start.cls +1 -19
  17. grongier/cls/Grongier/PEX/PrivateSession/Message/Stop.cls +1 -35
  18. grongier/cls/Grongier/PEX/Test.cls +1 -53
  19. grongier/cls/Grongier/PEX/Utils.cls +1 -365
  20. grongier/cls/Grongier/Service/WSGI.cls +1 -307
  21. grongier/pex/__init__.py +11 -11
  22. grongier/pex/__main__.py +1 -1
  23. grongier/pex/_business_host.py +1 -481
  24. grongier/pex/_cli.py +2 -150
  25. grongier/pex/_common.py +1 -347
  26. grongier/pex/_director.py +1 -286
  27. grongier/pex/_utils.py +1 -369
  28. intersystems_iris/_ConnectionInformation.py +22 -20
  29. intersystems_iris/dbapi/_DBAPI.py +6 -1
  30. intersystems_iris/dbapi/_ResultSetRow.py +26 -15
  31. intersystems_iris/dbapi/preparser/_PreParser.py +4 -1
  32. iop/__init__.py +24 -0
  33. iop/__main__.py +4 -0
  34. iop/_business_host.py +675 -0
  35. iop/_business_operation.py +71 -0
  36. iop/_business_process.py +220 -0
  37. {grongier/pex → iop}/_business_service.py +2 -2
  38. iop/_cli.py +141 -0
  39. iop/_common.py +352 -0
  40. iop/_director.py +301 -0
  41. {grongier/pex → iop}/_inbound_adapter.py +1 -1
  42. iop/_log_manager.py +81 -0
  43. {grongier/pex → iop}/_message.py +1 -1
  44. {grongier/pex → iop}/_outbound_adapter.py +1 -1
  45. {grongier/pex → iop}/_private_session_duplex.py +4 -3
  46. {grongier/pex → iop}/_private_session_process.py +2 -2
  47. iop/_utils.py +458 -0
  48. iop/cls/IOP/BusinessOperation.cls +35 -0
  49. iop/cls/IOP/BusinessProcess.cls +124 -0
  50. iop/cls/IOP/BusinessService.cls +35 -0
  51. iop/cls/IOP/Common.cls +344 -0
  52. iop/cls/IOP/Director.cls +62 -0
  53. iop/cls/IOP/Duplex/Operation.cls +29 -0
  54. iop/cls/IOP/Duplex/Process.cls +229 -0
  55. iop/cls/IOP/Duplex/Service.cls +9 -0
  56. iop/cls/IOP/InboundAdapter.cls +22 -0
  57. iop/cls/IOP/Message/JSONSchema.cls +125 -0
  58. iop/cls/IOP/Message.cls +729 -0
  59. iop/cls/IOP/OutboundAdapter.cls +36 -0
  60. iop/cls/IOP/PickleMessage.cls +58 -0
  61. iop/cls/IOP/PrivateSession/Duplex.cls +260 -0
  62. iop/cls/IOP/PrivateSession/Message/Ack.cls +32 -0
  63. iop/cls/IOP/PrivateSession/Message/Poll.cls +32 -0
  64. iop/cls/IOP/PrivateSession/Message/Start.cls +32 -0
  65. iop/cls/IOP/PrivateSession/Message/Stop.cls +48 -0
  66. iop/cls/IOP/Service/WSGI.cls +310 -0
  67. iop/cls/IOP/Test.cls +85 -0
  68. iop/cls/IOP/Utils.cls +378 -0
  69. iop/wsgi/handlers.py +104 -0
  70. iris_pex_embedded_python-3.2.1b2.dist-info/METADATA +90 -0
  71. iris_pex_embedded_python-3.2.1b2.dist-info/RECORD +139 -0
  72. {iris_pex_embedded_python-2.3.25b2.dist-info → iris_pex_embedded_python-3.2.1b2.dist-info}/WHEEL +1 -1
  73. iris_pex_embedded_python-3.2.1b2.dist-info/entry_points.txt +2 -0
  74. {iris_pex_embedded_python-2.3.25b2.dist-info → iris_pex_embedded_python-3.2.1b2.dist-info}/top_level.txt +1 -1
  75. grongier/pex/_business_operation.py +0 -70
  76. grongier/pex/_business_process.py +0 -215
  77. iris/__init__.py +0 -60
  78. iris/__init__.pyi +0 -236
  79. iris/iris_ipm.py +0 -40
  80. iris/iris_ipm.pyi +0 -17
  81. iris_pex_embedded_python-2.3.25b2.dist-info/METADATA +0 -1384
  82. iris_pex_embedded_python-2.3.25b2.dist-info/RECORD +0 -113
  83. iris_pex_embedded_python-2.3.25b2.dist-info/entry_points.txt +0 -2
  84. {grongier/pex → iop}/_pickle_message.py +0 -0
  85. {iris_pex_embedded_python-2.3.25b2.dist-info → iris_pex_embedded_python-3.2.1b2.dist-info}/LICENSE +0 -0
@@ -1,9 +1,4 @@
1
- Class Grongier.PEX.DuplexService Extends Grongier.PEX.PrivateSessionDuplex
1
+ Class Grongier.PEX.DuplexService Extends IOP.PrivateSessionDuplex
2
2
  {
3
3
 
4
- ClassMethod OnBusinessType(pItem As Ens.Config.Item) As %Integer
5
- {
6
- Quit $$$eHostTypeService
7
- }
8
-
9
4
  }
@@ -2,21 +2,7 @@
2
2
  Cambridge, Massachusetts, U.S.A. All rights reserved.
3
3
  Confidential property of InterSystems Corporation. */
4
4
 
5
- Class Grongier.PEX.InboundAdapter Extends (Ens.InboundAdapter, Grongier.PEX.Common) [ Inheritance = right, ProcedureBlock, System = 4 ]
5
+ Class Grongier.PEX.InboundAdapter Extends IOP.InboundAdapter [ Inheritance = right, ProcedureBlock, System = 4 ]
6
6
  {
7
7
 
8
- Parameter SETTINGS = "%classname:Python InboundAdapter,%module:Python InboundAdapter,%settings:Python InboundAdapter,%classpaths:Python InboundAdapter";
9
-
10
- Method OnTask() As %Status
11
- {
12
- set tSC = $$$OK
13
- try {
14
- $$$ThrowOnError(..Connect())
15
- do ..%class."on_task"()
16
- } catch ex {
17
- set tSC = ex.AsStatus()
18
- }
19
- quit tSC
20
- }
21
-
22
8
  }
@@ -2,126 +2,11 @@
2
2
  Cambridge, Massachusetts, U.S.A. All rights reserved.
3
3
  Confidential property of InterSystems Corporation. */
4
4
 
5
- Class Grongier.PEX.Message Extends (Ens.MessageBody, %CSP.Page, %XML.Adaptor)
5
+ Class Grongier.PEX.Message Extends IOP.Message
6
6
  {
7
7
 
8
- Parameter BUFFER = 64000;
9
-
10
- Property classname As %String(MAXLEN = "");
11
-
12
- Property jsonObject As %DynamicObject(XMLPROJECTION = "None");
13
-
14
- Property json As %String(MAXLEN = "");
15
-
16
- Property jstr As %Stream.GlobalCharacter [ Internal, Private ];
17
-
18
- Method %OnNew(classname) As %Status [ Private, ServerOnly = 1 ]
19
- {
20
- set ..classname = $g(classname)
21
- Quit $$$OK
22
- }
23
-
24
- Method jsonGet()
25
- {
26
- QUIT ..GetObjectJson()
27
- }
28
-
29
- Method jsonSet(value) As %Status
30
- {
31
- set ..jsonObject = {}.%FromJSON(value)
32
- set ..jstr = ##class(%Stream.GlobalCharacter).%New()
33
- do ..jstr.Write(value)
34
- return $$$OK
35
- }
36
-
37
- Method %DispatchGetProperty(property As %String) As %ObjectHandle
38
- {
39
- quit $property(..jsonObject,property)
40
- }
41
-
42
- Method %DispatchSetProperty(
43
- property As %String,
44
- value)
45
- {
46
- set $property(..jsonObject,property) = value
47
- quit
48
- }
49
-
50
- Method GetObjectJson(ByRef atEnd)
51
- {
52
- set atEnd = 1
53
- set json = ..jsonObject.%ToJSON()
54
- if json = "{}" {
55
- d ..jstr.Rewind()
56
- set json = ..jstr.Read(..#BUFFER)
57
- set atEnd = ..jstr.AtEnd
58
- }
59
- QUIT json
60
- }
61
-
62
- /// This method is called by the Management Portal to determine the content type that will be returned by the <method>%ShowContents</method> method.
63
- /// The return value is a string containing an HTTP content type.
64
- Method %GetContentType() As %String
65
- {
66
- Quit "text/html"
67
- }
68
-
69
- /// This method is called by the Management Portal to display a portion of the HEAD section of a message-specific content viewer.<br>
70
- Method %ShowContentsHead(pZenOutput As %Boolean = 0)
71
- {
72
- &html<<script src="https://code.jquery.com/jquery-2.1.1.min.js"></script>>
73
- &html<<script>var makeCompleteJSON=function(l,n){for(var r=["{","}","[","]",'"',"'"],t=function(l){for(var n=l.split(""),r=null,t=[],u=0;u<n.length;u++)char=n[u],"'"!=char&&'"'!=char||(null==r?r=char:r==char&&(r=null)),null==r&&":"==char&&t.push(u);return 1==t.length&&t[0]!=n.length-1},u=[],p=null,e=l.split(""),h="",o=-1,a=[],i=0;i<e.length;i++){if($.inArray(e[i],r)>-1){if(0==u.length&&("'"==e[i]||'"'==e[i]))return!1;'"'==p||"'"==p?p==e[i]&&(u.pop(),p=u[u.length-1]):"}"==e[i]&&"{"==p?(u.pop(),a.pop(),p=u[u.length-1],h="",o=-1):"]"==e[i]&&"["==p?(u.pop(),a.pop(),p=u[u.length-1]):(u.push(e[i]),"["==(p=e[i])&&a.push("array"),"{"==p&&(a.push("object"),o=i))}"object"==a[a.length-1]&&(h+=e[i])}if(!n&&o>-1){var s=function(l){for(var n=l.split(""),r=null,u=null,p=[],e=1;e<n.length;e++)"'"!=(r=n[e])&&'"'!=r||(null==u?u=r:u==r&&(u=null)),null==u&&","==r&&p.push(e);var h=[],o=1;for(e=0;e<p.length;e++)h.push($.trim(l.substring(o,p[e]))),o=p[e]+1;h.push($.trim(l.substring(o)));var a=h[h.length-1];return a.split(""),t(a)||h.pop(),"{"+h.join(",")}(h);return l=l.substring(0,o)+s,makeCompleteJSON(l,!0)}for(;u.length>0;)'"'==(p=u.pop())&&(l+='"'),"'"==p&&(l+="'"),"{"==p&&(l+="}"),"["==p&&(l+="]");return l};</script>>
74
- &html<<script>!function(e){"use strict";var n=function(n){var a=e("<span />",{"class":"collapser",on:{click:function(){var n=e(this);n.toggleClass("collapsed");var a=n.parent().children(".block"),p=a.children("ul");n.hasClass("collapsed")?(p.hide(),a.children(".dots, .comments").show()):(p.show(),a.children(".dots, .comments").hide())}}});return n&&a.addClass("collapsed"),a},a=function(a,p){var t=e.extend({},{nl2br:!0},p),r=function(e){return e.toString()?e.toString().replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;"):""},s=function(n,a){return e("<span />",{"class":a,html:r(n)})},l=function(a,p){switch(e.type(a)){case"object":p||(p=0);var c=e("<span />",{"class":"block"}),d=Object.keys(a).length;if(!d)return c.append(s("{","b")).append(" ").append(s("}","b"));c.append(s("{","b"));var i=e("<ul />",{"class":"obj collapsible level"+p});return e.each(a,function(a,t){d--;var r=e("<li />").append(s('"',"q")).append(a).append(s('"',"q")).append(": ").append(l(t,p+1));-1===["object","array"].indexOf(e.type(t))||e.isEmptyObject(t)||r.prepend(n()),d>0&&r.append(","),i.append(r)}),c.append(i),c.append(s("...","dots")),c.append(s("}","b")),c.append(1===Object.keys(a).length?s("// 1 item","comments"):s("// "+Object.keys(a).length+" items","comments")),c;case"array":p||(p=0);var d=a.length,c=e("<span />",{"class":"block"});if(!d)return c.append(s("[","b")).append(" ").append(s("]","b"));c.append(s("[","b"));var i=e("<ul />",{"class":"obj collapsible level"+p});return e.each(a,function(a,t){d--;var r=e("<li />").append(l(t,p+1));-1===["object","array"].indexOf(e.type(t))||e.isEmptyObject(t)||r.prepend(n()),d>0&&r.append(","),i.append(r)}),c.append(i),c.append(s("...","dots")),c.append(s("]","b")),c.append(1===a.length?s("// 1 item","comments"):s("// "+a.length+" items","comments")),c;case"string":if(a=r(a),/^(http|https|file):\/\/[^\s]+$/i.test(a))return e("<span />").append(s('"',"q")).append(e("<a />",{href:a,text:a})).append(s('"',"q"));if(t.nl2br){var o=/\n/g;o.test(a)&&(a=(a+"").replace(o,"<br />"))}var u=e("<span />",{"class":"str"}).html(a);return e("<span />").append(s('"',"q")).append(u).append(s('"',"q"));case"number":return s(a.toString(),"num");case"undefined":return s("undefined","undef");case"null":return s("null","null");case"boolean":return s(a?"true":"false","bool")}};return l(a)};return e.fn.jsonView=function(n,p){var t=e(this);if(p=e.extend({},{nl2br:!0},p),"string"==typeof n)try{n=JSON.parse(n)}catch(r){}return t.append(e("<div />",{"class":"json-view"}).append(a(n,p))),t}}(jQuery);</script>>
75
- &html<<style type="text/css">
76
- .json-view{position:relative}
77
- .json-view .collapser{width:20px;height:18px;display:block;position:absolute;left:-1.7em;top:-.2em;z-index:5;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAYAAADED76LAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAD1JREFUeNpiYGBgOADE%2F3Hgw0DM4IRHgSsDFOzFInmMAQnY49ONzZRjDFiADT7dMLALiE8y4AGW6LoBAgwAuIkf%2F%2FB7O9sAAAAASUVORK5CYII%3D);background-repeat:no-repeat;background-position:center center;opacity:.5;cursor:pointer}
78
- .json-view .collapsed{-ms-transform:rotate(-90deg);-moz-transform:rotate(-90deg);-khtml-transform:rotate(-90deg);-webkit-transform:rotate(-90deg);-o-transform:rotate(-90deg);transform:rotate(-90deg)}
79
- .json-view .bl{display:block;padding-left:20px;margin-left:-20px;position:relative}
80
- .json-view {font-family:Verdana,sans-serif; font-size: 0.8em;}
81
- .json-view ul{list-style-type:none;padding-left:2em;border-left:1px dotted;margin:.3em}
82
- .json-view ul li{position:relative;color:#012E55}
83
- .json-view .comments,.json-view .dots{display:none;-moz-user-select:none;-ms-user-select:none;-khtml-user-select:none;-webkit-user-select:none;-o-user-select:none;user-select:none}
84
- .json-view .comments{padding-left:.8em;font-style:italic;color:#888}
85
- .json-view .bool,.json-view .null,.json-view .num,.json-view .undef{font-weight:700;color:#1A01CC}
86
- .json-view .str{color:#F79243}
87
- </style>>
88
- }
89
-
90
- /// This method is called by the Management Portal to display a message-specific content viewer.<br>
91
- /// This method displays its content by writing out to the current device.
92
- /// The content should match the type returned by the <method>%GetContentType</method> method.<br>
93
- Method %ShowContents(pZenOutput As %Boolean = 0)
94
- {
95
- set jsonObject = ..QuoteJS(..GetObjectJson(.atEnd))
96
- set buffer = ..#BUFFER
97
- if 'atEnd {
98
- &html<<div>Warning JSON projection is not comptete, it's truncated, #(buffer)# charaters display</div>>
99
- }
100
- // https://github.com/bazh/jquery.json-view
101
- &html<<div id="element">#(..classname)#</div>>
102
- &html<<script>$(function() {$('#element').jsonView(makeCompleteJSON(#(jsonObject)#,false));});</script>>
103
- }
104
-
105
8
  Storage Default
106
9
  {
107
- <Data name="MessageDefaultData">
108
- <Subscript>"Message"</Subscript>
109
- <Value name="1">
110
- <Value>classname</Value>
111
- </Value>
112
- <Value name="2">
113
- <Value>json</Value>
114
- </Value>
115
- <Value name="3">
116
- <Value>jstr</Value>
117
- </Value>
118
- </Data>
119
- <Data name="jsonObject">
120
- <Attribute>jsonObject</Attribute>
121
- <Structure>node</Structure>
122
- <Subscript>"Grongier.PEX.Message.jsonObject"</Subscript>
123
- </Data>
124
- <DefaultData>MessageDefaultData</DefaultData>
125
10
  <Type>%Storage.Persistent</Type>
126
11
  }
127
12
 
@@ -2,35 +2,7 @@
2
2
  Cambridge, Massachusetts, U.S.A. All rights reserved.
3
3
  Confidential property of InterSystems Corporation. */
4
4
 
5
- Class Grongier.PEX.OutboundAdapter Extends (Ens.OutboundAdapter, Grongier.PEX.Common) [ Inheritance = right, ProcedureBlock, System = 4 ]
5
+ Class Grongier.PEX.OutboundAdapter Extends IOP.OutboundAdapter [ Inheritance = right, ProcedureBlock, System = 4 ]
6
6
  {
7
7
 
8
- Property KeepaliveInterval As %Numeric [ InitialExpression = 0 ];
9
-
10
- Parameter SETTINGS = "KeepaliveInterval:Python CallInterval,%classname:Python OutboundAdapter,%module:Python OutboundAdapter,%settings:Python OutboundAdapter,%classpaths:Python OutboundAdapter";
11
-
12
- Method %DispatchMethod(
13
- method As %String,
14
- args...) As %ObjectHandle
15
- {
16
- if $quit {
17
- quit $method($this.%class,method,args...)
18
- } else {
19
- do $method($this.%class,method,args...)
20
- quit
21
- }
22
- }
23
-
24
- Method OnKeepalive(pStatus As %Status = {$$$OK}) As %Status
25
- {
26
- set tSC = $$$OK
27
- try {
28
- $$$ThrowOnError(##super(pStatus))
29
- do ..%class."on_keepalive"()
30
- } catch ex {
31
- set tSC = ex.AsStatus()
32
- }
33
- quit tSC
34
- }
35
-
36
8
  }
@@ -2,56 +2,11 @@
2
2
  Cambridge, Massachusetts, U.S.A. All rights reserved.
3
3
  Confidential property of InterSystems Corporation. */
4
4
 
5
- Class Grongier.PEX.PickleMessage Extends (Ens.MessageBody, %CSP.Page)
5
+ Class Grongier.PEX.PickleMessage Extends IOP.PickleMessage
6
6
  {
7
7
 
8
- Property classname As %String(MAXLEN = "");
9
-
10
- Property jstr As %Stream.GlobalCharacter [ Internal, Private ];
11
-
12
- Method %OnNew(classname) As %Status [ Private, ServerOnly = 1 ]
13
- {
14
- set ..classname = $g(classname)
15
- Quit $$$OK
16
- }
17
-
18
- /// This method is called by the Management Portal to determine the content type that will be returned by the <method>%ShowContents</method> method.
19
- /// The return value is a string containing an HTTP content type.
20
- Method %GetContentType() As %String
21
- {
22
- Quit "text/html"
23
- }
24
-
25
- /// This method is called by the Management Portal to display a message-specific content viewer.<br>
26
- /// This method displays its content by writing out to the current device.
27
- /// The content should match the type returned by the <method>%GetContentType</method> method.<br>
28
- Method %ShowContents(pZenOutput As %Boolean = 0)
29
- {
30
- // https://github.com/bazh/jquery.json-view
31
- &html<<div id="element">#(..classname)#</div>>
32
- &html<<div>Pickle Pyhton Message can't be displayed</div>>
33
- }
34
-
35
8
  Storage Default
36
9
  {
37
- <Data name="MessageDefaultData">
38
- <Subscript>"Message"</Subscript>
39
- <Value name="1">
40
- <Value>classname</Value>
41
- </Value>
42
- <Value name="2">
43
- <Value>json</Value>
44
- </Value>
45
- <Value name="3">
46
- <Value>jstr</Value>
47
- </Value>
48
- </Data>
49
- <Data name="jsonObject">
50
- <Attribute>jsonObject</Attribute>
51
- <Structure>node</Structure>
52
- <Subscript>"Grongier.PEX.Message.jsonObject"</Subscript>
53
- </Data>
54
- <DefaultData>MessageDefaultData</DefaultData>
55
10
  <Type>%Storage.Persistent</Type>
56
11
  }
57
12
 
@@ -2,259 +2,7 @@
2
2
  Cambridge, Massachusetts, U.S.A. All rights reserved.
3
3
  Confidential property of InterSystems Corporation. */
4
4
 
5
- Class Grongier.PEX.PrivateSessionDuplex Extends (Grongier.PEX.Common, Ens.BusinessDuplex) [ Abstract, System = 4 ]
5
+ Class Grongier.PEX.PrivateSessionDuplex Extends IOP.PrivateSessionDuplex [ Abstract, System = 4 ]
6
6
  {
7
7
 
8
- /// Domain for error messages
9
- Parameter DOMAIN = "PrivateSession";
10
-
11
- Parameter SETTINGS = "DuplexTargetConfigName,%classname:Python BusinessProcess,%module:Python BusinessProcess,%settings:Python BusinessProcess,%classpaths:Python BusinessProcess";
12
-
13
- /// Configuration item(s) to which to send messages
14
- Property DuplexTargetConfigName As %String(MAXLEN = 1000);
15
-
16
- /// This holds the deferred response token
17
- Property DeferredResponseToken As %String;
18
-
19
- /// This holds data that is not yet ready for processing
20
- Property ReceivedDataQueue As list Of %Library.Persistent;
21
-
22
- /// This method is called by the TCP Adapter when a message is received.
23
- Method OnProcessInput(
24
- pInput As %Persistent,
25
- Output pOutput As %Persistent,
26
- ByRef pHint As %String) As %Status
27
- {
28
- set tSC = $$$OK
29
- try {
30
- try {
31
- set ..%class."_wait_for_next_call_interval" = ..%WaitForNextCallInterval
32
- }catch {}
33
- set pOutput = ..%class."_dispatch_on_process_input"(pInput)
34
- try {
35
- set ..%WaitForNextCallInterval = ..%class."_wait_for_next_call_interval"
36
- }catch {}
37
- } catch ex {
38
- set tSC = ex.AsStatus()
39
- }
40
- quit tSC
41
- }
42
-
43
- Method dispatchSendDocumentToProcess(pDocument) As %String
44
- {
45
- set tSC = ..SendDocumentToProcess(pDocument)
46
- if $$$ISERR(tSC) throw ##class(%Exception.StatusException).CreateFromStatus(tSC)
47
- quit
48
- }
49
-
50
- Method SendDocumentToProcess(pDocument As %Library.Persistent) As %Status
51
- {
52
- #dim tSC As %Status = $$$OK
53
- try {
54
- If '..%InPrivateSession Set tSC=..StartPrivateSession() Quit:$$$ISERR(tSC)
55
- If ..DeferredResponseToken'="" {
56
- Set tSC=..SendDeferredResponse(..DeferredResponseToken,pDocument) If $$$ISERR(tSC) Quit
57
- Set ..DeferredResponseToken=""
58
- } else {
59
- Do ..ReceivedDataQueue.Insert(pDocument)
60
- }
61
- } catch {
62
- Set tSC=$$$EnsSystemError
63
- }
64
- Quit tSC
65
- }
66
-
67
- Method StartPrivateSession() As %Status
68
- {
69
- #dim tSC As %Status = $$$OK
70
- try {
71
- If ..%InPrivateSession Quit
72
- Set tSC = ..RegisterPrivateSession() Quit:$$$ISERR(tSC)
73
- Set tSC=..SendRequestAsync(..DuplexTargetConfigName,##class(Grongier.PEX.PrivateSession.Message.Start).%New()) Quit:$$$ISERR(tSC)
74
- Set tSC = ..OnPrivateSessionStarted(1) Quit:$$$ISERR(tSC)
75
- } catch {
76
- Set tSC=$$$EnsSystemError
77
- }
78
- Quit tSC
79
- }
80
-
81
- Method StopPrivateSession(pAttachedMessage As %Persistent = "") As %Status
82
- {
83
- #dim tSC As %Status = $$$OK
84
- #dim tMessageHeaderId As %String
85
- #dim tRequestHeader As Ens.MessageHeader
86
- try {
87
- If ..%InPrivateSession {
88
- #; Target might receive stop message before this job unregisters and therefore need to remove queue pointer
89
- If ..DeferredResponseToken'="" {
90
- try {
91
- Set tMessageHeaderId=$p(..DeferredResponseToken,"|",1)
92
- Set tRequestHeader=##Class(Ens.MessageHeader).%OpenId(tMessageHeaderId,,.tSC) Quit:$$$ISERR(tSC)
93
- If $$$ConfigSessionQueueName(..%ConfigName,..%PrivateSessionId)'=tRequestHeader.ReturnQueueName {
94
- Kill $$$ConfigSessionQueueName(..%ConfigName,..%PrivateSessionId)
95
- }
96
- Set tRequestHeader=""
97
- } catch {}
98
- }
99
- Set tSC=..SendDocumentToProcess(##class(Grongier.PEX.PrivateSession.Message.Stop).%New(pAttachedMessage)) Quit:$$$ISERR(tSC)
100
- Set tSC=..UnRegisterPrivateSession()
101
- set ..DeferredResponseToken=""
102
-
103
- #; Ensure all messages are delivered including STOP message (JN1098)
104
- #; Do ..ReceivedDataQueue.Clear()
105
- Set tSC=..OnPrivateSessionStopped(1) Quit:$$$ISERR(tSC)
106
- }
107
- } catch {
108
- Set tSC=$$$EnsSystemError
109
- }
110
- Quit tSC
111
- }
112
-
113
- Method RegisterPrivateSession() As %Status
114
- {
115
- If ..%InPrivateSession Quit $$$OK
116
- If ..%SessionId="" Set tSC=..ForceSessionId() Quit:$$$ISERR(tSC) tSC
117
- Set ..%PrivateSessionId=..%SessionId
118
- Set tSC = ##class(Ens.Queue).Create(..QueueName()) Quit:$$$ISERR(tSC) tSC
119
-
120
- try {
121
- Set tSC=..Adapter.OpenEventDevice()
122
- }
123
- catch {
124
-
125
- }
126
-
127
- Set $$$ConfigSessionQueueName(..%ConfigName,..%SessionId)=..QueueName()
128
- $$$sysTRACE("Registered Private Session '"_..%PrivateSessionId_"'")
129
- Quit $$$OK
130
- }
131
-
132
- Method UnRegisterPrivateSession() As %Status
133
- {
134
- If '..%InPrivateSession Quit $$$OK
135
- Kill $$$ConfigSessionQueueName(..%ConfigName,..%PrivateSessionId)
136
- try {
137
- Set tSC=..Adapter.CloseEventDevice()
138
- }
139
- catch {
140
-
141
- }
142
-
143
- Set tSC=##class(Ens.Queue).Delete(..QueueName(),"*") Quit:$$$ISERR(tSC) tSC
144
- $$$sysTRACE("Unregistered Private Session '"_..%PrivateSessionId_"'")
145
- Set ..%PrivateSessionId=""
146
- Set ..%SessionId=""
147
- Kill $$$JobSessionId
148
- Quit $$$OK
149
- }
150
-
151
- XData MessageMap
152
- {
153
- <MapItems>
154
- <MapItem MessageType="Grongier.PEX.PrivateSession.Message.Start"><Method>OnMsgPrivateSessionStart</Method></MapItem>
155
- <MapItem MessageType="Grongier.PEX.PrivateSession.Message.Stop"><Method>OnMsgPrivateSessionStop</Method></MapItem>
156
- <MapItem MessageType="Grongier.PEX.PrivateSession.Message.Poll"><Method>OnMsgPrivateSessionPoll</Method></MapItem>
157
- </MapItems>
158
- }
159
-
160
- Method OnMsgPrivateSessionStart(
161
- pRequest As Grongier.PEX.PrivateSession.Message.Start,
162
- Output pResponse As %Library.Persistent) As %Status
163
- {
164
- #dim tSC As %Status = $$$OK
165
- try {
166
- Set tSC=..RegisterPrivateSession() Quit:$$$ISERR(tSC)
167
- Set tSC=..OnPrivateSessionStarted(0) Quit:$$$ISERR(tSC)
168
- Kill %objlasterror Set pResponse=##class(Grongier.PEX.PrivateSession.Message.Ack).%New()
169
- If '$IsObject(pResponse) Set tSC=$$$ERROR($$$FailedToNewClass,"Grongier.PEX.PrivateSession.Message.Ack") Quit
170
- } catch {
171
- Set tSC=$$$EnsSystemError
172
- }
173
- Quit tSC
174
- }
175
-
176
- Method OnMsgPrivateSessionStop(
177
- pRequest As Grongier.PEX.PrivateSession.Message.Stop,
178
- Output pResponse As %Library.Persistent) As %Status
179
- {
180
- #dim tSC As %Status = $$$OK
181
- try {
182
- Set tSC=..UnRegisterPrivateSession() Quit:$$$ISERR(tSC)
183
- set ..DeferredResponseToken=""
184
- do ..ReceivedDataQueue.Clear()
185
- Set tSC=..OnPrivateSessionStopped(0,pRequest.AttachedMessage) Quit:$$$ISERR(tSC)
186
- } catch {
187
- Set tSC=$$$EnsSystemError
188
- }
189
- Quit tSC
190
- }
191
-
192
- Method OnMsgPrivateSessionPoll(
193
- pPollIn As Grongier.PEX.PrivateSession.Message.Poll,
194
- Output pResponse As %Library.Persistent) As %Status
195
- {
196
- #dim tSC As %Status = $$$OK
197
- #dim tToken As %String
198
- try {
199
- If ..ReceivedDataQueue.Count() {
200
- Set pResponse=..ReceivedDataQueue.GetAt(1)
201
- do ..ReceivedDataQueue.RemoveAt(1)
202
- } Else {
203
- Set tSC=..DeferResponse(.tToken) If $$$ISERR(tSC) Quit
204
- Set ..DeferredResponseToken=tToken
205
- }
206
- } catch {
207
- Set tSC=$$$EnsSystemError
208
- }
209
- Quit tSC
210
- }
211
-
212
- /// Return an array of connections for drawing lines on the config diagram
213
- ClassMethod OnGetConnections(
214
- Output pArray As %String,
215
- pItem As Ens.Config.Item)
216
- {
217
- Do ##super(.pArray,pItem)
218
- If pItem.GetModifiedSetting("DuplexTargetConfigName",.tValue) {
219
- Set tOne=$ZStrip(tValue,"<>W")
220
- Set:""'=tOne pArray(tOne)=""
221
- }
222
- }
223
-
224
- Method OnPrivateSessionStarted(pSelfGenerated As %Boolean) As %Status
225
- {
226
- set tSC = $$$OK
227
- try {
228
- set response = ..%class."_dispatch_on_private_session_started"($this,pSelfGenerated)
229
- } catch ex {
230
- set tSC = ex.AsStatus()
231
- }
232
- quit tSC
233
- }
234
-
235
- Method OnPrivateSessionStopped(
236
- pSelfGenerated As %Boolean,
237
- pAttachedMessage As %Persistent = "") As %Status
238
- {
239
- set tSC = $$$OK
240
- try {
241
- set response = ..%class."_dispatch_on_private_session_stopped"($this,pSelfGenerated,pAttachedMessage)
242
- } catch ex {
243
- set tSC = ex.AsStatus()
244
- }
245
- quit tSC
246
- }
247
-
248
- Method OnTearDown() As %Status
249
- {
250
- #dim tSC As %Status = $$$OK
251
- try {
252
- If ..%InPrivateSession Set tSC=..StopPrivateSession() Quit:$$$ISERR(tSC)
253
- do ..%class."_dispatch_on_tear_down"()
254
- } catch {
255
- Set tSC=$$$EnsSystemError
256
- }
257
- Quit tSC
258
- }
259
-
260
8
  }
@@ -3,29 +3,11 @@
3
3
  Confidential property of InterSystems Corporation. */
4
4
 
5
5
  /// This class is a DICOM framework class
6
- Class Grongier.PEX.PrivateSession.Message.Ack Extends (%Persistent, Ens.Util.MessageBodyMethods) [ ClassType = persistent, Inheritance = right, ProcedureBlock, System = 4 ]
6
+ Class Grongier.PEX.PrivateSession.Message.Ack Extends IOP.PrivateSession.Message.Ack [ ClassType = persistent, Inheritance = right, ProcedureBlock, System = 4 ]
7
7
  {
8
8
 
9
- Parameter DOMAIN = "PrivateSession";
10
-
11
- /// From 'Ens.Util.MessageBodyMethods'
12
- Method %ShowContents(pZenOutput As %Boolean = 0)
13
- {
14
- Write $$$Text("(session-ack)")
15
- }
16
-
17
9
  Storage Default
18
10
  {
19
- <Data name="AckDefaultData">
20
- <Value name="1">
21
- <Value>%%CLASSNAME</Value>
22
- </Value>
23
- </Data>
24
- <DataLocation>^Grongier.PEX.PrivateSe9756.AckD</DataLocation>
25
- <DefaultData>AckDefaultData</DefaultData>
26
- <IdLocation>^Grongier.PEX.PrivateSe9756.AckD</IdLocation>
27
- <IndexLocation>^Grongier.PEX.PrivateSe9756.AckI</IndexLocation>
28
- <StreamLocation>^Grongier.PEX.PrivateSe9756.AckS</StreamLocation>
29
11
  <Type>%Storage.Persistent</Type>
30
12
  }
31
13
 
@@ -3,29 +3,11 @@
3
3
  Confidential property of InterSystems Corporation. */
4
4
 
5
5
  /// This class is a DICOM framework class
6
- Class Grongier.PEX.PrivateSession.Message.Poll Extends (%Persistent, Ens.Util.MessageBodyMethods) [ ClassType = persistent, Inheritance = right, ProcedureBlock, System = 4 ]
6
+ Class Grongier.PEX.PrivateSession.Message.Poll Extends IOP.PrivateSession.Message.Poll [ ClassType = persistent, Inheritance = right, ProcedureBlock, System = 4 ]
7
7
  {
8
8
 
9
- Parameter DOMAIN = "PrivateSession";
10
-
11
- /// From 'Ens.Util.MessageBodyMethods'
12
- Method %ShowContents(pZenOutput As %Boolean = 0)
13
- {
14
- Write $$$Text("(poll-data)")
15
- }
16
-
17
9
  Storage Default
18
10
  {
19
- <Data name="PollDefaultData">
20
- <Value name="1">
21
- <Value>%%CLASSNAME</Value>
22
- </Value>
23
- </Data>
24
- <DataLocation>^Grongier.PEX.PrivateS9756.PollD</DataLocation>
25
- <DefaultData>PollDefaultData</DefaultData>
26
- <IdLocation>^Grongier.PEX.PrivateS9756.PollD</IdLocation>
27
- <IndexLocation>^Grongier.PEX.PrivateS9756.PollI</IndexLocation>
28
- <StreamLocation>^Grongier.PEX.PrivateS9756.PollS</StreamLocation>
29
11
  <Type>%Storage.Persistent</Type>
30
12
  }
31
13
 
@@ -3,29 +3,11 @@
3
3
  Confidential property of InterSystems Corporation. */
4
4
 
5
5
  /// This class is a DICOM framework class
6
- Class Grongier.PEX.PrivateSession.Message.Start Extends (%Persistent, Ens.Util.MessageBodyMethods) [ ClassType = persistent, Inheritance = right, ProcedureBlock, System = 4 ]
6
+ Class Grongier.PEX.PrivateSession.Message.Start Extends IOP.PrivateSession.Message.Start [ ClassType = persistent, Inheritance = right, ProcedureBlock, System = 4 ]
7
7
  {
8
8
 
9
- Parameter DOMAIN = "PrivateSession";
10
-
11
- /// From 'Ens.Util.MessageBodyMethods'
12
- Method %ShowContents(pZenOutput As %Boolean = 0)
13
- {
14
- Write $$$Text("(session-start)")
15
- }
16
-
17
9
  Storage Default
18
10
  {
19
- <Data name="StartDefaultData">
20
- <Value name="1">
21
- <Value>%%CLASSNAME</Value>
22
- </Value>
23
- </Data>
24
- <DataLocation>^Grongier.PEX.Private9756.StartD</DataLocation>
25
- <DefaultData>StartDefaultData</DefaultData>
26
- <IdLocation>^Grongier.PEX.Private9756.StartD</IdLocation>
27
- <IndexLocation>^Grongier.PEX.Private9756.StartI</IndexLocation>
28
- <StreamLocation>^Grongier.PEX.Private9756.StartS</StreamLocation>
29
11
  <Type>%Storage.Persistent</Type>
30
12
  }
31
13
 
@@ -3,45 +3,11 @@
3
3
  Confidential property of InterSystems Corporation. */
4
4
 
5
5
  /// This class is a DICOM framework class
6
- Class Grongier.PEX.PrivateSession.Message.Stop Extends (%Persistent, Ens.Util.MessageBodyMethods) [ ClassType = persistent, Inheritance = right, ProcedureBlock, System = 4 ]
6
+ Class Grongier.PEX.PrivateSession.Message.Stop Extends IOP.PrivateSession.Message.Stop [ ClassType = persistent, Inheritance = right, ProcedureBlock, System = 4 ]
7
7
  {
8
8
 
9
- Parameter DOMAIN = "PrivateSession";
10
-
11
- /// The message body
12
- Property AttachedMessage As %Persistent(CLASSNAME = 1);
13
-
14
- /// From 'Ens.Util.MessageBodyMethods'
15
- Method %ShowContents(pZenOutput As %Boolean = 0)
16
- {
17
- If $IsObject(..AttachedMessage) {
18
- Write $$$FormatText($$$Text("(session-stop) with AttachedMessage [%1] "),$classname(..AttachedMessage))
19
- } Else {
20
- Write $$$Text("(session-stop)")
21
- }
22
- }
23
-
24
- Method %OnNew(initvalue As %RegisteredObject) As %Status [ Private, ProcedureBlock = 1, ServerOnly = 1 ]
25
- {
26
- Set ..AttachedMessage=initvalue
27
- Quit $$$OK
28
- }
29
-
30
9
  Storage Default
31
10
  {
32
- <Data name="StopDefaultData">
33
- <Value name="1">
34
- <Value>%%CLASSNAME</Value>
35
- </Value>
36
- <Value name="2">
37
- <Value>AttachedMessage</Value>
38
- </Value>
39
- </Data>
40
- <DataLocation>^Grongier.PEX.PrivateS9756.StopD</DataLocation>
41
- <DefaultData>StopDefaultData</DefaultData>
42
- <IdLocation>^Grongier.PEX.PrivateS9756.StopD</IdLocation>
43
- <IndexLocation>^Grongier.PEX.PrivateS9756.StopI</IndexLocation>
44
- <StreamLocation>^Grongier.PEX.PrivateS9756.StopS</StreamLocation>
45
11
  <Type>%Storage.Persistent</Type>
46
12
  }
47
13