source: BMXNET_RPMS_dotNET_UTILITIES-BMX/trunk/m/BMXRPC8.m@ 1580

Last change on this file since 1580 was 1209, checked in by Sam Habiel, 13 years ago

BMXMON fix; updated all routines to v 2.31

File size: 2.3 KB
Line 
1BMXRPC8 ; IHS/OIT/HMW - BMX REMOTE PROCEDURE CALLS ; 12/7/10 8:12am
2 ;;2.31;BMX;;Jul 25, 2011
3 ;
4 ;
5BMXLOCKD(BMXY,BMXVAR,BMXINC,BMXTIME) ;EP
6 ;Entry point for debugging
7 ;
8 D DEBUG^%Serenji("BMXLOCK^BMXRPC8(.BMXY,BMXVAR,BMXINC,BMXTIME)")
9 Q
10 ;
11BMXLOCK(BMXY,BMXVAR,BMXINC,BMXTIME) ;EP
12 ;Called by BMX LOCK rpc to lock variable BMXVAR
13 ;If BMXVAR = "", argumentless lock is performed to release all locks
14 ;BMXINC = increment lock if "+", decrement if "-"
15 ;BMXTIME = lock timeout
16 ;Returns 1 if lock successful, otherwise 0;
17 ;
18 S X="ERR^BMXRPC8",@^%ZOSF("TRAP")
19 ;
20 N BMXC
21 S:$E(BMXVAR,1,1)="~" BMXVAR="^"_$E(BMXVAR,2,$L(BMXVAR))
22 S:BMXTIME="" BMXTIME=0
23 I BMXVAR="" X "L" S BMXY=1 Q
24 S BMXC="L "
25 S BMXC=BMXC_$S(BMXINC="+":"+",BMXINC="-":"-",1:"")
26 S BMXC=BMXC_BMXVAR_":"_+BMXTIME
27 X BMXC
28 S BMXY=$T
29 Q
30 ;
31ERR ;Error processing
32 S BMXY=0
33 Q
34 ;
35BMXVERD(BMXY,BMXNS,BMXLOC) ;EP
36 ;Entry point for debugging
37 ;
38 D DEBUG^%Serenji("BMXVER^BMXRPC8(.BMXY,BMXNS,BMXLOC)")
39 Q
40 ;
41BMXVER(BMXY,BMXNS,BMXLOC) ;EP
42 ;
43 ;Called by BMX VERSION INFO rpc
44 ;Returns recordset of version info for server components in namespace BMXNS.
45 ;If BMXLOC is "", then the version info is assumed to be stored in piece 1-3 of
46 ;^<BMXNS>APPL(1,0)
47 ;
48 ;TODO:
49 ;BMXLOC, if not null, is either a global reference such that $P(@BMXLOC,U,1,3) returns
50 ;MAJOR^MINOR^BUILD
51 ;Or BMXLOC can be an extrinsic function call that returns MAJOR^MINOR^BUILD.
52 ;
53 ;The returned error field is either "" or contains a text error message.
54 ;
55 N X,BMXI,BMXNOD,BMXDAT
56 ;
57 S X="VETRAP^BMXRPC8",@^%ZOSF("TRAP")
58 S BMXI=0
59 K ^BMXTMP($J)
60 S BMXY="^BMXTMP("_$J_")"
61 S ^BMXTMP($J,BMXI)="T00030ERROR^T00030MAJOR_VERSION^T00030MINOR_VERSION^T00030BUILD"_$C(30)
62 S BMXI=BMXI+1
63 I BMXNS="" D VERR(BMXI,"BMXRPC8: Invalid Null Application Namespace") Q
64 S BMXNOD="^"_BMXNS_"APPL(1,0)"
65 S BMXDAT=$G(@BMXNOD)
66 I BMXNS="" D VERR(BMXI,"BMXRPC8: No version info for Application Namespace") Q
67 S ^BMXTMP($J,BMXI)="^"_$P(BMXDAT,U,1,3)_$C(30)
68 Q
69 ;
70 ;
71VERR(BMXI,BMXERR) ;Error processing
72 S BMXI=BMXI+1
73 S ^BMXTMP($J,BMXI)=BMXERR_"^^^"_$C(30)
74 S BMXI=BMXI+1
75 S ^BMXTMP($J,BMXI)=$C(31)
76 Q
77 ;
78VETRAP ;EP Error trap entry
79 D ^%ZTER
80 I '$D(BMXI) N BMXI S BMXI=999999
81 S BMXI=BMXI+1
82 D VERR(BMXI,"BMXRPC8 Error: "_$G(%ZTERROR))
83 Q
84 ;
85IMHERE(BMXRES) ;EP
86 ;Entry point for BMX IM HERE remote procedure
87 S BMXRES=1
88 Q
89 ;
Note: See TracBrowser for help on using the repository browser.